Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design...

34
Yaxiong Lin TestOptimal , LLC Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association (TCQAA) September 12, 2013

Transcript of Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design...

Page 1: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Yaxiong Lin

TestOptimal, LLC

Model-based TestingEffective Test Case Design

And Test Automation

Twin Cities Quality Assurance Association (TCQAA)

September 12, 2013

Page 2: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda

What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases

Testptimal LLC

Page 3: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases

Testptimal LLC

Page 4: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Business Impacts of Software Defects

Source: Crosstalk, the Journal of Defense Software Engineering

• U.S. alone: $60 billion per year (NIST 2002)

Testptimal LLC

Page 5: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Where Defects are Found

Testptimal LLC

Source Unknown

Page 6: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Costs of Fixing Software Defects

Testptimal LLC

The Real Cost of Software Defects, LKP Consulting Grouphttp://www.lkpgroup.com/Cost%20of%20Software%20Defects.pdf

Page 7: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Software Testing Challenges Requirement/design defect impact: 64% Non-developer testing catches 69% of

defects Costs 100x to fix defect in production Gain higher confidence

better test coveragerequirement traceability

Testptimal LLC

Page 8: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

What is Model-Based Testing?“Model-Based Testing is the Automation of Test Design of Black-box Tests”

Testptimal LLC

Practical Model-base Testing”, Mark Utting and Bruno Legeard

Page 9: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

What is Model-Based Testing?“Model-Based Testing is the Automation of Test Design of Black-box Tests”

Testptimal LLC

Practical Model-base Testing”, Mark Utting and Bruno Legeard

Model-based testing is application of Model based design for designing and optionally also executing artifacts to perform software testing. Models can be used to represent the desired behavior of a System Under Test (SUT), or to represent testing strategies and a test environment. wikipedia

Page 10: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Why Model?

Visual representation of complex systems Ask What-If to understand cause-effect Important role in the technology

advancement and software development Software testing is a complex task

Testptimal LLC

Page 11: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

MBT Modeling Notations Finite State Machine (FSM)

State Diagram (UML) Extended Finite State Machine (EFSM) Message Sequence Chart (MSC)

Sequence Diagram (UML) Control Flow Graph (CFG)

Activity Diagram (UML) Event Flow Diagram UML Testing Profile – UTP …

Testptimal LLC

Page 12: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Testing Vending Machine

Drink for $1 Accept Quarter and HalfDollar coins Cancel any time for refund

Testptimal LLC

Page 13: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Vending Machine Test Cases

Quarter + Quarter + Quarter + Quarter => Vend Quarter + Quarter + HalfDollar => Vend Quarter + HalfDollar + Quarter => Vend Quarter + HalfDollar + HalfDollar => Vend HalfDollar + Quarter + Quarter => Vend HalfDollar + HalfDollar => Vend HalfDollar + Quarter + HalfDollar => Vend Quarter + Cancel => Refund …

Testptimal LLC

Page 14: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Example Model

Testptimal LLC

Page 15: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Generated Test Sequence

Testptimal LLC

Page 16: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda

What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases

Testptimal LLC

Page 17: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Types of MBT

Offline Testing

Online Testing

Testptimal LLC

Page 18: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Demo:

Test Case Generation for Manual Testing or Offline Testing

Testptimal LLC

Page 19: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Demo:

Login Test Automation – Online Testing

Testptimal LLC

Page 20: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Demo:

WebStore Test Automation – Online Testing

Testptimal LLC

Page 21: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Testing Web App

Testptimal LLC

Page 22: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

WebStore MBT Model

© 2012 Testptimal LLC

Page 23: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Generated Test Sequence

Testptimal LLC

Page 24: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda

What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases

Testptimal LLC

Page 25: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Recent MBT User Surveyby Robert Binder, System Verification Associates,2012

MBT reduced escaped bugs by 59%. MBT reduced testing costs by 17%. MBT reduced testing duration by 25%.

Testptimal LLC

Page 26: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Benefits of MBT

Catch requirement / design defects Catch defects earlier Reduce defects in fields Improve efficiency (Agility)

handling changesbetter communication on defects

Gain higher confidencebetter test coveragerequirement traceability

Testptimal LLC

Page 27: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda

What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases

Testptimal LLC

Page 28: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

MBT Iterative Development Process

Testptimal LLC

Modeling

Test Generation

AutomationExecution

AnalysisMBT

Models

Requirements

User Stories

Page 29: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

MBT Process Input/Output

Testptimal LLC

Input

Requirements User Stories

Test Objectives

AUT/Spec

Environment Configuration

Execution Result

MBT Step

Modeling

Test Generation

Automation

Execution

Analysis

Output

Behavior Models

Test Strategies Test Coverage

Automation Scripts

Test Coverage Defects, Perform. Stat

Model Modification

Page 30: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Model-Based Testing Process

Testptimal LLC

http://journal.thedacs.com/issue/52/145Department of Defense (DoD) Information Analysis Center (IAC)

Page 31: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Agenda

What is Model-Based Testing (MBT) MBT in Action (demo) Benefits of MBT MBT Process MBT Use Cases (more demo)

Testptimal LLC

Page 32: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Applications of Model-Based Testing

Conformance Testing Functional Testing System Integration Testing Security Vulnerability Testing

Testptimal LLC

Page 33: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

MBT Use Cases (demo)

Finding Temporal Defects Realistic Load Simulation

PerformanceLoad/Stress Testing

Session /Scenario Based Testing Risk Based Testing Quick bug fix verification

Testptimal LLC

Page 34: Yaxiong Lin TestOptimalTestOptimal, LLC TestOptimal Model-based Testing Effective Test Case Design And Test Automation Twin Cities Quality Assurance Association.

Questions?

MBT Papers: http://testoptimal.com/MbtReferences.html

Email: [email protected]

Testptimal LLC