Ensure Interoperability


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • An example of a model-based testing workflow. IXIT refers to "implementation extra information" and denotes here the total package of information that is needed when the abstract test suite is converted into an executable one. Typically it includes information about test harness, data mappings and SUT configuration.
  • The effectiveness of model-based testing is primarily due to the potential for automation it offers. If the model is machine-readable and formal to the extent that it has a well-defined behavioral interpretation, test cases can in principle be derived mechanically. Often the model is translated to or interpreted as a finite state automaton or a state transition system . This automaton represents the possible configurations of the system under test. To find test cases, the automaton is searched for executable paths. A possible execution path can serve as a test case. This method works if the model is deterministic or can be transformed into a deterministic one. Depending on the complexity of the system under test and the corresponding model the number of paths can be very large, because of the huge amount of possible configurations of the system. For finding appropriate test cases, i.e. paths that refer to a certain requirement to proof, the search of the paths has to be guided. For the test case selection multiple techniques are applied.
  • Ensure Interoperability

    1. 1. Model Based Testing Texas A&M University Department of Computer Science CPSC 606: SOFTWARE ENGINEERING Presentation 2 Sameh S. Sharkawi
    2. 2. Outline <ul><li>Introduction </li></ul><ul><ul><li>What is MBT </li></ul></ul><ul><ul><li>Motivation behind MBT </li></ul></ul><ul><li>How MBT Works </li></ul><ul><li>Benefits of MBT </li></ul><ul><li>Problems of MBT </li></ul><ul><li>Current State of MBT in Industry </li></ul><ul><li>Software Tools for MBT </li></ul><ul><li>Conclusion </li></ul><ul><li>References </li></ul>
    3. 3. Introduction (What is MBT) <ul><li>Definition </li></ul><ul><li>“ Model-based testing refers to software testing where test cases are derived in whole or in part from a model that describes some (usually functional) aspects of the system under test (SUT) .” * </li></ul><ul><li>* Wikipedia Definition of Model Based Testing. </li></ul>
    4. 4. Introduction (What is MBT Contd.) <ul><li>MBT is an approach in which you define the behavior of a system in terms of actions that change the state of the system. </li></ul><ul><li>Such a model of the system results in a well-defined Finite State Machine (FSM) which helps us to understand and predict the system’s behavior </li></ul>
    5. 5. Introduction (Motivation behind MBT) <ul><li>Testing is expensive </li></ul><ul><ul><li>30-50% of development costs </li></ul></ul><ul><li>Poor testing is VERY expensive </li></ul><ul><ul><li>Down time </li></ul></ul><ul><ul><li>Maintenance costs </li></ul></ul><ul><ul><li>Rework </li></ul></ul><ul><ul><li>Law suits </li></ul></ul><ul><li>Model Based Testing promises </li></ul><ul><ul><li>Increased effectiveness of testing </li></ul></ul><ul><ul><li>Similar or decreased costs </li></ul></ul><ul><ul><li>Reuse of design artifacts </li></ul></ul>
    6. 6. Introduction (Motivation behind MBT Downtime Costs) <ul><li>Brokerage operations $6,450,000 </li></ul><ul><li>Credit card authorization $2,600,000 </li></ul><ul><li>Ebay (1 outage 22 hours) $225,000 </li></ul><ul><li>Amazon.com $180,000 </li></ul><ul><li>Package shipping services $150,000 </li></ul><ul><li>Home shopping channel $113,000 </li></ul><ul><li>Catalog sales center $90,000 </li></ul><ul><li>Airline reservation center $89,000 </li></ul><ul><li>Cellular service activation $41,000 </li></ul><ul><li>On-line network fees $25,000 </li></ul><ul><li>ATM service fees $14,000 </li></ul>
    7. 7. How MBT Works
    8. 8. How MBT Works? <ul><li>The model is usually an abstract, partial presentation of the system under test's desired behavior. </li></ul><ul><li>The test cases derived from this model are functional tests on the same level of abstraction as the model. </li></ul><ul><li>These test cases are collectively known as the abstract test suite </li></ul>
    9. 9. How MBT Works? Contd. <ul><li>The abstract test suite cannot be directly executed against the system under test because it is on the wrong level of abstraction. </li></ul><ul><li>Therefore an executable test suite must be derived from the abstract test suite that can communicate with the system under test. </li></ul><ul><li>This is done by mapping the abstract test cases to concrete test cases suitable for execution. </li></ul>
    10. 10. How MBT Works? Contd. <ul><li>Deriving Test Cases Algorithmically </li></ul><ul><ul><li>Test Case Generation by Theorem Proving </li></ul></ul><ul><ul><li>Test Case Generation by Constraint Logic Programming </li></ul></ul><ul><ul><li>Test Case Generation by Model Checking </li></ul></ul><ul><ul><li>Test Case Generation by Symbolic Execution </li></ul></ul>
    11. 11. How MBT Works? Contd. <ul><li>Spec Explorer (UW-MSR Summer Institute '04) </li></ul>Model Implementation Test Oracle Test Cases Run Provides actual results for Provides expected results for Generates Pass Fail
    12. 12. Benefits of MBT
    13. 13. Benefits of MBT <ul><li>Starting from specification </li></ul><ul><ul><li>Involves testers early in the development process </li></ul></ul><ul><ul><li>Teams testers with developers </li></ul></ul><ul><ul><li>Forces testability into product design </li></ul></ul><ul><li>Building the test interface </li></ul><ul><ul><li>Finds design and specification bugs - before code exists </li></ul></ul><ul><ul><li>The model is the test plan - and is easily maintained </li></ul></ul><ul><ul><li>Automated test suite generation </li></ul></ul><ul><ul><li>Coverage is guaranteed - increases testing thoroughness </li></ul></ul><ul><ul><li>Zero test suite maintenance costs </li></ul></ul><ul><li>Automated test suite execution </li></ul><ul><ul><li>Finds code and interface bugs </li></ul></ul><ul><ul><li>Includes a framework for the testing of distributed applications </li></ul></ul><ul><ul><li>Reduces test execution costs </li></ul></ul>
    14. 14. Benefits of MBT Contd. <ul><li>These benefits can be summarized as: </li></ul><ul><ul><li>Machine </li></ul></ul><ul><ul><li>Time </li></ul></ul>
    15. 15. Benefits of MBT Contd. <ul><li>Machines </li></ul><ul><ul><li>A typical test engineer </li></ul></ul><ul><ul><ul><li>Earns €41 500 ($50 000 USD) per year </li></ul></ul></ul><ul><ul><ul><li>Works 40 to 50 hours per week </li></ul></ul></ul><ul><ul><li>A typical test machine </li></ul></ul><ul><ul><ul><li>Costs €250 ($300 USD) per year to buy and operate </li></ul></ul></ul><ul><ul><ul><li>Can work 100 hours per week </li></ul></ul></ul>
    16. 16. Benefits of MBT Contd. react.cs.uni-sb.de/mbt2006/talks/mbt4 masses .pdf
    17. 17. Problems of MBT
    18. 18. Problems of MBT
    19. 19. Problems of MBT Contd.
    20. 20. Problems of MBT Contd.
    21. 21. Problems of MBT Contd.
    22. 22. Problems of MBT Contd. <ul><li>Process shift </li></ul><ul><ul><li>Up front investment in test </li></ul></ul><ul><li>Personnel shift </li></ul><ul><ul><li>Higher education and sophistication </li></ul></ul>Spec Explorer (UW-MSR Summer Institute '04)
    23. 23. Current State of MBT in Industry
    24. 24. Current State of MBT in Industry <ul><li>IBM Research </li></ul><ul><ul><li>Most projects were done by PhD Holders </li></ul></ul><ul><ul><li>Very Little was successful (Just in the Lab, never actually went into market) </li></ul></ul><ul><ul><li>Too Complicated to use and analyze </li></ul></ul><ul><li>Microsoft Research </li></ul><ul><ul><li>The Spec# programming system is a new attempt at a more cost effective way to develop and maintain high-quality software </li></ul></ul>
    25. 25. Current State of MBT in Industry <ul><li>Spec# is a computer language which includes and extends C# </li></ul><ul><ul><li>Adds pre/post conditions, contracts </li></ul></ul><ul><ul><li>Adds high-level data types with convenient notations </li></ul></ul><ul><ul><li>Adds logical quantifiers like FORALL and EXISTS </li></ul></ul><ul><li>A Spec# model is just a program! </li></ul><ul><ul><li>You can run it like a C# program </li></ul></ul><ul><ul><li>It can call framework code </li></ul></ul><ul><ul><li>NEW You can explore it (run all of its possible behavior) which is how we do MBT with Spec# </li></ul></ul>Spec Explorer (UW-MSR Summer Institute '04)
    26. 26. Current State of MBT in Industry (Spec Explorer) <ul><li>A model exploration and testing tool for .NET: </li></ul><ul><ul><li>Authoring of models in Word </li></ul></ul><ul><ul><li>Model exploration (generating FSM) </li></ul></ul><ul><ul><li>FSM visualization </li></ul></ul><ul><ul><li>FSM traversal and test suite generation </li></ul></ul><ul><ul><li>Automatic implementation binding </li></ul></ul><ul><ul><li>Online test-suite execution and offline test-suite code generation </li></ul></ul>Spec Explorer (UW-MSR Summer Institute '04)
    27. 27. Current State of MBT in Industry (Spec #) <ul><li>Model: Calculator (viewpoint: only starting and stopping, and switching scientific mode) </li></ul>bool Running = false ; bool Scientific = false ; [Action] void SetRunning( bool newRunning) requires Running != newRunning; { Running = newRunning; } [Action] void SetScientific( bool newScientific) requires Running; requires Scientific != newScientific; { Scientific = newScientific; } System State Spec#: Pre-Condition describes when action is enabled State Update Tells Spec Explorer this is an action. Action invocations do appear in tests. Spec Explorer (UW-MSR Summer Institute '04)
    28. 28. Software Tools for MBT
    29. 29. Software Tools for MBT <ul><li>Conformiq Test Generator is a model-based testing tool using UML state charts that represent testing strategies </li></ul><ul><li>Leirios Test Generator is a model-based testing tool that generates tests automatically from deterministic system specifications </li></ul><ul><li>Reactis Tester is another model-based testing tool that focuses on control systems </li></ul><ul><li>TGV is a tool for the generation of conformance test suites for protocols </li></ul><ul><li>TorX is also a prototype testing tool for conformance testing of reactive software </li></ul><ul><li>Lurette is an automated testing tool of reactive programs written in Lustre </li></ul><ul><li>AsmL Test Tool can generate tests directly from an AsmL model </li></ul><ul><li>AutoFocus (in german) is a graphical tool for developing and modeling distributed systems with integrated testing facilities </li></ul>
    30. 30. Software Tools for MBT (AsmL) <ul><li>AsmL is the Abstract State Machine Language. It is an executable specification language based on the theory of Abstract State Machines . The current version, AsmL 2 (AsmL for Microsoft .NET), is embedded into Microsoft Word and Microsoft Visual Studio.NET. It uses XML and Word for literate specifications. It is fully interoperable with other .NET languages. AsmL generates .NET assemblies which can either be executed from the command line, linked with other .NET assemblies, or packaged as COM components. </li></ul>
    31. 31. Conclusion
    32. 32. Conclusion <ul><li>Modeling is not easy </li></ul><ul><ul><li>What details do you leave out? </li></ul></ul><ul><ul><li>How do you check the model? </li></ul></ul><ul><ul><li>There are no recipes for success </li></ul></ul><ul><li>What needs to happen </li></ul><ul><ul><li>Easier notation </li></ul></ul><ul><ul><li>Incremental approach </li></ul></ul><ul><ul><li>Pilots and examples </li></ul></ul>
    33. 33. Questions <ul><li>How do we guarantee that the generated expected outputs and inputs are enough and cover all the cases? </li></ul><ul><li>How to make for the errors and exceptions that may occur due to running the program on different environments and different OSs? </li></ul><ul><li>How is automated generation of inputs and outputs work when an actual human interaction is required as part of the system testing? </li></ul><ul><li>Does MBT cover stress testing? </li></ul><ul><li>Does MBT cover how user friendly the system is or it only covers functionality? </li></ul>
    34. 34. References
    35. 35. References <ul><li>http://en.wikipedia.org/wiki/Model-based_testing </li></ul><ul><li>http://blogs.msdn.com/nihitk/articles/144664.aspx </li></ul><ul><li>http://research.microsoft.com/specsharp/ </li></ul><ul><li>http://react.cs.uni-sb.de/mbt2006/talks/mbt4 masses .pdf </li></ul><ul><li>http://react.cs.uni-sb.de/mbt2006/talks/ModelBasedTestingSoberEvaluation.pdf </li></ul><ul><li>http://aetgweb.argreenhouse.com/papers/1999-icse.pdf </li></ul><ul><li>Colin Campbell, Wolfgang Grieskamp, Lev Nachmanson, Wolfram Schulte, Nikolai Tillmann, Margus Veanes “Spec Explorer: An Integrated Environment for Model-Based Testing.” Foundations of Software Engineering Microsoft Research, Redmond </li></ul>