Professional Documents
Culture Documents
Contents
Introduction
Automation of testing
Conclusion
Future challenges
Introduction
Software testing accounts for 50% of the total cost of software development
This cost could be reduced if the process of testing is automated
Testing techniques
Functional testing Structural testing
Testing Process
Specification or Software Selection Criteria Test Cases Test Case Design
Test Oracles
Test Verdicts
Automation of Testing
test data generation tasks mechanical tasks Still performed manually Laborious Time consuming Costly
administrative tasks
1) Find the path predicate for the path 2) Solve the path predicate in terms of input variables
x = y*2
2
F
If (x>=10)
T
x = x+10 y = y+1
4 5
F T
If (x+y <110)
6
printf(OK);
x? y?
Objects
Dynamically allocated Inheritance, Polymorphism
if x y, c = 20 if x = y, c = 50
Loops
Not having a constant number of iterations
Infeasible paths
Solving an arbitrary system of equations is undecidable
Oracle
The only way of achieving an oracle is to supply extra information
requirement/design spec, assertion
Path Selector
Test Paths
Implementation methods
(1) Static Using symbolic execution
(2) Path-oriented
(2) Dynamic
Using function minimization
program execution
a>b
2
ab
3
a>c
4
ac
5
bc
7
b>c
6
ab
11
a=b
8
bc
10
b=c bc
12
13
a>b
2
ab
3
a>c
4
ac
5
bc
7
b>c
6
ab
11
a=b
8
bc
10
b=c bc
12
Test Data e
13
Tool
TESTGEN system
Comparison of Approaches
Random approach Low probability in finding semantically small faults
Path-oriented approach Better prediction of coverage Harder to find test data Often selection of infeasible paths
void foo(int a , int b) { if (a == b) then write(1); else write(2); }
Goal-oriented approach Hard to predict the coverage More flexible to find test data Reduces the selection relatively infeasible paths
Demerits
Difficulty with dynamic data structures, arrays, procedures, and loop conditions Overheads of repeated algebraic manipulation and simplification of variable and path expressions Not applicable to real-time software systems
Demerits
Expensive : require many iterations before a suitable input is found Monitoring by instrumentation Actual execution suffers from the speed of execution of program Inefficient in handling infeasible paths
Solved problems
General approach for nonlinear expressions Dynamic data structure Effective handling of infeasible paths
Solved problems
Array, loop
Only applicable numerical software Unit level testing (not inter-procedural)
Conclusion
Most of research work has performed on toy programs Applied programs are very short, less complex, and using a subset of language features Test data generator handle only integer, Boolean, real number, array, pointer, not general data object Some work supports inter-procedural level testing, oracle, and effective detection of the infeasible paths
No papers concerning objects
Combining static and dynamic method is useful Static : cost reduction Dynamic : dynamic data structure
Future Challenges
Constraint-satisfaction techniques
Pointers and shapes Object-oriented programs
Path selection
Oracle problem
Symbolic Execution
input variable : y Y
1
x = y*2 Node Path condition Path action x = Y*2 Y*2>=10 x = Y*2+10 y = Y+1 (Y*2+10) + (Y+1) >= 110
2
F
If (x>=10)
T
1 2 3 4 5
x = x+10 y = y+1
4 5
F T
If (x+y <110)
6
x = y*2 If (x>=10)
T
y3 y4 y 10
F(y) = 10 x2(y) if x2(y) < 10, 0 otherwise
2
F
3 4
x = x+10 y = y+1
5
F T
If (x+y <110)
6
printf(OK);
read(x,y) If (x+y>=10)
T
2
F
ax+by+c = 0 ax0+by0+c = r
3
4
x = x+10 y = y+1
ax + by = -r x, y a(x0+x) + b(y0+y) + c = 0
F(x0 + x, y0) F(x0, y0) =a x F(x0, y0+ y ) F(x0, y0) =b y ax0 + by0 + c = F(I0)
2
3