70 likes | 207 Views
Automatic Test Generation from Formal Specifications. Dr. Paul E. Black paul.black@nist.gov http://hissa.nist.gov/~black/. Program under test. Specs. Specs. Specs. Program under test. test program. Stages of Automated Testing. 1 Manual 2 Custom Program Runs Tests
E N D
Automatic Test Generation from Formal Specifications Dr. Paul E. Black paul.black@nist.gov http://hissa.nist.gov/~black/
Program under test Specs Specs Specs Program under test test program Stages of Automated Testing 1 Manual 2 Custom Program Runs Tests 3 Create Program from Spec Test Program Generator Program under test test program Paul Black
Automatic Test Generation test objectives counter- examples . . System specs use test criterion check model combine scenarios scenarios . . . . Complete Tests NIST TAO test results run tests System source http://hissa.nist.gov/~black/AFTG/ Paul Black
test require- ments . use test criterion . . coverage metric = # requirements satisfied total # requirements Specification-based Coverage Metric • How can we measure test set quality without code? AG(S0&a&b -> AX S1) AG(S0&(~a|~b)->AX S0) AG(S1 & a -> AX S0) AG(S1 & ~a -> AX S1) check model Test case: State 1.1: state = S0 a = 1 b = 1 State 1.2: state = S1 a = 1 State 1.3: state = S0 a&b convert to CFSM S0 S1 a Paul Black
Specification Abstraction • How can we soundly fit high-level specification into low-level descriptions? specifications Finite Modeling High Level System specs Low Level Functional specs for model checkers in Z, UML, VDM, Matlab, SCR, etc. Paul Black
Examples of ATG • Cruise Control • 24 test cases • 87% branch coverage of code (13 of 15) • test code is 6,279 lines of Java • Reactor Safety Injection • 16 test cases, 9 after coverage minimization • Java VM Stack • 29 test cases • test code is 1,524 lines of C • Flight Guidance System • 292 test cases, 78 after coverage minimization • Secure Operating System Paul Black
Current Tools (as of June 2000) • Extract UML State Chart • Mutate Test Specifications • Reduce Tests • Report Coverage Metric • Generate Test Code Paul Black