100 likes | 250 Views
Oracle Generation. Ron Alford April 8th, 2008. The Oracle Problem. Oracle verifies input/result pairs A test case is only as good as its oracle. But what constitutes a result? Return value of function Change in state of program Time/CPU cycles used Trace of program execution.
E N D
Oracle Generation Ron Alford April 8th, 2008
The Oracle Problem • Oracle verifies input/result pairs • A test case is only as good as its oracle. • But what constitutes a result? • Return value of function • Change in state of program • Time/CPU cycles used • Trace of program execution
End Result Oracles • “Correct Program” oracles • Verifiable results • Predicate testing
Assertion Oracles • Precondition/Postcondition Checks • Styles: • Straight assertions • Separate specification (Peters) • Inline specification/code (JMLUnit)
Trace Oracles • Temporal logic And several more operators…
Trace Oracles (Uses) • Ensure: • initialization operators called first • Locking and unlocking performed properly
Conclusions • There are many oracles, all partial • No results without specification • Even if it is implicit • Expounding the results for each test case is still specification