1
Supporting Test Oracle Construction
Matt Staats KAIST
Shin Hong, Moonzoo Kim, Gregg Rothermel KAIST / University of Nebraska-Lincoln Gregory Gay, Mats Heimdahl University of Minnesota Twin-Cities
Construction Matt Staats KAIST Shin Hong, Moonzoo Kim, Gregory - - PowerPoint PPT Presentation
Supporting Test Oracle Construction Matt Staats KAIST Shin Hong, Moonzoo Kim, Gregory Gay, Mats Heimdahl Gregg Rothermel University of Minnesota Twin-Cities KAIST / University of Nebraska-Lincoln 1 The Testing Problem Test Oracle Test
1
Shin Hong, Moonzoo Kim, Gregg Rothermel KAIST / University of Nebraska-Lincoln Gregory Gay, Mats Heimdahl University of Minnesota Twin-Cities
2
Program
Talented Developers?
Test Input Program
Talented Developers?
Execute over
Test Input Program
Talented Developers?
Executed over
Program Behavior
Test Input Program
Talented Developers?
Executed over
Test Oracle
Check behavior
Program Behavior
Test Input Program
Talented Developers?
Executed over
Test Oracle
Check behavior
Program Behavior
Program
Talented Developers?
3
Test Input Program
Talented Developers?
Executed over
Test Oracle Test Input Program
Talented Developers?
Generate from Executed over
Test Oracle
4
Test Input Generation Tools
Symbolic Execution Symbolic Java Finder KLEE Random Testing Randoop Adaptive Random Testing Naïve Random Testing Concolic Execution CUTE jCUTE DART SCORE SAGE Genetic Algorithm- Based Testing Testful AUSTIN Iguana
What now?
Program
Test Inputs
Test Input Generation Tools
Symbolic Execution Symbolic Java Finder KLEE Random Testing Randoop Adaptive Random Testing Naïve Random Testing Concolic Execution CUTE jCUTE DART SCORE SAGE Genetic Algorithm- Based Testing Testful AUSTIN Iguana
What now?
Problems
More Work
5
Test Input Program
Talented Developers?
Generate from Executed over
Test Oracle
Generate from?
Test Input Program
Talented Developers?
Generate from Executed over
Test Oracle
Generate from?
T h i s i s k i n d a w e i r d . Test Input Program
Talented Developers?
Generate from Executed over
Test Oracle
Fix Generate from? Must check result!
D i f f e r e n t r e p r e s e n t a t i
, e a s i e r t
i n d m i s t a k e s ? O r h a r d e r ?
Test Input Program
Talented Developers?
Generate from Executed over
Test Oracle Goal: get developer to state what the program should do (but correctly this time)
Sameish
6
7
Automated Property / Behavior Extraction Program Program Behavior
User
Accept as correct Reject as incorrect
8
– Problems if poor – Little evidence in favor of use
– 2 case studies, approx. 30 students total – 3 programs – Each student classified an invariant as true, false, or unknown (unclassified)
Randoop (Test Input Generation) + Daikon Program Program + Program Invariants
User
Correct Invariants Incorrect Invariants
9
Our classification User classification
10
– Why does this occur? – Impact of this on actual testing process?
– Why? Not really sure – Impact? No idea at all (but we guess negative)
11
– Evidence is suspect – Requires change in user behavior
support users in making oracles
Test Input Generation Tools
Symbolic Execution Symbolic Java Finder KLEE Random Testing Randoop Adaptive Random Testing Naïve Random Testing Concolic Execution CUTE jCUTE DART SCORE SAGE Genetic Algorithm- Based Testing Testful AUSTIN Iguana
Must evaluate test results
Program
Test Inputs Oracle
Oracle Data Selection
Test Inputs + Oracle Data
12
can detect changes
variables
– Note: domain is critical avionics, so problems of heap, etc. go away
Program Mutants Test Inputs (Generated Externally) Variable Effectiveness Ranking Oracle Data
Generate Measure Variable Effectiveness Run Against
Expected Value Test Oracle
Tester Specifies expected value
13
Latctl Person DWM_2 DWM_1
14
15
Automatically extract test oracle
Program: Gatekeeper Input: “Keymaster”