ISWIM For Testing – A Model Driven Approach Tony Clark Xactium [email_address] www.xactium.com
Overview <ul><li>A Requirement for Constraints: </li></ul><ul><ul><li>Telecomms </li></ul></ul><ul><ul><li>Aerospace </li>...
Modelling with Constraints
Telecomms
Network Models Check configurations based on properties of devices and network components.
Aerospace Message Bus Integrated Modular Avionics (IMA)
IMA Models Check configurations of IMA components that must satisfy requirements of navigation modes.
Payload Configurations
Business Processes
Restructuring A Company Check sequences of company snapshots – do they satisfy the business goals? Restructure Company Pro...
Web Services and SOA
Information Systems
ISWIM Constraint Representation
Constraints <ul><li>What not to be: OCL, Java. </li></ul><ul><li>Visual language (why?), with examples: </li></ul><ul><ul>...
Snapshots <ul><li>Objects, slots and links. </li></ul><ul><li>Context must be given: </li></ul><ul><ul><li>Parameters </li...
Snapshots as Constraints not c.business_report.terminal and c.restructuring_plan.addresses = c.business_report
Sharing via Identifiers (separation of concerns)
Negation …  but not ...
Unknowns Tied Together …  same as …
Links Over Collections
Universal Quantification
Existential Quantification
Snapshot Checking Machine
Syntax Model
An Execution Machine
Machine Transitions
Auxiliary Machine Defs
An Implementation – ISWIM for Model Driven Testing
Testing Architecture Program Testing  Engine Interface (XML)   Program Display Test  Reports (HTML)   Display Test Cases (...
A sales system keeps info on customers, their accounts and their orders. Customer ids (CID) are unique, but customer infor...
Model Browser A model is constructed that shows the structure and behaviour of the application. The model could be extract...
Test Specification <ul><li>Each class may have: </li></ul><ul><li>Static scenarios defining typical configurations of inst...
Static Scenarios A static scenario defines a collection of objects that conforms to the model. The tool will support the c...
Example Invariant For any sales system, With a contacts database, For each known person p, It is not the case, That the cu...
Another Invariant For any sales system, With a contacts database, For each known person p1, With an id x, It is not the ca...
addContact(String id,String info) Pre-condition Post-condition
placeOrder(String id,int items) post-condition
Export as XML
Modify Source (or use class loader) <ul><li>public   class  SalesSystem { </li></ul><ul><li>ContactsDB  contactsDB  =  new...
A Test Harness <ul><li>public   static   void  main(String[] args) { </li></ul><ul><li>SalesSystem sales = (SalesSystem)JT...
Test Results
Conclusion <ul><li>Constraints occur everywhere in modelling </li></ul><ul><li>Constraints can be expressed as snapshots (...
Upcoming SlideShare
Loading in...5
×

Iswim for testing

124

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
124
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Iswim for testing"

  1. 1. ISWIM For Testing – A Model Driven Approach Tony Clark Xactium [email_address] www.xactium.com
  2. 2. Overview <ul><li>A Requirement for Constraints: </li></ul><ul><ul><li>Telecomms </li></ul></ul><ul><ul><li>Aerospace </li></ul></ul><ul><ul><li>Business Migration </li></ul></ul><ul><ul><li>Information Systems, SOA </li></ul></ul><ul><li>ISWIM Constraint Representation </li></ul><ul><li>ISWIM for testing </li></ul><ul><li>Conclusion </li></ul>
  3. 3. Modelling with Constraints
  4. 4. Telecomms
  5. 5. Network Models Check configurations based on properties of devices and network components.
  6. 6. Aerospace Message Bus Integrated Modular Avionics (IMA)
  7. 7. IMA Models Check configurations of IMA components that must satisfy requirements of navigation modes.
  8. 8. Payload Configurations
  9. 9. Business Processes
  10. 10. Restructuring A Company Check sequences of company snapshots – do they satisfy the business goals? Restructure Company Produce Plans Implement Plans Produce BizRep Develop Plans Produce Restructuring Plan Produce Operating Plan Ditch Unprofitable Customers Reorganize products
  11. 11. Web Services and SOA
  12. 12. Information Systems
  13. 13. ISWIM Constraint Representation
  14. 14. Constraints <ul><li>What not to be: OCL, Java. </li></ul><ul><li>Visual language (why?), with examples: </li></ul><ul><ul><li>Simple state. </li></ul></ul><ul><ul><li>Variables. </li></ul></ul><ul><ul><li>And/Or/Not </li></ul></ul><ul><ul><li>Quantification </li></ul></ul><ul><ul><li>Predicates. </li></ul></ul>
  15. 15. Snapshots <ul><li>Objects, slots and links. </li></ul><ul><li>Context must be given: </li></ul><ul><ul><li>Parameters </li></ul></ul><ul><ul><li>Root object </li></ul></ul><ul><ul><li>Self in state machine. </li></ul></ul><ul><ul><li>Observations in goals. </li></ul></ul><ul><li>Conjunction of contents. </li></ul><ul><li>Negation. </li></ul>
  16. 16. Snapshots as Constraints not c.business_report.terminal and c.restructuring_plan.addresses = c.business_report
  17. 17. Sharing via Identifiers (separation of concerns)
  18. 18. Negation … but not ...
  19. 19. Unknowns Tied Together … same as …
  20. 20. Links Over Collections
  21. 21. Universal Quantification
  22. 22. Existential Quantification
  23. 23. Snapshot Checking Machine
  24. 24. Syntax Model
  25. 25. An Execution Machine
  26. 26. Machine Transitions
  27. 27. Auxiliary Machine Defs
  28. 28. An Implementation – ISWIM for Model Driven Testing
  29. 29. Testing Architecture Program Testing Engine Interface (XML) Program Display Test Reports (HTML) Display Test Cases (HTML) Model (XMF-Mosaic) <ul><li>Test cases include: </li></ul><ul><li>Static Scenarios </li></ul><ul><li>Dynamic Scenarios </li></ul><ul><li>Invariants </li></ul><ul><li>Pre/Post Conditions </li></ul><ul><li>State Machines </li></ul>C B A D E F G H I Test Cases (XML) Test Reports (XML)
  30. 30. A sales system keeps info on customers, their accounts and their orders. Customer ids (CID) are unique, but customer information may be distributed.
  31. 31. Model Browser A model is constructed that shows the structure and behaviour of the application. The model could be extracted from an implementation or could be constructed by hand or could be constructed from another modelling tool. The example shows the classes extracted from a Java application.
  32. 32. Test Specification <ul><li>Each class may have: </li></ul><ul><li>Static scenarios defining typical configurations of instances. These may be positive and negative examples. </li></ul><ul><li>Invariants defining conditions that must hold true at all times. </li></ul><ul><li>Each operation may have specifications defining: </li></ul><ul><li>Precondition defining an expectation of the method. </li></ul><ul><li>Postcondition defining a corresponding guarantee if the precondition is satisfied. </li></ul>
  33. 33. Static Scenarios A static scenario defines a collection of objects that conforms to the model. The tool will support the construction of the scenarios by completing slots and links where possible. Types of values can be checked by the tool. The scenario represents an implementation independent definition of application data. It might represent a correct, or an illegal, configuration. The scenario can be exported in XML and recreated as implementation data. SomeContacts
  34. 34. Example Invariant For any sales system, With a contacts database, For each known person p, It is not the case, That the customer id value is EMPTY. NoEmptyCID
  35. 35. Another Invariant For any sales system, With a contacts database, For each known person p1, With an id x, It is not the case that, There is a known person p2, With the id x, Where p1 and p2 are different people. AllCIDsUnique
  36. 36. addContact(String id,String info) Pre-condition Post-condition
  37. 37. placeOrder(String id,int items) post-condition
  38. 38. Export as XML
  39. 39. Modify Source (or use class loader) <ul><li>public class SalesSystem { </li></ul><ul><li>ContactsDB contactsDB = new ContactsDB(); </li></ul><ul><li>OrderSystem orderSystem = new OrderSystem(); </li></ul><ul><li>public void addContact(String CID,String info) { </li></ul><ul><li>JTest test = JTest. startCall ( &quot;test/SalesSystem&quot; , &quot;addContact&quot; , this ,CID,info); </li></ul><ul><li>if (legal(CID)) contactsDB .addContact(CID,info); </li></ul><ul><li>test.endCall( null ); </li></ul><ul><li>} </li></ul><ul><li>public void placeOrder(String CID, int amount) { </li></ul><ul><li>JTest test = JTest. startCall ( &quot;test/SalesSystem&quot; , &quot;placeOrder&quot; , this ,CID,amount); </li></ul><ul><li>orderSystem .placeOrder(CID,amount); </li></ul><ul><li>test.endCall( null ); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  40. 40. A Test Harness <ul><li>public static void main(String[] args) { </li></ul><ul><li>SalesSystem sales = (SalesSystem)JTest. build ( &quot;test/SalesSystem&quot; , &quot;SomeContacts&quot; ); </li></ul><ul><li>JTest. startRecording ( &quot;C:/testResults.xml&quot; ); </li></ul><ul><li>JTest. checkInv ( &quot;test/SalesSystem&quot; , sales); </li></ul><ul><li>sales.addContact( &quot;PERSON1&quot; , &quot;Fred is a sales manager.&quot; ); </li></ul><ul><li>System. out .println(); </li></ul><ul><li>sales.placeOrder( &quot;PERSON1&quot; ,10); </li></ul><ul><li>JTest. stopRecording (); </li></ul><ul><li>} </li></ul>
  41. 41. Test Results
  42. 42. Conclusion <ul><li>Constraints occur everywhere in modelling </li></ul><ul><li>Constraints can be expressed as snapshots (ISWIM). </li></ul><ul><li>Constraints can be executed in various ways to suit the solution. </li></ul><ul><li>ISWIM-constraints can be implemented as a tool for model driven testing. </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×