Test Generation from UML Specifications Michael A. Gray American University Washington, DC.

Slides:



Advertisements
Similar presentations
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Advertisements

1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
Chapter 6: Behavioral Modeling
Introduction to Software Engineering 7. Modeling Behaviour.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Interaction Diagrams Activity Diagram State Machine Diagram
Object-Oriented Analysis and Design
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
Essentials of interaction diagrams Lecture 23 & 24.
Chapter 8: Modelling Interactions and Behaviour
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Advanced Behavioral Modeling
7M822 UML Interaction Diagrams 25 November 2010.
SE-565 Software System Requirements More UML Diagrams.
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
Interaction Models (2): Sequence Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh 1.
Sequence & Statechart Diagrams Month Day, Year. Agenda Training Plan Overview Actors and Use Case Diagrams Sequence Diagrams Diagram Elements Evolution.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
ניתוח מערכות מידע 1 Unified Modeling Language (UML) § § The Unified Modeling Language (UML) is the industry-standard language for: Specifying, Visualizing,
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Sequence diagram in UML Martin Palkovik. Sequence diagram  It is a graphic representation of system operations based on chronology - a time sequence.
An Introduction to the Unified Modeling Language
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Design Jon Walker. More UML ● What is UML again?
UML Diagrams CSC 422 Kutztown University Dr. Daniel Spiegel.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
Software Engineering Lecture 8 Object-Oriented Analysis.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Chapter 3: Introducing the UML
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
Appendix 3 Object-Oriented Analysis and Design
CHAPTER
UML Diagrams By Daniel Damaris Novarianto S..
The Movement To Objects
Object-Oriented Analysis and Design
UML Diagrams Jung Woo.
State Machine Diagrams
UML dynamic Modeling (Behavior Diagram)
Princess Nourah bint Abdulrahman University
States.
IMAT5205 Systems Analysis and Design
Week 12: Activity & Sequence Diagrams
CIS 375 Bruce R. Maxim UM-Dearborn
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
States.
CIS 375 Bruce R. Maxim UM-Dearborn
Behavioral Diagrams P. P. Mahale
Uml diagrams In ooad.
Presentation transcript:

Test Generation from UML Specifications Michael A. Gray American University Washington, DC

© Michael A. GrayMarch 23, Today's Agenda 1.Review the sources of test generation information available in UML models 2.Discuss the extraction and use of the UML information 3.Survey some of the recent efforts in test generation from UML

© Michael A. GrayMarch 23, Preface Will treat a UML specification as an exact statement of the desired system Each item of information in the specification is a requirement on the implementation Programming Language GrammarUML Specification Program Implementation

© Michael A. GrayMarch 23, Preface The testing in today's discussion is that required to verify the claim that an implementation is a valid instance of the specification Programming Language Compiler Testing Program Implementation

© Michael A. GrayMarch 23, Review Will consider only the structural and behavioral models of a UML specification UML models consist of diagrams - graphs of vertices (things) and arcs (relationships) There are 5 complementary views used in UML to specify OO systems - each view contains structural and behavioral modes

© Michael A. GrayMarch 23, Review We will focus on the Design View and the Use Case View These views are assembled using 9 kinds of predefined diagrams The structural group of diagrams are the object diagram the class diagram

© Michael A. GrayMarch 23, Review the object diagram is a static representation of the system at some point it contains –objects –links

© Michael A. GrayMarch 23, Review the class diagram contains –classes (instance multiplicity) –interfaces –collaborations –dependency relationships –class relationships Generalization/Specialization (root, leaf properties) Aggregation/Composition Association (link multiplicity)

© Michael A. GrayMarch 23, Review the class diagram contains –attributes (concept-specifying and state-specifying) type and initial value collection multiplicity properties (changeable, addOnly, frozen) –operations visibility signature –parameter list (direction name : type = default-value) –return type properties (isQuery, sequential, guarded, concurrent)

© Michael A. GrayMarch 23, Review example class diagram

© Michael A. GrayMarch 23, Review The behavioral group of diagrams are the use case diagram the sequence diagram the collaboration diagram the statechart diagram the activity diagram

© Michael A. GrayMarch 23, Review the use case diagram shows a set of use cases and their relationships – specifies the uses view of a system in a case format

© Michael A. GrayMarch 23, Review the use case diagram – a use case is a functional requirement on sequences of actions that a system performs to yield a result for a user – each sequence represents the interaction of the external objects with the system – organization generalization/specialization relationships dependency relationships ( >, >)

© Michael A. GrayMarch 23, Review the scenario –a specific sequence of actions that illustrate behavior –instances of use

© Michael A. GrayMarch 23, Review the sequence diagram (interaction diagram) shows the time ordering of messages exchanged by objects – specifies the messages sent and received by objects

© Michael A. GrayMarch 23, Review the sequence diagram (interaction diagram) −time progresses from the top of a sequence diagram to the bottom −objects involved in the interaction are partitioned into vertical columns −object lifetime information is shown as dashed lines - these are called an object's lifeline −object control is shown as a vertical, narrow rectangle representing an object with the control −messages between objects are shown as horizontal, directed lines – specifies the messages sent and received by objects

© Michael A. GrayMarch 23, Review the collaboration diagram (interaction diagram) shows the structural ordering of messages exchanged by objects – specifies the links among objects and the messages that pass over them

© Michael A. GrayMarch 23, Review the collaboration diagram (interaction diagram) −collaboration and sequence diagrams are semantically equivalent −time is not shown explicitly in a collaboration diagram −object lifetime information is not shown as dashed lines −object control is not shown explicitly −messages between objects are shown as labelled, directed arcs beginning with the initiating object and ending on the receiving object −messages are labelled with a number showing the relative order of the message in the sequence of messages

© Michael A. GrayMarch 23, Review the statechart diagram (interaction diagram) shows a state machine that represents the dynamic behavior of a class – specifies the states, events, transitions, and activities of the class instances

© Michael A. GrayMarch 23, Review the statechart diagram (interaction diagram) –the representation of a state can have several parts name –a unique text string that identifies the state entry/exit actions internal transitions –reaction to events that do not cause a full change of state substates –the structure of a state used in internal transitions deferred events –events deferred to another state of the object

© Michael A. GrayMarch 23, Review the statechart diagram (interaction diagram) initial states are represented by a black-filled circle final states are represented by a black-filled circle within a circle –a state transition has five parts source state event trigger –signal –call –time expiration –state change guard condition evaluated after the event trigger occurs

© Michael A. GrayMarch 23, Review the statechart diagram (interaction diagram) action - an executable atomic computation that occurs after transition...it may inlude –operation calls –creation/destruction of another object –sending a signal target state

© Michael A. GrayMarch 23, Review the statechart diagram (interaction diagram) –complex states entry action - actions done on entering the state exit action - actions are done on leaving the state internal transition - transitions used when you do not want the entry/exit actions to be performed activity - takes finite time and occurs when in a state...in an activity, you can specify »an action, another state machine, or a sequence of actions deferred events - events received during execution that must be saved until execution is done

© Michael A. GrayMarch 23, Review the activity diagram −shows the flow of activities within a system −illustrate the sequential and branching flow of activity and the objects that act and are acted on

© Michael A. GrayMarch 23, Discussion Object Diagram Testing Objectives Are system snapshots permissible configurations? Need to test: snapshot objects and links permitted under UML specs permissible number of links permissible navigability and visibility Are system evolutions permissible sequences of object diagrams? Need to test: sequence of snapshots is permissible

© Michael A. GrayMarch 23, Discussion Object Diagram Testing Methods Are system snapshots permissible configurations? How to establish the snapshot for testing? (no UML spec) How to test existence of objects and links? test preparation: automatible from Object Diagram test measurement: runtime analysis (object internals?) How to test link numbers and navigability? test preparation: automatible from Class Diagram test measurement: runtime analysis (object internals?) Are system evolutions permissible sequences of object diagrams? How to establish sequence of system states? (no UML specs)

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Objectives Are system classes permissible? Need to test: existence of classes in libraries Are system class generalizations/specializations permissible? Need to test: determination of class superclasses and subclasses Are system class aggregations/compositions permissible? Need to test: determine object part-of links determine necessity of part-of links permissible number of links

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Objectives Are system class associations permissible? Need to test: determine class associations permissible association mulitplicity permissible navigability and visibility Are system class interfaces permissible? Need to test: determine class interfaces correctness of interfaces

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Methods Are system classes permissible? How to determine existence of classes in libraries test preparation: automatible from Class Diagram test measurement: library analysis (utility classes?) Are system class generalizations/specializations permissible? How to determination of class superclasses and subclasses test preparation: automatible from Class Diagram test measurement: library/runtime (super()?)

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Methods Are system class aggregations/compositions permissible? How to determine object part-of links test preparation: automatible from Class Diagram test measurement: library/runtime (method analysis?) How to determine necessity of part-of links test preparation: automatible from Class Diagram test measurement: library/runtime (constructor analysis?) How to determine permissible number of links test preparation: automatible from Class Diagram test measurement: library/runtime (attribute analysis?)

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Methods Are system class associations permissible? How to determine class associations? test preparation: automatible from Class Diagram test measurement: library/runtime (attribute analysis?) How to determine association mulitplicity test preparation: automatible from Class Diagram test measurement: library/runtime (attribute analysis?) How to determine navigability and visibility test preparation: automatible from Class Diagram test measurement: library/runtime (attribute analysis?)

© Michael A. GrayMarch 23, Discussion Class Diagram Testing Methods Are system class interfaces permissible? How to determine class interfaces test preparation: automatible from Class Diagram test measurement: library/runtime (realizes analysis?) How to determine correctness of interfaces test preparation: automatible from Class Diagram test measurement: library/runtime (method analysis?)

© Michael A. GrayMarch 23, Discussion Use Case Diagram Testing Objectives Are system functions available? Need to test: system functionality Use Case Diagram Testing Methods Are system functions available? How to determine large-scale functionality test preparation: large-scale functions automatible from Use Case Diagram test measurement: black box tests from scenarios by actors following scripts

© Michael A. GrayMarch 23, Discussion Sequence Diagram Testing Objectives Are message sequences/object interactions correct? Need to test: sequences of messages among objects object participation in interactions object lifetimes object control?

© Michael A. GrayMarch 23, Discussion Sequence Diagram Testing Methods Are message sequences/object interactions correct? How to determine sequences of messages among objects test preparation: automatible from Sequence Diagrams test measurement: unit tests - instrumentation/logs? How to determine object participation in interactions test preparation: automatible from Sequence Diagrams test measurement: unit tests - instrumentation/logs How to determine object lifetimes/object control test preparation: automatible from Sequence Diagrams test measurement: unit tests - instrumentation/logs

© Michael A. GrayMarch 23, Discussion Statechart Diagram Testing Objectives Are state sequences correct? Need to test: event reception and state change object actions/activities

© Michael A. GrayMarch 23, Discussion Statechart Diagram Testing Methods Is event reception/state change correct? How to determine event reception/state change test preparation: automatible from Statechart Diagrams; how to establish event environment? test measurement: unit tests - instrumentation/logs? How to determine object actions/activities test preparation: automatible from Statechart Diagrams; how to establish event environment? test measurement: unit tests - instrumentation/logs

© Michael A. GrayMarch 23, Discussion Activity Diagram Testing Objectives Is system activity flow correct? Need to test: system activities → object attributes/actions? object attributes/actions Activity Diagram Testing Methods Are object attributes/actions correct? How to determine object attributes/actions test preparation: automatible from Activity Diagrams; how to establish system flow environment? test measurement: system tests - instrumentation/logs?

© Michael A. GrayMarch 23, Discussion Activity Diagram Testing Methods Are object attributes/actions correct? How to determine object attributes/actions test preparation: automatible from Activity Diagrams; how to establish system flow environment? test measurement: system tests - instrumentation/logs?

© Michael A. GrayMarch 23, Survey Colorado State (Robert France) –test generation from class, collaboration,state AGEDIS Project, IBM Haifa –test engine/generation from object, class, state UCTSystem (Nebut) –use case test generation Siemens (Hartmann) –functional testing (equivalence classes)

© Michael A. GrayMarch 23, Survey COTE (Umlaut/TGV) –test generation from class, collaboration,state Rhapsody ATG (Germany) –UML and source code