220 likes | 342 Views
A Bag of Tricks for Validation. Presented by Doron Drusinsky Joint work with Bret michael, Man-Tak Shing, and Tom Otani Naval Postgraduate School Monterey, CA. A Bag of Tricks for Validation. Connecting the SRM to the Assertion-Repository using AspectJ Meta-Assertions
E N D
A Bag of Tricks for Validation Presented by Doron Drusinsky Joint work with Bret michael, Man-Tak Shing, and Tom Otani Naval Postgraduate School Monterey, CA NASA IV&V Facility Workshop on Validation Morgantown, WV
A Bag of Tricks for Validation Connecting the SRM to the Assertion-Repository using AspectJ Meta-Assertions Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Connecting the SRM to the Assertion-Repository using AspectJ Background Embedded Assertions External Assertions – Assertion Repository Hardwired Assertion Bridge Aspect-J Bridge NASA IV&V Facility Workshop on Validation Morgantown, WV
Connecting the SRM to the Assertion-Repository using AspectJ Embedded Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Assertion Repository Connecting the SRM to the Assertion-Repository using AspectJ 2. Assertion repository (see NASA Journal Paper) NASA IV&V Facility Workshop on Validation Morgantown, WV
Connecting the SRM to the Assertion-Repository using AspectJ 2. Assertion repository: hardwired bridge NASA IV&V Facility Workshop on Validation Morgantown, WV
Connecting the SRM to the Assertion-Repository using AspectJ class ExternalAssertionsUser { … protected void fireExternalAssertions(String sEventName) { externalAssertionChecker. execTReventDispatcher(…); } … } 2. Assertion repository: hardwired bridge E.g., In domain model class Foo { public void reqPublish() { // connect to External assertions bundle fireExternalAssertions("reqPublish") } } NASA IV&V Facility Workshop on Validation Morgantown, WV
Connecting the SRM to the Assertion-Repository using AspectJ // After returning from calls specified in // execMethod() do ... after() returning: execMethod() { if (assertions == null) return; String sMethodName = thisJoinPoint.getSignature().getName(); Object[] _args = thisJoinPoint.getArgs(); fireAssertions(sMethodName, _args); } pointcut execMethod(): execution(int *(..)) && !target(ExternalAssertionChecker) // not an assertion && !target(ITRAssertion) // not an assertion && !target(TestCase) && !execution(int getInstanceID(..)) && !execution(int getPS(..)) && !execution(int execTReventDispatcher(..)) && !execution(int execTRminorCycle(..)) && !execution(int execTRFireSubstatecharts(..)); 2. Assertion repository: AspectJ bridge AspectJ bridge NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions A meta-assertion is an assertion about the existing set of assertions (the assertion repository) currently in use. NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions Validation Architecture: Assertion Repository NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions Example R2: Once the Traffic-Light SUT has lights turn red three times or more then at least one assertion is expected to fail while lights are red. NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions Architecture: isSuccess NASA IV&V Facility Workshop on Validation Morgantown, WV
Meta-Assertions Guard succeeds iff frequency of traversing the transition is greater than or equal to (GE) 0.6 Statistical assertions: Using these constraints, the user effectively forces the JUnit test-suite to spend 60% or more of its testing energy along the newTruck path and the remainder along the timeoutFire path. NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions Traffic Light Controller SRM NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Run validation tests through DM using Coverage tool (Emma here): Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV
Using Code Coverage to find Missing Assertions NASA IV&V Facility Workshop on Validation Morgantown, WV