Beruflich Dokumente
Kultur Dokumente
Related reading: Effectively Prioritizing Tests in Development Environment 17-654/17-754 Analysis of Software Artifacts Gabriel Zenarosa
Test Prioritization
Want to run tests likely to fail first Day 1 after internal release, not day 21!
Test Selection
What tests should I run before checking in code? What tests should be run before releasing a critical fix? Special case of prioritization Observation: New defects are introduced from changed code
6 April 2006
Test Prioritization
Want to run tests likely to fail first Day 1 after internal release, not day 21!
Test Selection
What tests should I run before checking in code? What tests should be run before releasing a critical fix? Special case of prioritization Observation: New defects are introduced from changed code
6 April 2006
6 April 2006
Test Prioritization
Output 1 Prioritized list of test cases based on coverage of the impacted blocks
6 April 2006
6 April 2006
Check for similar names Look for function bodies hashing the same Perform pair-wise comparison of blocks otherwise Conclude function is new if no matches are found
6 April 2006
Control-flow match
Build CFG, look for node pairs with the same connectivity May match many new blocks to one old block Partial match: new block not always executed (e.g. b2)
8
6 April 2006
Impacted blocks
Old modified blocks New blocks
6 April 2006
Test Prioritization
Output 1 Prioritized list of test cases based on coverage of the impacted blocks
6 April 2006
10
Computing Coverage
Computed for each test T Old block b
Covered if T covered b in old binary
New block
Covered if at least one predecessor and successor were covered in old binary Heuristic: predict branches taken Heuristic: dont check predecessors for indirect call targets
6 April 2006
11
Test Prioritization
Output 1 Prioritized list of test cases based on coverage of the impacted blocks
6 April 2006
12
Prioritization Algorithm
Test t1 t2 t3 t4 t5 t6 Blocks . b2,b7 b1,b2,b3,b8 b7 b6 b1,b2,b5 b4,b5
6 April 2006
13
6 April 2006
14
6 April 2006
6 April 2006
17
Weight(t) Must normalize units = wcoverage * count[CurrBlkSet Coverage(t)] + wexec_time * [ExecTime (t)]-1
6 April 2006 19
6 April 2006
20
10
Results
6 April 2006
22
11
Prediction Errors
6 April 2006
23
Defect Detection
Program A Program B
6 April 2006
24
12
Scales to production environments - millions of tests and thousands of binaries Combination of approximations and static analysis to eliminate manual methods Collect information about development process
6 April 2006
25
13