Concept change!!
Classification of faults
Classification of faults
Why do we classify faults?
Fault type
Function
Meaning
Fault that affects capability, end-user interfaces,
product interfaces, interface with hardware
architecture, or global data structure
Interface
Checking
Assignment
Hewlett-Packard fault
classification
Meaning
Fault that involves timing of shared and realtime resources
Testing steps
Fault Classification for HP (1970)
Other Code
11%
Data Handling
6%
Computation
18%
Documentation
19%
Logic
32%
Requirements
5%
Hardware
4%
Process/
Interprocess
5%
Unit Testing
Our goal is to find faults in components.
There are several ways to do this:
Examining the code
Code walkthroughs
Code inspections
Testing components
Testing Components
Testing Components
Equivalence Classes
Every possible input belongs to one of the
classes. That is, the classes cover the entire
set of input data.
No input datum belongs to more than one
class. That is, the classes are disjoint.
If the executing code demonstrates a fault
when using a particular class member is used
as input, then the same fault can be detected
using any other member of the class as input.
That is , any element of the class represents all
elements of that class.
Equivalence Classes
It is not always easy of feasible to tell if
the third restriction can be met and it is
usually rewritten to say:
if a class member is used to detect a fault
then the probability is high that the other
elements in the class will reveal the same
fault.
Common Practice
Usually 'white' box and 'black' box testing are
combined.
Suppose we have a component expects a
positive input value. Then, using 'black' box
testing, we can have a test case for each of
the following:
Common Practice
Using 'white' box testing we can chose one or
more of the following:
Statement testing: Every statement in the
component is executed at least once in some test.
Branch testing: For every decision point in the the
code, each branch is chosen at least once in
some test.
Path testing: Every distinct path through the code
is executed at least once in some test.
Branch testing
Path testing
a = 5;
b=1
k = (a+b) / (a-b);
b=2
y = k / z;
b=3
a = 5; z = 2;
for (b=1; b<=10; b++)
{
k = (a+b) / (a-b);
z++;
y = k / z;
}
k
b=1
z =3
b=2
z =4
b=3
z =5
y
a = 5; b = 10; c = 10;
k = add_two(&a, &b, &c)
cout <<k;
float add_two(float *a, float *b, float *c);
{
c = a + b;
return (&c);
}
Integration testing
Integration testing
Bottom-up integration
Top-down integration
Big-bang integration
Sandwich integration
Comparison of integration
strategies
10
Fault Seeding
We intentionally insert or seed a know
number of faults in a program.
Then another member of the team locate as
many faults as possible.
The number of undiscovered seeded faults
act as an indicator of the total number of
faults(unseeded and seeded) remaining in
the program.
We say:
Fault Seeding
Problems:
It is assumed that the seeded faults are of the
same kind and complexity as the actual faults
in the program.
This is difficult to do since we do not know what
are the typical faults until we have found them.
Fault Seeding
Fault Seeding
Solution
Use two independent groups, Test Group 1
and Test Group 2.
Let x be the number detected by Group 1 and
y the number detected by Group 2.
Some faults will be detected by both groups
say q, such that q <= x and q <= y.
Finally let n be the total number of faults in
the program which we want to estimate.
The effectiveness of each group can be given
by E1 = x/n and E2 = y/n
11
12