|
What
"A test case design technique for a component in which test cases
are
designed to execute statements." BS 7925-1.British Computer
Society
Specialist Interest Group in Software Testing (BCS SIGIST)
Statement Testing is a structural or white box technique, because it is conducted with
reference to the code. Statement testing comes under Dynamic Analysis..
In an ideal world every statement of every component would be fully
tested. However, in the real world this hardly ever happens.
In statement testing every possible statement is tested.
Compare
this to Branch testing, where
each
branch is tested, to check that it can be traversed, whether it
encounters a
statement or not.
In the diagram below, statement testing would have 1 test, as only
the
left hand branch has a statement on it. The alternative branch along
the 2nd
arrow does not have a statement and does not need to be tested.
Why?
1) To find faults
2) Give credible information about the state of
the
component, on which business decisions can be taken.
Who?
Idealy an independent person or body, to the one that wrote the code.
Usually, however it is conducted by the developer.
Where? As close as possible to the point where the code
was
written.
When? As part of component
testing.
How?
Each test case, the following should be specified:-
1) Inputs to the component
2) statement to be executed
3) Expected outcome.
A metric statement coverage is
available to measure how much of the code has been executed.
|