Regression Testing Regression Testing vs. Development Testing
Regression Testing Regression Testing vs. Development Testing
Regression Testing
Development Testing
Developed first version of software During regression testing, an
Adequately tested the first version established test set may be
Modified the software; version 2 now available for reuse
needs to be tested
How to test version 2?
Approaches Approaches
Retest entire software from scratch Retest all
Only test the changed parts, ignoring
unchanged parts since they have already Selective retest (selective regression
been tested testing) Main focus of research
Could modifications have adversely affected
unchanged parts of the software?
Selective Retesting
T
1
2
Cost of Regression Testing
1
2
3 1
32 1
2
3
3
1
2
2 Analysis
+
3
3 Cost = Cx Cost = Cy
2 Retest All
3
1 3 Selective Retest
3
3
2
We want Cx < Cy
3
1
Key is the test selection algorithm/technique
3
1
3
Selective-retest Approaches Factors to consider
Ad-hoc/random approaches Testing costs
Time constraints Fault-detection ability
No test selection tool available Test suite size vs. fault-detection
E.g., randomly select n test cases from T
ability
Specific situations where one
technique is superior to another
4
Measure Modeling Cost
Costs and benefit of several test Did not have implementations of all
selection algorithms techniques
Had to simulate them
Developed two models
Calculating the cost of using the
Experiment was run on several
technique w.r.t. the retest-all
machines (185,000 test cases)
technique results not comparable
Calculate the fault detection Simplifying assumptions
effectiveness of the resulting test All test cases have uniform costs
case All sub-costs can be expressed in
equivalent units
Human effort, equipment cost
5
Modeling Fault-detection Experimental Design
Per-test-suite basis 6 C programs
Three options Test suites for the programs
The test suite is inadequate
No test in T is fault revealing, and thus, no test in Several modified versions
T is fault revealing
Same fault detection ability
Some test in both T and T is fault revealing
Test selection compromises fault-detection
Some test in T is fault revealing, but no test in T
is fault revealing
6
Another look at the subjects Test Selection Tools
1000 Minimization technique
For each program Select a minimal set of tests that cover
1000 edge-coverage based test suites: modified edges
1000 non-coverage based test suites:
Safe technique
DejaVu
we discussed the details earlier in this lecture
Data-flow coverage based technique
Select tests that cover modified def-use
pairs
Random technique
Random(n) randomly selects n% of the test
cases
Retest-all
7
Dependent variables Number of runs
Average reduction in test suite size For each subject program, from the
Fault detection effectiveness test suite universe
100-Percentage of test suites in which T Selected 100 edge-coverage adequate
does not reveal a fault in P And 100 random test suites
For each test suite
Applied each test selection method
Evaluated the fault detection
capability of the resulting test suite
8
How to read the graphs Fault-detection Effectiveness
9
Conclusions
Minimization produces the smallest and
the least effective test suites
Random selection of slightly larger test
suites yielded equally good test suites as
far as fault-detection is concerned
Safe and data-flow nearly equivalent
average behavior and analysis costs
Data-flow may be useful for other aspects
of regression testing
Safe methods found all faults (for which
they has fault-revealing tests) while
selecting (average) 74% of the test
cases
Conclusions
In certain cases, safe method could
not reduce test suite size at all
On the average, slightly larger random
test suites could be nearly as
effective
Results were sensitive to
Selection methods used
Programs
Characteristics of the changes
Composition of the test suites
10