Presentation of a paper on “Model-based Software Testing”

Slides:



Advertisements
Similar presentations
Model-Based Testing with Smartesting Jean-Pierre Schoch Sogetis Second Testing Academy 29 April 2009.
Advertisements

Formal Methods of Systems Specification Logical Specification of Hard- and Software Dr. Armin Wolf Fraunhofer Institut für Rechnerarchitektur.
By Karen Richart. The Object Constraint Language (OCL)  Formal specification language that could be used for constraining the model elements that occur.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Extending ASSL: Making UML Metamodell-based Workflows executable © 2010 University of Rostock | Department of Computer Science Jens Brüning, Andreas Wolff.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
1 Specifying Object Interfaces. 2 Major tasks in this stage: --are there any missing attributes or operations? --how can we reduce coupling, make interface.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Detail Design Extending UML and Object Design. Object Design.
CHAPTER 3 COLLECTIONS SET Collection. 2 Abstract Data Types A data type consists of a set of values or elements, called its domain, and a set of operators.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Describing Syntax and Semantics
Implementing Stacks Ellen Walker CPSC 201 Data Structures Hiram College.
Week7 Stack Data Structures & Algorithms. Introduction to Stacks and Queues Widely used data structures Ordered List of element Easy to implement Easy.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
Introduction to MDA (Model Driven Architecture) CYT.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Data Structures and Algorithms Stacks. Stacks are a special form of collection with LIFO semantics Two methods int push( Stack s, void *item ); - add.
111 Writing Protocols in OCL CS 4311 Jos B. Warmer and Anneke G. Kleppe, OCL: The Constraint Language of the UML, JOOP, May Jos B. Warmer and Anneke.
An introduction to specification in VDM-SL At the end of this lecture you should be able to: write a formal specification of a system in VDM-SL; correlate.
ดร.สุรศักดิ์ มังสิงห์ SPU, Computer Science Dept.
© 2004 Goodrich, Tamassia Stacks. © 2004 Goodrich, Tamassia Stacks2 Abstract Data Types (ADTs) An abstract data type (ADT) is an abstraction of a data.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style COMPILER DESIGN Code generation Joey Paquet,
1 OCL The Role of OCL in UML. 2 רשימת הנושאים  מבוא  מרכיבי השפה  דוגמאות  מקורות.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
IM NTU Software Development Methods, Fall2006 Software Development Methods, Fall 2006 OCL 2006/12/ Object Constraint Language (OCL) Yih-Kuen Tsay.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
A UML-Based Pattern Specification Technique Presented by Chin-Yi Tsai IEEE TRANSACTION ON SOFTWARE ENGINEERING, VOL. 30, NO. 3, MARCH 2004 Robert B. France,
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Jan Pettersen Nytun, UIA, page 1. Jan Pettersen Nytun, UIA, page 2 HISTORY COLLECTION TYPES AND QUERING IN OCL FORMAL LANGUAGE - STATEMENT EXAMPLES CONSTRAINTS.
The Relation Induced by a Partition
Bitwise Operations C includes operators that permit working with the bit-level representation of a value. You can: - shift the bits of a value to the left.
CSE3302 Programming Languages (notes continued)
Automatic Test Generation
“<Fill in your definition here.>”
Formal Methods in SE Lecture 21.
Chapter 16 UML Class Diagrams.
CS 326 Programming Languages, Concepts and Implementation
Representation, Syntax, Paradigms, Types
Stacks.
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Business Process Measures
The Object Constraint Language
Specifying Object Interfaces
Objective of This Course
Programming Languages 2nd edition Tucker and Noonan
Representation, Syntax, Paradigms, Types
Defining Classes and Methods
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Representation, Syntax, Paradigms, Types
The Object Constraint Language
Cs212: Data Structures Computer Science Department Lecture 6: Stacks.
Python Primer 1: Types and Operators
Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract, Computer,
Languages and Compilers (SProg og Oversættere)
Representation, Syntax, Paradigms, Types
… NPDAs continued.
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Object Constraint Language (OCL)
Formal Methods in Software Engineering 1
Programming Languages 2nd edition Tucker and Noonan
Introduction to Python
Presentation transcript:

Presentation of a paper on “Model-based Software Testing” Dr. Kasi Periyasamy Department of Computer Science

Reference 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.

About the authors F. Bouquet, University of Besançon, France. C. Grandpierre, B. Legeard, F. Peureux and N. Vacelet, LEIRIOS, France. M. Utting, University of Waikato, New Zealand.

Objective and Approach Demonstrate the use of UML 2.1.1 for Model-Based Testing Approach Define an executable subset of UML 2.1.1 and use it for Model-Based Testing The work uses UML class diagram, state diagram and OCL (Object Constraint Language) for defining the model A tool has been developed to automate the testing process

Definition of Model-Based Testing Definition given by the authors A process to automatically generate test cases and executable test scripts from a behavioral model of the system under test (SUT) The model formalizes the expected behavior so that it is easy for analysis and automation

Notations and Tools A subset of UML 2.1 is chosen, named as UML-MBT Class Diagram, Object Diagram, State Diagram, and Object Constraint Language (OCL) Slightly different from UML 2.1; changes are made to support practical model-based testing In particular, OCL 2.0 is modified (explained in later slides) LEIRIOS Test Designer tool was used to automatically generate the test cases Uses theorem proving technology

Restrictions Only Integer, Boolean, Enumerated type and Object type are supported Specific range of integers are chosen because of implementation constraints Inheritance and Association classes in Class Diagram are not considered Dynamic creation and deletion of objects are not considered All objects are shown in the object diagram at the very beginning of the testing process Semantics of State machine processing assumes “Run-to-Completion” of transitions

Passive and Active OCL expressions The expression is treated as a condition and yields a Boolean result E.g., variable = true Pre-conditions and other constraints Active The expression is evaluated and a value is assigned to the variable on L.H.S. E.g., variable = true Post-conditions and actions

Operators in OCL Boolean operators: ‘=’, ‘<>’, ‘or’, ‘and’, ‘not’, ‘xor’ Arithmetic operators: All standard operators Operators on Enumerated types: ‘=’ , ‘<>’ Operators on classes and objects: ‘=’, ‘<>’, obj.oclIsUndefined() ……. Boolean class.allInstances() …...... Set

Operators in OCL (continued) Operators on collections: ‘=’, ‘<>’, coll->size(), coll->includes(obj), coll->excludes(obj), coll->includesAll (set), coll->excludedAll (set), coll->isEmpty(), coll->notEmpty(), coll->including (obj), coll->excluding (obj) The last two operators return sets while others (except size()) return Boolean results.

Operators in OCL (continued) Iterative operators on collections: coll->collect (obj), coll->select (bool exp) The above operations return sets coll->exists (bool exp), coll->forAll (bool exp) The above two operations return Boolean results coll->any (bool exp) The above operation returns an object

Behavioral Description Context: Triangle::getType (a:Integer, b:Integer, c:Integer) : TYPE Pre: a > 0 and b > 0 and c > 0 Post: If (a+b <= c or b+c <= a or c+a <= b) then Result = TYPE::NOT_A_TRIANGLE Else If (a = b or b = c or c = a) then If (a = b and b = c) then Result = TYPE::EQUILATERAL Else Result = TYPE::ISOCELES Endif Result = TYPE::SCALANE

Undefined value Different from OCL semantics from UML 2.1 Coll->any (bool exp) may return an undefined value when no object in the collection satisfies the boolean expression Expr.role may return an undefined value when the expression evaluates to a non-existing object or the role identifies a non-existing object Remember that all objects must be available in the object diagram before the testing process is started Divide by zero execution results in undefined value

Application Example - Stack 0..1 Points to Max : Integer Size : Integer +stack +up +top 0..1 0..1 Pop () Push () Element isOn +stack 1 0..* 0..1 +elements takesFrom +down 1 +pool 0..1 Pool emptyOut () fillOut () +pool contains © F.Bouquet, A-MOST 2007

Object diagram stack: Stack pool: Pool Max = 3 Size = 0 e2 : Element © F. Bouquet, A-MOST 2007

State Diagram Pop() EmptyStackException Empty Push() Pop()[size=1] Push()[size < max-1] Pop()[size>1] Loaded Pop() Push()[size = max-1] Full FullStackException Push() © F. Bouquest, A-MOST 2007

Results of test automation Show tables from the paper

Conclusion by authors Model-based testing demonstrated using a subset of UML 2.1 Testing process automated using LEIRIOS Test Design tool Results are convincing A lot of limitations to work around Continuing work on more real-world problems

My comments Very interesting paper on model-based testing Most attractive feature is the automation of test case generation using the state machine model and OCL behavioral description I agree with the authors that the approach should be demonstrated for more real-world problems Using UML reduces the learning curve on developing a model  a problem with other model-based techniques The paper focuses more on the model and very little about actual testing process itself.