Sommerville 9th Edition Chapter 8: Software Testing Exercises
8.2. Explain why testing can only detect the presence of errors, not their absence. Assume that exhaustive testing of a program, where every possible valid input is checked, is impossible (true for all but trivial programs). Test cases either do not reveal a fault in the program or reveal a program fault. If they reveal a program fault then they demonstrate the presence of an error. If they do not reveal a fault, however, this simply means that they have executed a code sequence that – for the inputs chosen – is not faulty. The next test of the same code sequence – with different inputs – could reveal a fault.
Testing partitions are: Strings with only single blank characters 8.4. You have been asked to test a method called ‘catWhiteSpace’ in a ‘Paragraph’ object that, within the paragraph, replaces sequences of blank characters with a single blank character. Identify testing partitions for this example and derive a set of tests for the ‘catWhiteSpace’ method. Testing partitions are: Strings with only single blank characters Strings with sequences of blank characters in the middle of the string Strings with sequences of blank characters at the beginning/end of string
8.4. You have been asked to test a method called ‘catWhiteSpace’ in a ‘Paragraph’ object that, within the paragraph, replaces sequences of blank characters with a single blank character. Identify testing partitions for this example and derive a set of tests for the ‘catWhiteSpace’ method.
8.4. You have been asked to test a method called ‘catWhiteSpace’ in a ‘Paragraph’ object that, within the paragraph, replaces sequences of blank characters with a single blank character. Identify testing partitions for this example and derive a set of tests for the ‘catWhiteSpace’ method.
8. 5. What is regression testing 8.5. What is regression testing? Explain how the use of automated tests and a testing framework such as JUnit simplifies regression testing. Regression testing is the process of running tests for functionality that has already been implemented when new functionality is developed or the system is changed. Regression tests check that the system changes have not introduced problems into the previously implemented code. Automated tests and a testing framework, such as JUnit, radically simplify regression testing as the entire test set can be run automatically each time a change is made. The automated tests include their own checks that the test has been successful or otherwise so the costs of checking the success or otherwise of regression tests is low.
8.7. Write a scenario that could be used to help design tests for the wilderness weather station system. A possible scenario for high-level testing of the weather station system is: John is a meteorologist responsible for producing weather maps for the state of Minnesota. These maps are produced from automatically collected data using a weather mapping system and they show different data about the weather in Minnesota. John selects the area for which the map is to be produced, the time period of the map and requests that the map should be generated. While the map is being created, John runs a weather station check that examines all remotely collected weather station data and looks for gaps in that data – this would imply a problem with the remote weather station.
8. 8. What do you understand by the term ‘stress testing’ 8.8. What do you understand by the term ‘stress testing’? Suggest how you might stress test the MHC-PMS. Stress testing is where you deliberately increase the load on a system beyond its design limit to see how it copes with high loads. The system should degrade gracefully rather than collapse. The MHC-PMS has been designed as a client-server system with the possibility of downloading to a client. To stress test the system, you need to arrange for (a) many different clinics to try and access the system at the same time and (b) Large numbers of records to be added to the system. This may involve using a simulation system to simulate multiple users.
KEY POINTS What is the distinction between validation and verification? What are the advantages of inspections over testing? Briefly describe the three principal stages of testing for a commercial software system. What tests should be included in object class testing? What guidelines does Whittaker suggest for defect testing? What is an equivalence partition? Give an example. What are the three important classes of interface errors?
KEY POINTS (CONT’D) What should be the principal concerns of system testing? Briefly summarize the test-driven development process. What is scenario testing? What is stress testing and why is it useful? What are the three types of user testing?