Monday, July 11, 2011

The Art of Software Testing by Glenford Myers : Chapter 5

The author discusses about unit testing in this chapter and enlists following advantages of module testing:

  • It makes combinatorics of managing testing easier.
  • It makes debugging easier.
  • It speeds up testing since multiple modules can be tested simultaneously.
The author then takes an example and generates test cases for it.

The author then discusses incremental testing where one module at a time is integrated with already tested modules and then tested. In non-incremental testing, all the modules are first tested and then integrated to create a program. The author then provides following observations for incremental testing:
  1. Non-incremental testing requires more work.
  2. Programming errors related to mismatching interfaces or incorrect assumptions among modules will be detected earlier if incremental testing is used.
  3. Debugging becomes easier.
  4. Incremental testing results in thorough testing.
  5. Non-incremental approach uses less machine-time.
  6. Non-incremental testing can be more parallelized in the earlier phase.
The author then discuss two approaches of incremental testing:
  • Top-down approach: The author points out following shortcomings of this approach:
    • When a new module is introduced, it is impossible to test some predefined situations.
    • If the newly introduced module is at a distance from the module doing I/O operations, it is difficult to decide the set of inputs that allows to execute all tests on the newly introduced module.
    • Since displayed output is from a module large distance away from the module being tested, correlation between output and behaviour of the module is difficult to establish.
    • Even though it seems possible, it cannot be combined with top-down design.
    • Sometimes, a module may remain untested before moving to the other module.
  • Bottom-up approach: The author points out following advantages/disadvantages of this approach:
    • The working program does not get created till the last module is added.
The author then provides a list of guidelines to perform the actual test:
  • The set of test cases needs to be reviewed or inspected before the test is performed.
  • Use automated test tools.
  • Look at the side effects of a module.
  • Testing of a module should be done by programmer of a calling module.
  • Debugging should always be done by the programmer.
  • If a high number of errors are found in a subset of the modules, such modules should be subjected to further module testing.

No comments:

Post a Comment