Monday, July 11, 2011

The Art of Software Testing by Glenford Myers : Chapter 2

The issues of economics and human psychology such as feasibility of completely testing a program and adopting an appropriate frame of mind towards testing a program contribute more towards successful testing than do the purely technological considerations.

The author then discuss the incorrect definition of testing such as:
  • Testing is the process of demonstrating that errors are not present
  • The purpose of testing is to show that a program performs its intended functions correctly
  • Testing is the process of establishing confidence that a program does what it is supposed to do
The author then provides more appropriate definition of testing as:
  • Testing is the process of executing a program with the intent of finding errors.
The author points out that it is not enough that a program does what it is supposed to do, it should also not do what it is supposed not to.

The author then discusses about different testing methods:
  • Black-box testing: It is called data-driven or input/output driven technique. The test cases are derived directly from specification and the tester is completely unconcerned about the internal behaviour and structure of the program. The author concludes that exhaustive input testing is not possible.
  • White-box testing: It is called logic-driven testing. Unlike black-box testing which focuses on data, the white-box testing focuses on control-flow and try to exhaustively test all the paths through a program. The author describes two flaws in this kind of testing:
    • Exhaustive path testing is impractical.
    • Even if all the paths are tested, since the testing does not verify whether it generates correct output or not, the program can still have errors.
    • Exhaustive path testing cannot identify missing paths.
The author then discusses Testing Principles as follows:
  1. A necessary part of a test case is a definition of the expected output or result.
  2. A programmer should avoid attempting to test his or her own program.
  3. A programming organization should not test his own programs.
  4. Thoroughly inspect the results of each test.
  5. Test cases must be written for invalid and unexpected, as well as valid and expected, input conditions.
  6. There are two parts of the testing process, testing to see that the program does not do what it is supposed to and that the program does what it is not supposed to do.
  7. Avoid throw-away test cases unless the program is truly a throw-away program.
  8. Do not plan a testing effort under the tacit assumption that no errors will be found.
  9. The probability of the existence of more errors in a section of a program is proportional to the number of errors already found in that section.
  10. Testing is an extremely creating and intellectually challenging task.
  11. A good test case is one that has a high probability of detecting an as-yet undiscovered error.
  12. A successful test case is one that detects an as-yet undiscovered error.

No comments:

Post a Comment