Book contents
8 - Building Testing Tools
from Part 3 - Applying Criteria in Practice
Summary
Test criteria are used in several ways, but the most common way is to evaluate tests. That is, sets of test cases are evaluated by how well they cover a criterion. Applying criteria this way is prohibitively expensive, so automated coverage analysis tools are needed to support the tester. A coverage analysis tool accepts a test criterion, a program under test, and a collection of test cases, and computes the amount of coverage of the tests on the program under test. This chapter discusses the design techniques used in these tools. We do not discuss individual tools, although many are available. We also do not discuss the user interface issues, but focus on the core internal algorithms for measuring coverage.
INSTRUMENTATION FOR GRAPH AND LOGICAL EXPRESSION CRITERIA
The primary mechanism used to measure coverage is instrumentation. An instrument is additional program code that does not change the functional behavior of the program but collects some additional information. The instrument can affect the timing in a real-time system, and could also affect concurrency. Thus, such applications require special attention. Careful design can make instrumentation very efficient.
For test criteria coverage, the additional information is whether individual test requirements have been met. An initial example of instrumentation is shown in Figure 8.1. It illustrates a statement that is added to record if the body of an “ifblock” has been reached.
- Type
- Chapter
- Information
- Introduction to Software Testing , pp. 268 - 279Publisher: Cambridge University PressPrint publication year: 2008
- 1
- Cited by