Docsity

Regression Testing: Selective Retesting Approaches and Their Cost-Effectiveness - Prof. At, Study notes of Computer Science

Toggle sidebar
bg1
1
Regression Testing
•Developed first version of software
•Adequately tested the first version
•Modified the software; version 2 now
needs to be tested
•How to test version 2?
•Approaches
–Retest entire software from scratch
–Only test the changed parts, ignoring
unchanged parts since they have already
been tested
–Could modifications have adversely affected
unchanged parts of the software?
Regression Testing vs.
Development Testing
•During regression testing, an
established test set may be
available for reuse
•Approaches
–Retest all
–Selective retest (selective regression
testing) ←
←←
←Main focus of research
Selective Retesting
•Tests to rerun
–Select those tests that will produce
different output when run on P’
• Modification-revealing test cases
• It is impossible to always find the set of
modification-revealing test cases – (we cannot predict
when P’ will halt for a test)
–Select modification-traversing test cases
• If it executes a new or modified statement in P’ or
misses a statement in P’ that it executed in P
T
Tests to rerun Tests not to rerun
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Regression Testing: Selective Retesting Approaches and Their Cost-Effectiveness - Prof. At and more Study notes Computer Science in PDF only on Docsity!

Regression Testing

Developed first version of software

Adequately tested the first version

needs to be testedModified the software; version 2 now

How to test version 2?

  • Approaches unchanged parts of the software?^ –^ Could modifications have adversely affectedbeen testedunchanged parts since they have already^ –^ Only test the changed parts, ignoringRetest entire software from scratch

Development TestingRegression Testing vs.

available for reuseestablished test set may beDuring regression testing, an

  • Approaches testing)^ –^ Selective retest (selective regressionRetest all

(^) ←←←← (^) Main focus of research

Selective Retesting

  • Tests to rerun
  • It is impossible to always find the set of • Modification-revealing test cases different output when run on P’Select those tests that will produce when P’ will halt for a test)modification-revealing test cases – (we cannot predict
  • (^) Select modification-traversing test cases misses a statement in P’ that it executed in P^ • If it executes a new or modified statement in P’ or

T

Tests to rerun

Tests not to rerun

  • Selective-retest Approaches
  • Ad-hoc/random approaches
  • E.g., randomly select n test cases from T^ –^ No test selection tool availableTime constraints

Factors to consider

Testing costs

Fault-detection ability

abilityTest suite size vs. fault-detection

technique is superior to anotherSpecific situations where one

Open Questions

  • their ability toHow do techniques differ in terms of
  • (^) detect faults?reduce regression testing costs?

reduction and fault detection ability?What tradeoffs exist b/w testsuite size

effective than another?When is one technique more cost-

techniques?and effectiveness of test selectiontest suite design affect the efficiencylocation, and type of modifications, andHow do factors such as program design,

Experiment

  • Hypothesis more expensiveeffective than minimization techniques but are^ –^ Data-flow coverage based techniques are moreexpensiveeffective as safe techniques, but can be more^ –^ Data-flow coverage based techniques are asexpensive than minimization techniques^ –^ Safe techniques are more effective and moreselection techniquesgreatly affects the cost and benefits of test^ –^ The composition of the original test suiterandom techniques but are much more expensiveNon-random techniques are more effective than

Measure

selection algorithmsCosts and benefit of several test

  • Developed two models caseeffectiveness of the resulting test^ –^ Calculate the fault detectiontechniquetechnique w.r.t. the retest-allCalculating the cost of using the

Modeling Cost

  • techniquesDid not have implementations of all Had to simulate them

results not comparablemachines (185,000 test cases) –Experiment was run on several

  • Simplifying assumptions
  • Human effort, equipment cost equivalent units^ –^ All sub-costs can be expressed inAll test cases have uniform costs

Modeling Cost

  • Cost of regression test selection validating = |T’|/|T|^ –^ Relative cost of executing andthe retest-all approachexecuting and validating all tests, i.e.,^ –^ Note that E(T) is the cost ofvalidating tests in T’^ –^ And E(T’) is the cost of executing and^ –^ Where A is the cost of analysisCost = A + E(T’)

Modeling Fault-detection

  • Per-test basis fault-revealing tests in T^ –^ Normalize above quantity by the number ofa fault in P’, but that are not in T’^ –^ Identify those tests that are in T and reveal^ –^ Its modified version P’Given a program P and
  • Problem reduce fault-detection effectiveness)these test cases (i.e., those that do not^ –^ Penalizes selection techniques that discardMultiple tests may reveal a given fault

•1000 non-coverage based test suites: •1000 edge-coverage based test suites: • For each program Another look at the subjects

1000

Test Selection Tools

  • Minimization technique modified edgesSelect a minimal set of tests that cover
  • Safe technique
  • we discussed the details earlier in this lecture DejaVu
  • Data-flow coverage based technique pairsSelect tests that cover modified def-use
  • Random technique casesRandom(n) randomly selects n% of the test

Retest-all

Variables

  • The subject program modifications6 programs, each with a variety of
  • The test selection technique retest-allrandom(25), random(50), random(75),Safe, data-flow, minimization,
  • Test suite composition
  • (^) randomEdge-coverage adequate

Measured Quantities

  • Each run
  • (^) Test suite T – (^) Selection technique M – (^) Version P’Program P
  • Measured reveals the fault in P’^ –^ Whether one or more tests in T’test suitesuite T’ to the tests in the originalThe ratio of tests in the selected test

Dependent variables

Average reduction in test suite size

Fault detection effectiveness

does not reveal a fault in P’^ • 100-Percentage of test suites in which T’

Number of runs

  • test suite universeFor each subject program, from the
  • (^) And 100 random test suitesSelected 100 edge-coverage adequate
  • For each test suite capability of the resulting test suite^ –^ Evaluated the fault detectionApplied each test selection method

100-Percentage of test suites in which T’ does not reveal a fault in P’

Fault-detection Effectiveness

How to read the graphs

Lower quartileUpper quartile Median

Box’s height 50% of the dataspans the centraldata distributionrepresents aEntire structure

Conclusions

the least effective test suitesMinimization produces the smallest and

far as fault-detection is concernedsuites yielded equally good test suites asRandom selection of slightly larger test

  • average behavior and analysis costsSafe and data-flow nearly equivalent of regression testingData-flow may be useful for other aspects

casesselecting (average) 74% of the testthey has fault-revealing tests) whileSafe methods found all faults (for which

Conclusions

  • not reduce test suite size at allIn certain cases, safe method could effectivetest suites could be nearly asOn the average, slightly larger random
  • Results were sensitive to
  • (^) Composition of the test suites – (^) Characteristics of the changes – (^) ProgramsSelection methods used