Generating Structured Test Data with Specific Properties using - - PowerPoint PPT Presentation
Generating Structured Test Data with Specific Properties using - - PowerPoint PPT Presentation
Generating Structured Test Data with Specific Properties using Metaheuristic and Nested Monte-Carlo Search Simon Poulding Blekinge Institute of Technology Robert Feldt Chalmers University Context software testing: generating test data for
Problem how to enable the test engineer to generate test data that is both valid and has desirable properties? Solution (1) allow the test engineer to specify the construction of valid test inputs using generators written in a general purpose language (2) apply metaheuristic and Monte-Carlo tree search algorithms to optimise the generation process for the desirable properties Context software testing: generating test data for software for which inputs are highly structured
+ Metaheuristic Search GödelTest + Nested Monte-Carlo Search Application: Robustness Testing
generator
@generator AZStrings begin start() = String(mult(letter)) letter() = choose(Bool)? 'A' : 'B' end
Julia implementation of GödelTest: https://github.com/simonpoulding/DataGenerators.jl
generator
@generator AZStrings begin start() = String(mult(letter)) letter() = choose(Bool)? 'A' : 'B' end range: [0,∞) distribution: geometric (p1)
choice point
range: [false,true] distribution: Bernoulli (p2)
choice point choice model
Julia implementation of GödelTest: https://github.com/simonpoulding/DataGenerators.jl
generator
@generator ABStrings begin start() = String(mult(letter)) letter() = choose(Bool)? 'A' : 'B' end range: [0,∞) distribution: geometric (p1=0.5)
choice point
probability 1 2 3 4 5
“AB” “A” “” “BBA”
generator
@generator ABStrings begin start() = String(mult(letter)) letter() = choose(Bool)? 'A' : 'B' end
choice point
probability 1 2 3 4 5
range: [0,∞) distribution: geometric (p1=0.1) “BBABAB” “BBAAABAA” “ABBA” “AABAAB”
“AAABAA” “ABAAAAAA” “AAA” “BAAAAB” “BAB” “B” “” “ABBA” (p1, p2) = (0.1, 0.2) (p1, p2) = (0.5, 0.5)
+ Metaheuristic Search GödelTest + Nested Monte-Carlo Search Application: Robustness Testing
property metrics
generator choice model metaheuristic search
parameters samples GödelSequences [3,0,4,1,2] (p1, p2) = (0.1, 0.2)
“AAABAA” “ABAAABAA” “AAA” “BAAAAB”
target 1: size = 100 AND height = 36 target 2: size = 100 AND height = 6 size height
Robert Feldt and Simon Poulding, Finding Test Data with Specific Properties via Metaheuristic Search,
- Proc. International Symposium on Software Reliability Engineering (ISSRE 2013)
20 40 60 80 100 200
Tree size Tree height
Boltzmann Sampler
20 40 60 80 100 200
Tree size Tree height
20 40 60 80 100 200
Tree size Tree height
GödelTest using Differential Evolution
+ Metaheuristic Search GödelTest + Nested Monte-Carlo Search Application: Robustness Testing
current game state child states simulation
current game state child states simulation
current game state child states simulation
current game state child states simulation
current game state child states simulation
current game state child states 0.7 simulation
current game state child states 0.7 0.4 simulation
current game state child states 0.7 0.4 0.9 simulation
[ ] [0] [1] [2] [1,0] [0,0] [2,1] [0,0,3] [2,1,2] [0,0,3,0] [2,1,2,1] 0.7 0.4 0.9 simulation
target: size = 100 size
Simon Poulding and Robert Feldt, Generating structured test data with specific properties using nested Monte-Carlo search,
- Proc. Genetic and Evolutionary Computation Conference (GECCO), 1279-1286, 2014
number of tree consructions per target structure 1000 2000 3000 4000 algorithm Boltzmann NMCS 1 NMCS 2 NMCS 4
time per target structure (ms) 25 50 75 100 125 150 algorithm Boltzmann NMCS 1 NMCS 2 NMCS 4
0.00 0.25 0.50 0.75 1.00 Boltzmann NMCS 1 NMCS 2 NMCS 4 NMCS 8 NMCS 16
algorithm median coordinate
target: size = 101 AND height = 8 size height
8 1 101
size height
8 1 101
size height
‘random’ sampler NMCS
+ Metaheuristic Search GödelTest + Nested Monte-Carlo Search Application: Robustness Testing
JEuclid
<math> <mfrac> <mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow> <mn> 2 </mn> </mfrac> </math>
Simon Poulding and Robert Feldt Generating Controllably Invalid and Atypical Inputs for Robustness Testing,
- Proc. International Workshop on Testing Extra-Functional Properties (ITEQS 2017)