Specification-Based Regression Test Management With Risk Analysis: A New Regression Test Selection Approach
Specification-Based Regression Test Management With Risk Analysis: A New Regression Test Selection Approach
Agenda
Introduction and Background Classification of Regression Test Cases Regression Test Selection with Risk Analysis
Part One: Targeted Test Selection Part Two: Safety Test Selection
01/10/02
Regression Testing
To ensure that new or modified features do not cause current release to regress after incorporating fixes into product -- ensure customers business wont be at risk Essential to ensure software quality In software maintenance: validate modified software In O-O software development
Ensure quality of successive increments Assess quality of re-used components
[email protected] 3
Program P T: Regression T: New test cases selected from T test cases Changed Features New Features
Program P
Safety Tests
Coverage-oriented and risk-oriented test cases Goal: achieve good enough quality
Testers have always used risk-based testing, but in ad hoc fashion based on personal judgment [4] Risk-based testing
Focuses testing and spends more time on key functions and critical functions Achieves highest confidence in limited time
Activity Diagram
UML notation to model computations and workflows in specification, based on requirements Represents sequences in which activity may occur Grey-box: contains more information than requirement Elements of Activity Diagram
Nodes
Activity state Synchronization bar Decision diamond Start and stop marker
Edges
Solid arrow: control flow Dashed arrow: message flow
[email protected] 10
c d e f
[Valid]
Decision diamond
m
[Time Out]
[ n Consecutive Failure]
j
Send Get_Quote Request to Time-out Banks
g h
Stop
11
Traceability Matrix
Node Test Case t1, t2, t3, t4 t1, t2, t3, t4 t1, t2, t3, t4 t1, t2, t3 t1, t2, t3 t1, t2, t3 t1, t2, t3 t1, t2, t3 t1, t2, t3 t2, t3 t2, t3 t4 t4 Edge (a, b) (b, c) (c, d) (c, l) (d, e) (e, f) (e, j) (f, g) (g, h) (h, i) (j, f) (j, k) (k, e) (l, m)
[email protected]
Test Case t1, t2, t3, t4 t1, t2, t3, t4 t1, t2, t3 t4 t1, t2, t3 t1, t2 t2, t3 t1, t2, t3 t1, t2, t3 t1, t2, t3 t3 t2, t3 t2, t3 t4
13
a b c d e f g h i j k l m
c d e f
Bugs m
[Time Out]
[ n Consecutive Failure]
j
Send Get_Quote Request to Time-out Banks
X
k
14
g h i
15
16
[4]
Probability of fault Cost (consequence or impact) of fault in corresponding function if it occurs in production
REf = Pf Cf
REf: Risk Exposure of function f (E means exposure) Pf: probability of fault occurring in function f
In our model, we consider severity of defects to assess probability Note: Pf is extended to severity probability
Step 1. Assess cost Ct for each test case Step 2. Derive severity probability Pt for each test case Step 3. Calculate Risk Exposure REt for each test case Step 4. Select test cases with top REt as Safety Tests
[email protected] 19
Assess Cost Ct
Two kinds of costs
Ct (c): Consequences of fault as seen by customer, i.e., losing market place Ct (v): Consequences of fault as seen by vendor, i.e., high software maintenance cost
21
Step 1:
Test Case
Test Case
t0010 t0020 tn
=
Ct 5 2 3
tn
Pt 5 4 1
REt = Pt Ct 25 8 3
22
1 1 1 1 1 1 1
1 1 0 0 0 1 0
23
Each component was owned by one experienced test engineer 306 test cases in total
[email protected] 24
Results
High Risk Exposure coverage and average Risk Exposure Acceptable specification coverage not our focus Powerful in Selecting Effective Test Cases and Finding Defects
Caught all defects Omitted fewer test cases that revealed defects
Evaluation
Effectiveness: more effective in finding defects Cost-efficiency: can be implemented into tools Sensitivity to Risk
Risk-based test selection that choose critical test cases Use risk metrics to quantitatively measure the safety of test suite
Can be applied to State Diagrams and other graphlike diagrams Powerful for function test Systematic not subjective ! Only requires straightforward calculation
[email protected] 26
Automation
Targeted Test
Manually in Excel Can be automated using more powerful test tracking tools
Safety Test
Automated Straightforward calculation that can be easily implemented
[email protected] 27
Reference
[1] WebSphere Commerce Suite FVT Team Regression Selection Guidelines, ECD, IBM Toronto Laboratory, 2000 [2] Stale Amland, Risk Based Testing and Metrics: Risk analysis fundamentals and metrics for software testing including a financial application case study, 5th International Conference EuroSTAR99, November, 1999, Barcelona, Spain [3] ECD Software Development Process Function Verification Test Process, ECD, IBM Toronto Laboratory, 2001 [4] Gregg Rothermel and Mary Jean Harrold, Analyzing Regression Test Selection Techniques, IEEE Transactions on Software Engineering, V.22, no. 8, August 1996, pages 529 551 [5] Robert V. Binder, Testing Object-Oriented Systems, Addison-Wesley Publishing company, 2000 [6] Yanping Chen, Specification-based Regression Testing Measurement with Risk Analysis, Masters Thesis, University of Ottawa, Canada, 2002
[email protected] 29