MODEL BASED TEST DESIGN AT UNITY

Similar documents
Object Oriented Analysis and Design - Part2(Design)

Software Service Engineering

Extreme programming XP 6

Selection of UML Models for Test Case Generation: A Discussion on Techniques to Generate Test Cases

the gamedesigninitiative at cornell university Lecture 13 Architecture Design

the gamedesigninitiative at cornell university Lecture 12 Architecture Design

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

King of Thieves: Designing a F2P Game That s Different. Eugene Yailenko Senior Game Designer, ZeptoLab

Ch 1: The Architecture Business Cycle

Unified Modeling Language I.

The Seven Steps to Implement DataOps

Enterprise Architect Training Courses

Ingegneria del Software Corso di Laurea in Informatica per il Management

Software Architectures. Lecture 6 (part 1)

UML- a Brief Look UML and the Process

7 The proposed domain specific language: operational level

Interaction Testing. Chapter 15

StackMine Performance Debugging in the Large via Mining Millions of Stack Traces

Hippo Software BPMN and UML Training

Best Practices for Final Year Projects

Essentials of Web Designing

Unified Modeling Language 2

Designing for Multimedia

EasyTech Scope & Sequence for Grades K 8

Designing for Web Using Markup Language and Style Sheets

Orchestration vs Choreography

Areas of QA. Code Design Browser/Device Admin Interaction Strategy

Chapter 4. Capturing the Requirements. 4th Edition. Shari L. Pfleeger Joanne M. Atlee

Diploma in Software Testing (DST)

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Unified Modeling Language (UML)

Formal Specification and Verification

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

Part I: Preliminaries 24

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Łabiak G., Miczulski P. (IIE, UZ, Zielona Góra, Poland)

Interaction Testing! Chapter 15!!

XP: Planning, coding and testing. Practice Planning game. Release Planning. User stories. Annika Silvervarg

Modeling Introduction. Hani Achkar

Now you can Microsoft Visual Studio 2010 with MSDN

Advanced Software Development with MATLAB

The main website for Henrico County, henrico.us, received a complete visual and structural

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Appendix D: Mapping BPMN to BPD Profile

Working in Harmony: Integrating the efforts of usability engineers and agile software developers

IBM emessage Version 9 Release 1 February 13, User's Guide

Finite State Machines

Principles of Computer Game Design and Implementation. Lecture 23

Distributed Systems Programming (F21DS1) Formal Verification

Microsoft Office PowerPoint 2016: Part 2 (Advanced)

HP APPs v.12 Solutions for Dev-Ops

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

UML for Real-Time Overview

Petri Nets" Computer Science 520/620 Spring 2011 Prof. L. Osterweil" Software Models and Representations" Part 3" Some Semantics"

Computer Science 520/620 Spring 2011 Prof. L. Osterweil" Software Models and Representations" Part 3" Petri Nets"

Extending BPEL with transitions that can loop

3. Business Process Diagrams

Systems Analysis and Design in a Changing World, Fourth Edition


CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL

Recitation Session 6

WAY OF WORKING TRANSFORMATION TO INTEGRATED MODEL DRIVEN DEVELOPMENT (MDD) AND MODEL- BASED TESTING (MBT)

Introduction to Software Engineering. 6. Modeling Behaviour

SharePoint Development Web Development Generate from Usage. Cloud Development Windows Development Office Development

MELISSA CRADDOCK USER EXPERIENCE PRODUCT DESIGN LEAD

CTI Higher Certificate in Information Systems (Internet Development)

Dynamic reverse engineering of Java software

Incident Response Agility: Leverage the Past and Present into the Future

Modern Methods in Software Engineering. Testing.

High Availability Distributed (Micro-)services. Clemens Vasters Microsoft

Assignment 12: Commit Protocols and Replication Solution

Project title: A Multiscale Simulation-Based Design Platform for Cost-Effective CO 2 Capture Processes using Nano-Structured Materials (NanoSim)

USING TASK MODELS IN MODEL BASED TESTING

Designing Robust Classes

XP: Planning, coding and testing. Planning. Release planning. Release Planning. User stories. Release planning Step 1.

CS 577A Team 1 DCR ARB. PicShare

Object Oriented Modeling

SOFTWARE MODELING AND DESIGN. UML, Use Cases, Patterns, and. Software Architectures. Ki Cambridge UNIVERSITY PRESS. Hassan Gomaa

Software Architecture for Immersipresence

A SMIL Editor and Rendering Tool for Multimedia Synchronization and Integration

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

1Z0-560 Oracle Unified Business Process Management Suite 11g Essentials

Introduction to Embedded Systems

UML 2.0 State Machines

Course Outline. Microsoft Office 2007 Boot Camp for Managers

Accelerate your Software Delivery Lifecycle with IBM Development and Test Environment Services

USTGlobal INNOVATION INFORMATION TECHNOLOGY. Using a Test Design Tool to become a Digital Organization

Test-driven development

Master Every Stage of Your Mobile App Lifecycle: Micro Focus Mobile Center. Brochure. Application Development, Test & Delivery

Boca Raton Community High School AP Computer Science A - Syllabus 2009/10

UNIT-4 Black Box & White Box Testing

FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III. 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION

Software Engineering using Formal Methods

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

CTI Short Learning Programme in Internet Development Specialist

A Tale of Continuous Testing

EMC ACADEMIC ALLIANCE

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Microsoft PowerPoint level 1 course content (1-day)

Transcription:

Sophia Antipolis, French Riviera 20-22 October 2015 MODEL BASED TEST DESIGN AT UNITY Marek Turski, Ilya Turshatov, Tomasz Paszek Unity Technologies All rights reserved

Unity Technologies Provider of an integrated development environment for creating games and other interactive virtual content 2 All rights reserved

Unity Engine A few statistics 100 core product developers 1 million monthly active developers 45k unique titles made with Unity every month 9 million new devices reached every day 20 million new install events per day 3 All rights reserved

Unity Engine Scaling is challenging Growing team size 23 supported platforms Integrated services Player retention Cloud deployment Multiplayer Asset Store Analytics Ads 4 All rights reserved

QA Focus Manual Testing (Test Engineers) User Experience (UX Researchers) User Support Student Workers Support Engineers 5 All rights reserved

QA Focus Test Automation (Test Developers) Test Infrastructure (Toolsmiths) Test runners and frameworks Bug reporting and customer support tools Backend and Reporting Working closely with the Build Infrastructure Team 6 All rights reserved

Test Automation Focus Unit Tests Code tests, written by developers System Integration Tests Components seen as processes Sub System Runtime Tests Components seen as interfaces Test Tools Built directly into the Game Engine 7 All rights reserved

Test Automation Focus Non Functional Tests Performance/Stress/Load Deployment/Update/Security User Interface Asset Import Graphics 8 All rights reserved

Towards Agile Development Individuals and interactions over Processes and tools Working software over Comprehensive documentation Customer collaboration over Contract negotiation Responding to change over Following a plan Is Unity agile (enough)? 9 All rights reserved

Towards Agile Testing Re evaluation of skills Planning Communication Quality Assistance over Quality Assurance Toolbox Clean up Concepts Techniques Testware 10 All rights reserved

Good Requirements Specification Traditional guidelines Clarity, Completeness, Correctness, Consistency Agile User Stories Small and Independent Estimable and Testable Valuable and Negotiable As a [user role] I want to [desired feature] so that [value/benefit]. 11 All rights reserved

Good Requirements Specification Redefine Start Define a Requirement Independent? Negotiable? Start programming while I find out what they want? Valuable? Estimable? Small? Testable? Analyze all Requirements Clear? Correct? Consistent? Complete? End All rights reserved

Model Based Requirements Model Based Testing Derivation of test cases from a model of the desired system behaviour Why use models? The modelling process improves our understanding of the system under test and finds inconsistencies earlier Models become collaborative (and negotiable) test artifacts which visualize and document our view of the system 13 All rights reserved

Model Based Requirements Properties of a good model based notation Expressive Represents common process abstractions and control issues Provocative Helps with or drives the discovery of system aspects Processable Can be data mined or executed Scalable Provides means of functional or data decomposition 14 All rights reserved

Model Based Requirements Expressing Common Behaviours Sequence Structured Control Events Asynchronous events Repetition Selection Tasks Context-sensitive input events Multi-context output events Activate Task Control Event quiescence Enable / Disable Simultaneous Tasks Priority Trigger / Suspend Pause / Resume Parallel execution Mutual exclusion Deadlock 15 All rights reserved

Modelling System Requirements Views of a System Structural Behavioural Control Flow Data Flow State Transitions Structural modelling focuses on what the system is. Behavioural modelling focuses on what the system does. 16 All rights reserved

Control Flow Modelling Behavioural Control Flow Data Flow State Transitions Emphasizes De-emphasizes Flow The exact sequence of steps How inputs to a state are determined Control stream - the next step is taken when a previous step (or sequence of steps) has finished 17 All rights reserved

Flowcharts One of the earliest behavioural models Illustrates algorithms, processes and workflows Multitude of styles and symbols Start Process Decision Emphasizes De-emphasizes The exact sequence of steps How inputs to a state are determined Process Process Flow Control stream - the next step is taken when a previous step (or sequence of steps) has finished End 18 All rights reserved

Flowcharts ( ) algorithms, processes and workflows what is the difference? Divide into teams Next team Pick a card Next player Picture it Yes Can they guess it? No Team gets a point 19 All rights reserved

Flowcharts ( ) algorithms, processes and workflows what is the difference? Referee Pick a card Divide into teams Next team Next player Picture it Yes Can they guess it? No Team gets a point 20 All rights reserved

Leap Year Problem flowchart static bool IsLeapYear(int year) { return (year % 4) == 0 && ((year % 100)!= 0 (year % 400) == 0); } Yes year Divisible by 4? No Yes Divisible by 100? No No Divisible by 400? Yes True False 21 All rights reserved

Coffee Machine Problem flowchart total = 0 Insert coin 2 10 Coin is? 5 total += 2 total += 5 total += 10 Dispense coffee, return change Yes total >= 20? No 22 All rights reserved

Flowcharts Decomposition Layout Decomposition On page connectors Off page connectors A A Off-page connector Hierarchy Decomposition Predefined Process Compute leapyear False Leap Year? True 23 All rights reserved

Flowcharts Getting Started How to start? Define the process to be illustrated Find a trigger event or a trigger input List known actions, try to keep the order chronological Extending the model What could/should happen next? Are all important aspects of the process illustrated? Are all relevant actions taken into account? 24 All rights reserved

Days in a Month flowchart day, month, year? 25 All rights reserved

Days in a Month flowchart day, month, year Yes February? No 28 False Leap Year? True 29 26 All rights reserved

Days in a Month flowchart day, month, year Yes February? No 28 False Leap Year? True 29 30 Yes Month 4, 6, 9 or 11? No 31 27 All rights reserved

Turn based game flowchart Start Turn Highligh Available Locations Move Action? Attack Highligh Available Opponents Select Location Move Character Magic Spell Show Available Spells Select Opponent Attack Animation Select Spell No Opponent Eliminated? Yes Return Attack Animation Yes Opponent Adjacent? No Victory Animation No Player Eliminated? Yes Defeat Animation End Turn 28 All rights reserved

Flowcharts Processability Well formed flowcharts can be data mined by business workflow engines An executable variation of flowcharts is used by the DRAKON Visual Language Automatic layout Vertical only Unified distances and offsets Logical alignment Silhouette design style Joins and parallel actions 29 All rights reserved

Flowcharts Expressive power Structured Control Statements are the core building blocks of a flowchart Perfect for representing imperative languages Statement A Statement B True Condition Loop body Loop entry Statement C Statement False True Condition... False Sequence Selection Repetition 30 All rights reserved

Flowcharts Expressive power Other aspects of behaviour must be determined in text or deducted from the flow Mutual exclusion is represented through parallel paths after a decision, but other concurrency concepts are missing A popular extension Activity Diagrams addresses this problem by introducing new symbols Join Fork Merge Branch 31 All rights reserved

Break Time 5 minute break Q&A Flowchart design exercise (optional) 32 All rights reserved

State Transition Modelling Behavioural Control Flow Data Flow State Transitions Emphasizes De-emphasizes Flow The state space and state transition stimuli Sequencing of steps Event stream the next step is taken in response to events and the internal state of the system 33 All rights reserved

Finite State Machines A mathematical model of computation (a finite automata) Illustrate behaviour as a series of events that can occur in one or more possible states of a system S3 S1 S2 Emphasizes The state space and state transition stimuli S4 S5 De-emphasizes Sequencing of steps Flow Event stream the next step is taken in response to events and the internal state of the system S6 34 All rights reserved

Common Finite State Machines Tick S1 Green Change S2 Yellow Tick S1 Patrol Pac-Man in sight Lost Pac Man S2 Chase Respawn Change Change S3 Red S3 Base Pac Man catches up S4 Retreat Tick 35 All rights reserved

Leap Year Problem FSM class Year { bool m_isleapyear; S1 Get year } public Year(int year) { m_isleapyear = IsLeapYear(year); } No Yes S4 Divisible by 100? S2 Divisible by 4? Yes Yes No S3 False S6 True No S5 Divisible by 400? 36 All rights reserved

Day of Month Problem FSM No S1 February? Yes S8 30 Yes No S7 Month 4, 6, 9 or 11? Yes S2 Year divisible by 4? No S9 31 No S4 Year divisible by 100? Yes Yes S3 29 S6 28 No S5 Year divisible by 400? 37 All rights reserved

Day of Month Problem FSM No S1 February? Yes S6 30 Yes No S5 Month 4, 6, 9 or 11? Yes S2 Leap Year? No S7 31 S4 28 S3 29 38 All rights reserved

Coffee Machine Problem FSM S1 Total is 0 Take Coffee S5 Total is 20 S2 Total is 10 Insert 10 Insert 10 Insert 5 S3 Total is 5 Insert 10 S4 Total is 15 39 All rights reserved

Data Flow Modelling Behavioural Control Flow Data Flow State Transitions Emphasizes De-emphasizes Flow Exchange and transformation of data Sequencing of steps Data stream - the next step is taken when other steps provide its inputs 40 All rights reserved

Petri nets Graphical notation for step wise process analysis p A mathematical modelling language for the description of distributed systems supported by a well developed theory for process analysis a b q e s Emphasizes De-emphasizes Exchange and transformation of data Sequencing of steps r d Flow Data stream - the next step is taken when other steps provide its inputs f t 41 All rights reserved

Petri Net Coffee Machine Problem Looks familiar? P1 Total is 0 Take Coffee P2 Total is 10 Insert 10 Insert 10 P3 Total is 5 Insert 10 P5 Total is 20 Insert 5 P4 Total is 15 42 All rights reserved

Petri Net Traffic Light Model T1 Green Red T2 Orange T3 43 All rights reserved

Petri Net Traffic Light Model T1 Green Red T2 Orange T3 44 All rights reserved

Petri Net Traffic Light Model T1 Green Red T2 Orange T3 45 All rights reserved

Petri Net Traffic Light Model T1 Green Red T2 Orange T3 46 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 47 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 48 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 49 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 50 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 51 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 52 All rights reserved

Petri Net Two Traffic Light Model T1 T2a G1 G2 R1 T1b T2b R2 O1 O2 T1c T2c 53 All rights reserved

Petri Nets Expressive Power t1 t2 t3 Events/actions sequence t1 t2 t3 t4 Non deterministic events conflict, choice or decision t2 t3 t1 t4 t5 Concurrent executions 54 All rights reserved

Petri Nets Expressive Power t1 t1 Synchronization and Concurrency 55 All rights reserved

Summary Model Notations a b e a p q e a p q e b s b s c d f r c ~c d f r d f t t Flow Chart Petri Nets State Machines 56 All rights reserved

Summary Model Expressive Power Flowcharts Finite State Machines Petri Nets Sequence Yes Yes (unnatural) Yes (unnatural) Selection Yes Yes Yes Repetition Yes Yes Yes Activate No No Yes Enable/Disable No No Yes Trigger/Suspend No No Yes Pause/Resume No No Yes Priority No No Yes Parallel execution No No Yes Mutual execution No* No Yes Deadlock No No Yes Context sensitive input events No Yes No* Multi context output events No Yes No* Asynchronous Events No No No* Event quiescence No No No* 57 All rights reserved

Break Time 5 minute break Q&A Installing and setting up Unity (optional) 58 All rights reserved

From Models to Test Tools The built in scripting engine makes Unity easy to extend with custom tools, including test tools Integrated NUnit and Integration Test Frameworks Model Based Test Designer Uses the open source GraphWalker tool at the core (ver. 3.3) Extended Finite State Machine Intuitive workflow and notation Integrated test designer interface Builds offline tests that can be executed using the other frameworks All rights reserved

From Models to Test Tools Actions and Guards Executable annotations that allow for flexible control over path traversals through the model Shared State Represents the same system state in multiple models (contexts of the same model) The abstraction allows for hyperlink like jumps between models, where every next model can extend the represented behaviour s scope or detail level 60 All rights reserved

From Models to Test Tools Model notation Model Start State Start Actions Requirements State Shared State Key Requirements List Transition Weight Guard Actions Requirements State C State B <shared state key> : req1, req2, T BA1 T BA2 State A T AB : weight [guard] {action1; action2; } : req1, req2, State D Model M <start state> {action1; action2; } : requirement1, requirement2, 61 All rights reserved

From Models to Test Tools Model notation Model Start Actions Transition Guard Actions State C T BC [visited] {visited = false} State A State B State D Make ABC illegal - always visit D before C. Model M <State A> {var visited = false} 62 All rights reserved

From Models to Test Tools Model notation Model Start Actions Transition Guard Actions State C T BC [visited] {visited = false} State A State B State D Also, make T BA1 feedback illegal between D and C. Model M <State A> {var visited = false} 63 All rights reserved

From Models to Test Tools Model notation Model Start Actions Transition Guard Actions State C T BC [visited] {visited = false; round++} State A State B State D State E Also, add an initially disabled T BE. Model M <State A> {var visited = false; var round = 0} 64 All rights reserved

From Models to Test Tools Model notation Transition Weight State C T BC : 80 State A State B State D State E Probability (T BD ) = 50 / (80 + 50 + 10 + 15 + 1) = 32% Model M <State B> 65 All rights reserved

From Models to Test Tools Model notation State Shared State Key State C State A State F State G State B < jump > State D State E < jump > Model N Consider state E when in state B (and B when in E). Model M <State B> 66 All rights reserved

From Models to Test Tools Path generators Random Quick Random Weighted A Star State C State A State B State D What s the next step? Model M <State B> 67 All rights reserved

From Models to Test Tools Stop Conditions Coverage States Transitions Requirements Reached Target (Shared) State Transition Assertion Time Duration Path Length Composite AND/OR Tree State C State B < jump > Model M <State B> State A State D Pick at Random until Path Length = 4 AND Reached State D 68 All rights reserved

Let s see it in action! 69 All rights reserved

Thank You! Q & A 70 All rights reserved