UML-based Test Generation and Execution



Similar documents
UML-based Test Generation and Execution

BPMN by example. Bizagi Suite. Copyright 2014 Bizagi

Model-based Testing: Next Generation Functional Software Testing

UML TUTORIALS THE USE CASE MODEL

Introduction to Computers and Programming. Testing

Software Development in the Fields of Embedded Systems, Safety, and Security

Modeling the User Interface of Web Applications with UML

Designing Real-Time and Embedded Systems with the COMET/UML method

The CVS-Server Case Study: A Formalized Security Architecture

Object Oriented Programming. Risk Management

Evaluation of a Use-Case-Driven Requirements Analysis Tool Employing Web UI Prototype Generation

Testing automation of projects in telecommunication domain

Use Cases. Massimo Felici. Massimo Felici Use Cases c

Model-Based Testing of Web Applications using NModel

TTCN-3, Qtronic and SIP

Tool Support for Software Variability Management and Product Derivation in Software Product Lines

Information Systems Analysis and Design CSC John Mylopoulos. Software Architectures Information Systems Analysis and Design CSC340

Developing SOA solutions using IBM SOA Foundation

How To Test Automatically

Automatic Test Data Generation for TTCN-3 using CTE

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Using UML Part Two Behavioral Modeling Diagrams

The SPES Methodology Modeling- and Analysis Techniques

The WebShop e-commerce framework

Writing Use Case Scenarios for Model Driven Development

Course Code and Name Year - Semester. Number of marks

Efficient Agent Based Testing Framework for Web Applications

Chap 1. Introduction to Software Architecture

Process Modeling using BPMN 2.0

Software Engineering. Software Testing. Based on Software Engineering, 7 th Edition by Ian Sommerville

IBM Rational Rhapsody

EMBEDDED SOFTWARE DEVELOPMENT: COMPONENTS AND CONTRACTS

Circles and Diamonds and Squares, Oh My! Demystifying the BPMN Standard

Sofware Requirements Engineeing

Model Driven Testing AGEDIS Architecture Interfaces and Tools

Menouer Boubekeur, Gregory Provan

Test Case Design Using Classification Trees

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Software Development Kit

PSS E. High-Performance Transmission Planning Application for the Power Industry. Answers for energy.

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

Model based testing tools. Olli Pekka Puolitaival

Configuration Management Models in Commercial Environments

How To Create A Diagram On Rational Software Development Platform

Introduction to Business Model Simulation ActiveVOS Designer

Modeling Guidelines Manual

Test Case Design Using Classification Trees and the Classification-Tree Editor CTE

Developing Complex Systems using DOORS and UML

Integrated Development of Distributed Real-Time Applications with Asynchronous Communication

Use-Case Analysis. ! What is it? ! From where did it come? ! Now part of UML

UML: Unified Modeling Language

System Behaviour Analysis with UML and Ptolemy. Scope and goals

UML Diagram Types. Use Cases do the Following. Use Case Diagram

SysML Modelling Language explained

Applying 4+1 View Architecture with UML 2. White Paper

Best Practices for Improving the Quality and Speed of Your Agile Testing

Utilizing Domain-Specific Modelling for Software Testing

Business-Driven Software Engineering Lecture 3 Foundations of Processes

Architecture. Reda Bendraou

Business Modeling with UML

Advanced TTCN-3 Test Suite validation with Titan

Object-oriented design methodologies

Communications Software Engineering Design Model

A UML 2 Profile for Business Process Modelling *

BPMN Fundamentals. BPMI Meeting #12. London, United Kingdom May 13-14, Stephen A. White, IBM Notation Working Group Chair

Advanced Software Test Design Techniques Use Cases

Rational Quality Manager. Quick Start Tutorial

Embedded/Real-Time Software Development with PathMATE and IBM Rational Systems Developer

Chapter 19. Activity Diagrams

Chapter 8 Software Testing

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

StreamServe Persuasion SP5 Upgrading instructions

Applying Use Cases to Microcontroller Code Development. Chris Gilbert Cypress Semiconductor

BCS HIGHER EDUCATION QUALIFICATIONS Level 6 Professional Graduate Diploma in IT. March 2013 EXAMINERS REPORT. Software Engineering 2

ATM Case Study Part 1

Business Process Modelling Notation A tutorial

Analysis and Design with UML

Benefits of Test Automation for Agile Testing

Analytics for Performance Optimization of BPMN2.0 Business Processes

Towards an automated testing framework to manage variability using the UML Testing Profile

Process Optimizer Hands-on Exercise

Business Process Modeling Information Systems in Industry ( )

Software Architecture Document

Use Cases. Reference: Craig Larman, Applying UML and Patterns, Ch. 6

Why are Business Process Models often too complex? Do s and Don ts for Business Process Modelers

Generation of test cases from functional requirements. A survey

Bonita Open Solution. Introduction Tutorial. Version 5.7. Process Design User Guidance Profile: Business Analyst

Real Time Developer Studio. Emmanuel Gaudin

Karunya University Dept. of Information Technology

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

4.7 Business Process Model and Notation

Compliance and Requirement Traceability for SysML v.1.0a

Transcription:

UML-based Test Generation and Execution Axel Ruder Email:axel.ruder@siemens.com +1 (609) 734 3632 Software Engineering Department Siemens Corporate Research Princeton, NJ 1 Outline Research at SCR Model based testing i Category/Partition Method i TDE/UML for Unit/Integration Testing i TDE/UML for System Testing Benefits Summary 2 Seite 1 1

Corporate Technology:- About 1,750 Researchers and Developers Worldwide Roke Manor, Romsey Berlin Berkeley, CA Princeton, NJ SCR München Perlach Erlangen 2004: Bangalore Beijing Tokyo 3 Motivation Siemens is one of the largest software development houses in the world (> 30.000 developers worldwide) Siemens software ranges from embedded to enterprise level software systems These complex, distributed systems need to be modeled using some standardized notation => UML For embedded systems, for example telecom systems and reactive components we need to model their behavior based on statecharts and sequence diagrams For enterprise level applications, for example hospital IT systems and web-based applications we need to model their behavior based on Use Cases and Activity diagrams With this presentation, I ll be providing you an overview of our techniques, tools and their applications 4 Seite 2 2

Testing Research at SCR Focus on developing efficient techniques and tools for test case generation Coupling them with suitable execution tools Specification-based black-box tests Testing based on UML diagrams Support of all test levels: i Unit testing TDE/UML 1999 i Integration testing TDE/UML 2000 i System testing TDE/UML 2003 5 The Category-Partition Method The method identifies behavioral equivalence classes within the structure of a SUT A category or partition is defined by specifying all possible data choices that it can represent. i Choices: data values, references to other categories or partitions, or a combination of both. A test design is created using TSL - Test Specification Language For detailed explanation, see Boris Beizer, Black-Box Testing : Techniques for Functional Testing of Software and Systems, John Wiley 1995. Example: Test Bank_Account { frame value expr "$operation $account_number $amount $operation $account_number $amount $operation $account_number $amount"; partition amount: { * zero value 0; * small value select (1..100); * high value select (101..10000); } category account_number: * individual value "01-123456"; * joint value "02-222567"; * corporate value "11-987654"; } partition operation: { * create_account * deposit {pre (operation ~ create_account);} * withdraw {pre (operation ~ create_account);}} }... 6 Seite 3 3

Test Generation and Execution TDE TDE/ UML 1 2 Target: Software Components Unit / Integration testing Diagram used: Statechart(s)/Interaction Diagrams Target: System level functional testing Diagram used: Use cases/ Activity Diagrams UML Case Tool (e.g., Rational Rose) Execution Tools Test Scripts 7 Approach Step 1: Modeling Component Behavior UML Statecharts describing behavior of each component i Representing the normal and erroneous behavior of the component i UML extended by a new transition labeling scheme Assumptions: i Point-to-point communication semantics between components rather than a shared event model i Communications are synchronous (blocking) i Implementation is deterministic 8 Seite 4 4

TDE/UML An Example: A Communication Protocol Transmitter txport Comch rxport Receiver timing Timer A tuser timer cherror ruser Focus on integration testing Generate test cases to validate component interaction Consider subsystem A External interfaces: i tuser i timer i txport Internal Interfaces: i timing 9 Describing Component Behavior and Interaction tuser txport timer timing Transmitter Timer M atching Send and Receive Events Between Components 10 Seite 5 5

TDE/UML- Approach Step 2: Generating Test Cases (1) Normalizing the UML-based Models i Resolving transitions with multiple events (2) Computation of a global behavioral model based on matching send and receive events i Composing the Global Behavioral Model (complexity is better than exponential) i Determining a composition order (based on subsystem definition) (3) Generating test cases from the global behavioral model i i Default coverage criterion: all transitions (within/between components) Using the data variations specified during the initial modeling phase 11 Normalizing the UML-based Models... Original Trans mitter Trans mitter (expanded) 12 Seite 6 6

Composing a Global Behavioral Model... user channel Trans mitter (expanded) Timer (expanded) timing timer compose Trans mitter_timer (co mposed) 13 Test Case Generation Trans mitter_timer (co mposed) TEST CASE #1 * IN user.message(); * OUT channel.send * IN channel.ack(); * IN user.message(); * OUT channel.send * IN channel.ack(); TEST CASE #2 * IN user.message(); * OUT channel.send * IN timer.interrupt(); * OUT channel.send * IN channel.ack(); * IN user.message(); * OUT channel.send * IN channel.ack(); Test Casesfor Subcomponent Forintegration testing: alltransitions between componentsarecovered 14 Seite 7 7

Registrar CancelEncounter <<include>> <<include>> PrintArtifacts UpdateEncounter Test Generation and Execution TDE TDE/ UML 1 2 Target: Software Components Unit / Integration testing Diagram used: Statechart(s)/Interaction Diagrams Target: System level functional testing Diagram used: Use cases/ Activity Diagrams UML Case Tool (e.g., Rational Rose) Execution Tools Test Scripts 15 TDE/UML for System Testing System Specification UML Diagrams (TSL) Annotations Use Use Case Case Specification Specification Flow of Business Flow of Business Events Rules Events Rules G Application U I SUT Capture/ Replay Tool Test Scripts TDE Test Designer 16 Seite 8 8

TDE/UML for System Testing Why Use Cases and Activity Diagram? i They offer systematic and intuitive means of capturing functional requirements with a focus on value added to the user i They describe system behavior from a user point of view i Unfortunately not formal enough for test automation Describing Use Case with Activity Diagram i Annotations i UML stereotypes and notes i Activities organized in swim lanes i Happy path (ActorAction, SystemResponse) and alternative courses i Refinements i Activity and variables - Strategy: be as abstract or concrete as you like 17 Modeling Use Cases with Activity Diagrams <<include>> Registrar CancelEncounter <<include>> UpdateEncounter PrintArtifacts UserAction <<Name>> CancelEnc ounter {AbstractLevel} <<UserAction>> InvokeCancellation <<UserActio... FilloutCancellation Form SystemResponse Alternativ ecourses <<precondition>> 1. A valid user is logged into the system. 2. An encounter in a "Attended" or "Checked-In" status has been identified 3. Context of the encounter is known PresentEncounterInfor mation <<SystemRespons... PresentEncounterNotEligible Message PresentCancellationForm 18 Seite 9 9

Structural Annotations to an Activity Diagram i Activity : <ActorAction>, <SystemResponse> or <Include> i Variables: <define> i Branches: TSL guard condition ( using variables ) Test Related i Partitions i Coverage statements <<UserAction>> InvokeCancellation <<UserActio... FilloutCancellation Form <<define>> ExistingServicesProfileOption ServicesAttached PresentEncounterInfor mation [ ServicesAttached && (ExistingServic esprofileoption==#error) ] <<SystemRespons... PresentEncounterNotEligible Message PresentCancellationForm <<partitions>> partition ExistingServicesProfileOption { *Warning value "warning"; *Error value "error"; } 19 Annotations to an Activity Diagram Structural i Activity : <ActorAction>, <SystemResponse> or <Include> i Variables: <define> i Branches: TSL guard condition ( using variables ) Test Related i Partitions i Coverage statements <<UserAction>> InvokeCancellation <<UserActio... FilloutCancellation Form <<define>> ExistingServicesProfileOption ServicesAttached PresentEncounterInfor mation PresentCancellationForm <<partitions>> partition ExistingServicesProfileOption { *Warning value "warning"; *Error value "error"; } [ ServicesAttached && (ExistingServic esprofileoption==#error) ] <<SystemRespons... PresentEncounterNotEligible Message 20 Seite 10 10

Structural Annotations to an Activity Diagram i Activity : <ActorAction>, <SystemResponse> or <Include> i Variables: <define> i Branches: TSL guard condition ( using variables ) Test Related i Partitions i Coverage statements <<UserAction>> InvokeCancellation <<UserActio... FilloutCancellation Form <<define>> ExistingServicesProfileOption ServicesAttached PresentEncounterInfor mation PresentCancellationForm <<partitions>> partition ExistingServicesProfileOption { *Warning value "warning"; *Error value "error"; } [ ServicesAttached && (ExistingServic esprofileoption==#error) ] <<SystemRespons... PresentEncounterNotEligible Message 21 Annotations to an Activity Diagram Activities may be refined using sudiagrams Transparent abstraction levels for test generation Be as abstract as you want 22 Seite 11 11

Test Case Generation from within Rational Rose Figure 5: Generating System Tests from within Rational Rose 23 Test Generation Related to a specific Use Case Steps i Refinements are expanded i Happy paths from included Use Cases are analyzed i TSL test design is generated from the activity diagram i Mapping activities and transitions to TSL partitions and choices. i TDE creates test cases in order to satisfy the coverage requirements i Default - all data variations and branches are covered UserAction <<UserActio... FilloutCancellationForm <<define>> InvalidDate SystemResponse ValidateEntries PromptVerifyCom pletion [ cancel ] [ InvalidDate ] <<include>> CancelCancelE ncounter Exceptions PresentInvalidMessage 24 Seite 12 12

Test Script Output TSL TSL Test Test Design Design TSL Test Generator <Test name="cancelencounter_systemtest_1"> <UserAction name="filloutcancellationform"> <Choice name="invaliddate" value="t" /> <Choice name="filloutcancellationform_cancel" value="f"/> </UserAction> <SystemResponse name="validateentries" /> <SystemResponse name="presentinvalidmessage" /> </Test> 25 Benefits Modeling system behavior. i Results in better, consistent and complete system models i Enables test designer to identify and compactly document a greater variety of test scenarios Effectiveness of test design phase can be increased Generating test procedures. i Supports the automatic and systematic derivation of test cases i Notion of test adequacy or coverage with respect to the system functionality is addressed Executing test scripts. i Support for automated test execution i Promotes script reuse and simplifies script maintenance through test snipplets 26 Seite 13 13

Conclusion and Future Work Conclusion i Presented ongoing research project at SCR i UML-based approach on unit/integration and system testing i Benefits from both combining COTS and in-house tools Future Work i Empirical Study i Tool Enhancements (Wizard, Advisor ) i Integration of i UML 2.0 Testing Profile i TTCN-3 i Product Lines 27 Seite 14 14