Top Banner
Kernel Density Adaptive Random Testing Matthew Patrick and Yue Jia 13 April 2015
26

Kernel Density Adaptive Random Testing

Aug 01, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kernel Density Adaptive Random Testing

Kernel Density Adaptive Random Testing

Matthew Patrick and Yue Jia

13 April 2015

Page 2: Kernel Density Adaptive Random Testing

Outline

• Diversification and Intensification

• Kernel Density Adaptive Random Testing (KD-ART)

• Is KD-ART more effective than ART?

• Finding the optimal switch point

• Conclusions

Page 3: Kernel Density Adaptive Random Testing

Mutation based Test Selection

Test Suite

Page 4: Kernel Density Adaptive Random Testing

Mutation based Test Selection

Test Suite

Suppose we selected the red test suite, and found it is good at killing mutant

Page 5: Kernel Density Adaptive Random Testing

Mutation based Test Selection

Test Suite

Which test should be execute next ?

Page 6: Kernel Density Adaptive Random Testing

Mutation based Test Selection

Test Suite

Diversify: Use a wide range of test inputs to increase the chances of killing new mutants

Page 7: Kernel Density Adaptive Random Testing

Mutation based Test Selection

Test Suite

Intensify: Select test inputs which are similar to those previously shown to be successful

Page 8: Kernel Density Adaptive Random Testing

Adaptive Random Testing (ART)

• Generate test cases evenly over the input domain, so as to diversify the test selection

• Select test cases that maximise the (Euclidean) distance to the previously selected test cases

Page 9: Kernel Density Adaptive Random Testing

Failure Patterns

Block pattern: if (x >= 10 && x <= 12) && (y >= 8 && y <= 11) z = x / 2 * y; // 2 should be 7 else z = x * y; return z;

Strip pattern: If (2 * x – y > 10) // 10 should be 18 z = x / 2 * y; else z = x * y; return z;

(Chen et al. 2004) Diversification may be more effective

Page 10: Kernel Density Adaptive Random Testing

Compound Failure Patterns

Block and strip pattern: // 11 should be 12 if (x >= 10 && x <= 12) && (y >= 8 && y <= 11) z = x / 2 * y; // 2 should be 7 else z = x * y; return z;

Strip and block pattern: If (2 * x – y > 10) // 10 should be 18 z = x / 2 * y; // also need && y > 7 else z = x * y; return z;

Intensification may be more effective

Page 11: Kernel Density Adaptive Random Testing

Kernel Density Adaptive Random Testing (KD-ART)

• Generate test inputs according to the distribution of successful test cases

• Use Kernel Density Estimation to interpolate the test case values evaluated

Page 12: Kernel Density Adaptive Random Testing

Kernel Density Estimation

Page 13: Kernel Density Adaptive Random Testing

Sampling strategy

• Sample ten test cases for every one selected

• KD-ART (intensify) maximises the density

• KD-ART (diversify) minimises the density

Page 14: Kernel Density Adaptive Random Testing

Experimental setup

• Eight C programs, used before in ART research

• Selective set of mutation operators (MILU)

• 20 trials of 5000 candidate tests: use ART and KD-ART to select one test case from every ten

Page 15: Kernel Density Adaptive Random Testing

IS KD-ART MORE EFFECTIVE THAN ART?

Page 16: Kernel Density Adaptive Random Testing

plgndr

Page 17: Kernel Density Adaptive Random Testing

bessj0

Page 18: Kernel Density Adaptive Random Testing

Averaged over eight programs

Page 19: Kernel Density Adaptive Random Testing

FINDING THE OPTIMAL SWITCH POINT

Page 20: Kernel Density Adaptive Random Testing

erfcc switch

Page 21: Kernel Density Adaptive Random Testing

Airy switch

Page 22: Kernel Density Adaptive Random Testing
Page 23: Kernel Density Adaptive Random Testing

Conclusions

• It is not always best to diversify the test suite, sometimes intensification should be used too

• The switch point between traditional ART and KD-ART has a significant effect on the results

• The optimal switch point can be predicted using easily calculable program properties

Page 24: Kernel Density Adaptive Random Testing

ANY QUESTIONS?

Page 25: Kernel Density Adaptive Random Testing
Page 26: Kernel Density Adaptive Random Testing