Please enable JavaScript.
Coggle requires JavaScript to display documents.
STRUCTURE-BASED OR WHITE-BOX TECHNIQUES (Using structure-based techniques…
STRUCTURE-BASED OR WHITE-BOX TECHNIQUES
Using structure-based techniques to measure coverage and design tests
Structure-based test design techniques are a good way of generating additional test cases that are different from existing tests.
What is test coverage?
Test coverage measures in some specific way the amount of testing performed by a set of tests.
Types of coverage
Test coverage can be measured based on a number of different structural elements in a system or component.
Coverage can be measured at componenttesting level, integration-testing level or at system- or acceptance-testing levels.
How to measure coverage
1 Decide on the structural element to be used.
2 Count the structural elements or items.
3 Instrument the code.
4 Run the tests for which coverage measurement is required.
5 Using the output from the instrumentation, determine the percentage of ele
ments or items exercised.
Statement coverage and statement testing
Statement coverage is calculated by:
Studies and experience in the industry have indicated that what is considered
reasonably thorough black-box testing may actually achieve only 60% to 75%
statement coverage.
Typical ad hoc testing is likely to be around 30% this leaves 70% of the statements untested.
Different coverage tools may work in slightly different ways, so they may give different coverage figures for the same set of tests on the same code, although at 100% coverage they should be the same.
Decision coverage and decision testing
A decision is an IF statement, a loop control statement), or a CASE statement, where there are two or more possible exits or outcomes from the statement.
With an IF statement, the exit can
either be TRUE or FALSE, depending on the value of the logical condition that comes after IF.
With a loop control statement, the outcome is either to perform the code within the loop or not - again a True or False exit.
Other structure-based techniques
There are other structure-based techniques that can be used to achieve testing to different degrees of thoroughness
Some techniques are stronger, other are weaker.