Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Presentation of a paper on "Model-based Software Testing"

823 views

Published on

  • Be the first to comment

  • Be the first to like this

Presentation of a paper on "Model-based Software Testing"

  1. 1. Presentation of a paper on “Model-based Software Testing” Dr. Kasi Periyasamy Department of Computer Science
  2. 2. Reference <ul><li>F. Bouquet et al., “A Subset of Precise UML for Model-Based Testing”, Workshop on Advances in Model-Based Software Testing (A-MOST 07) , Part of International Symposium on Software Testing and Analysis (ISSTA 2007), London, UK, July 2007, pp. 95 – 104. </li></ul>
  3. 3. About the authors <ul><li>F. Bouquet, University of Besan ç on, France. </li></ul><ul><li>C. Grandpierre, B. Legeard, F. Peureux and N. Vacelet, LEIRIOS, France. </li></ul><ul><li>M. Utting, University of Waikato, New Zealand. </li></ul>
  4. 4. Objective and Approach <ul><li>Objective </li></ul><ul><ul><li>Demonstrate the use of UML 2.1.1 for Model-Based Testing </li></ul></ul><ul><li>Approach </li></ul><ul><ul><li>Define an executable subset of UML 2.1.1 and use it for Model-Based Testing </li></ul></ul><ul><ul><li>The work uses UML class diagram, state diagram and OCL (Object Constraint Language) for defining the model </li></ul></ul><ul><ul><li>A tool has been developed to automate the testing process </li></ul></ul>
  5. 5. Definition of Model-Based Testing <ul><li>Definition given by the authors </li></ul><ul><ul><li>A process to automatically generate test cases and executable test scripts from a behavioral model of the system under test (SUT) </li></ul></ul><ul><li>The model formalizes the expected behavior so that it is easy for analysis and automation </li></ul>
  6. 6. Notations and Tools <ul><li>A subset of UML 2.1 is chosen, named as UML-MBT </li></ul><ul><li>Class Diagram, Object Diagram, State Diagram , and Object Constraint Language (OCL) </li></ul><ul><li>Slightly different from UML 2.1; changes are made to support practical model-based testing </li></ul><ul><ul><li>In particular, OCL 2.0 is modified (explained in later slides) </li></ul></ul><ul><li>LEIRIOS Test Designer tool was used to automatically generate the test cases </li></ul><ul><ul><li>Uses theorem proving technology </li></ul></ul>
  7. 7. Restrictions <ul><li>Only Integer, Boolean, Enumerated type and Object type are supported </li></ul><ul><li>Specific range of integers are chosen because of implementation constraints </li></ul><ul><li>Inheritance and Association classes in Class Diagram are not considered </li></ul><ul><li>Dynamic creation and deletion of objects are not considered </li></ul><ul><ul><li>All objects are shown in the object diagram at the very beginning of the testing process </li></ul></ul><ul><li>Semantics of State machine processing assumes “ Run-to-Completion ” of transitions </li></ul>
  8. 8. Passive and Active OCL expressions <ul><li>Passive </li></ul><ul><ul><li>The expression is treated as a condition and yields a Boolean result </li></ul></ul><ul><ul><li>E.g., variable = true </li></ul></ul><ul><ul><li>Pre-conditions and other constraints </li></ul></ul><ul><li>Active </li></ul><ul><ul><li>The expression is evaluated and a value is assigned to the variable on L.H.S. </li></ul></ul><ul><ul><li>E.g., variable = true </li></ul></ul><ul><ul><li>Post-conditions and actions </li></ul></ul>
  9. 9. Operators in OCL <ul><li>Boolean operators: ‘=’, ‘<>’, ‘or’, ‘and’, ‘not’, ‘xor’ </li></ul><ul><li>Arithmetic operators: All standard operators </li></ul><ul><li>Operators on Enumerated types: ‘=’ , ‘<>’ </li></ul><ul><li>Operators on classes and objects: ‘=’, ‘<>’, </li></ul><ul><li>obj.oclIsUndefined() ……. Boolean </li></ul><ul><li>class.allInstances() …...... Set </li></ul>
  10. 10. Operators in OCL (continued) <ul><li>Operators on collections: ‘=’, ‘<>’, </li></ul><ul><li>coll->size(), coll->includes(obj), coll->excludes(obj), </li></ul><ul><li>coll->includesAll (set), coll->excludedAll (set), </li></ul><ul><li>coll->isEmpty(), coll->notEmpty(), </li></ul><ul><li>coll->including (obj), coll->excluding (obj) </li></ul><ul><li>The last two operators return sets while others (except size()) return Boolean results. </li></ul>
  11. 11. Operators in OCL (continued) <ul><li>Iterative operators on collections: </li></ul><ul><li>coll->collect (obj), coll->select (bool exp) </li></ul><ul><ul><li>The above operations return sets </li></ul></ul><ul><li>coll->exists (bool exp), coll->forAll (bool exp) </li></ul><ul><ul><li>The above two operations return Boolean results </li></ul></ul><ul><li>coll->any (bool exp) </li></ul><ul><ul><li>The above operation returns an object </li></ul></ul>
  12. 12. Behavioral Description <ul><li>Context: Triangle::getType (a:Integer, b:Integer, c:Integer) : TYPE </li></ul><ul><li>Pre: a > 0 and b > 0 and c > 0 </li></ul><ul><li>Post: </li></ul><ul><li>If (a+b <= c or b+c <= a or c+a <= b) then </li></ul><ul><li>Result = TYPE::NOT_A_TRIANGLE </li></ul><ul><li>Else </li></ul><ul><li>If (a = b or b = c or c = a) then </li></ul><ul><li>If (a = b and b = c) then </li></ul><ul><li>Result = TYPE::EQUILATERAL </li></ul><ul><li>Else Result = TYPE::ISOCELES </li></ul><ul><li>Endif </li></ul><ul><li>Else </li></ul><ul><li>Result = TYPE::SCALANE </li></ul><ul><li>Endif </li></ul><ul><li>Endif </li></ul>
  13. 13. Undefined value <ul><li>Different from OCL semantics from UML 2.1 </li></ul><ul><ul><li>Coll->any (bool exp) may return an undefined value when no object in the collection satisfies the boolean expression </li></ul></ul><ul><ul><li>Expr.role may return an undefined value when the expression evaluates to a non-existing object or the role identifies a non-existing object </li></ul></ul><ul><ul><li>Remember that all objects must be available in the object diagram before the testing process is started </li></ul></ul><ul><ul><li>Divide by zero execution results in undefined value </li></ul></ul>
  14. 14. Application Example - Stack Stack Max : Integer Size : Integer Pop () Push () Pool emptyOut () fillOut () Element 0..1 +stack +top 0..1 Points to 0..1 +up 0..1 +down isOn 0..* 0..1 +elements +pool contains 1 1 +stack +pool takesFrom © F.Bouquet, A-MOST 2007
  15. 15. Object diagram stack: Stack Max = 3 Size = 0 pool: Pool e1 : Element e2 : Element e3 : Element e4 : Element e5 : Element e6 : Element © F. Bouquet, A-MOST 2007
  16. 16. State Diagram Empty Loaded Full EmptyStackException FullStackException Pop() Pop()[size=1] Push() Pop()[size>1] Push()[size < max-1] Push()[size = max-1] Pop() Push() © F. Bouquest, A-MOST 2007
  17. 17. Results of test automation <ul><li>Show tables from the paper </li></ul>
  18. 18. Conclusion by authors <ul><li>Model-based testing demonstrated using a subset of UML 2.1 </li></ul><ul><li>Testing process automated using LEIRIOS Test Design tool </li></ul><ul><li>Results are convincing </li></ul><ul><li>A lot of limitations to work around </li></ul><ul><li>Continuing work on more real-world problems </li></ul>
  19. 19. My comments <ul><li>Very interesting paper on model-based testing </li></ul><ul><li>Most attractive feature is the automation of test case generation using the state machine model and OCL behavioral description </li></ul><ul><li>I agree with the authors that the approach should be demonstrated for more real-world problems </li></ul><ul><li>Using UML reduces the learning curve on developing a model  a problem with other model-based techniques </li></ul><ul><li>The paper focuses more on the model and very little about actual testing process itself . </li></ul>

×