Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand...

27
www.all4tec.net ALL4TEC Copyright 2013 Alexis DESPEYROUX & René-Christian TUYISHIME Support And Pre-Sales Using Model-Based Testing during the life cycle of your product

Transcript of Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand...

Page 1: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Alexis DESPEYROUX & René-Christian TUYISHIME Support And Pre-Sales

Using Model-Based Testing during the life cycle of your product

Page 2: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUMMARY

Introduction

Tutorial

Conclusion

2

Page 3: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Test in V cycle

3

Page 4: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Test challenges Error correction cost

Nominal cost for errors correction

Where errors are introduced • IBM Systems Sciences Institute • Crosstalk, the Journal of Defense Software

Engineering

4

Page 5: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Some Testing issues

Test plans are written very later

Often after the system implementation

Errors detected later -> expensive correction

Maintain test cases and test scripts

Information on the requirements coverage rate

Maintain resources

Lack of communications between designers, developers and testers

Lack of processes

Projects are abandoned

Etc.

5

Page 6: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Model-Driven Engineering

D

E

S

I

G

N

T

E

S

T

Functional

Requirements

Design Model

Test Environment Test Case Test Cases

Test Scripts

Test Model

CODE

Test Case EXE

EXE

Page 7: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Design Model

Embedded system development

Abstract representation of the system based on specifications

Verification

Automatic code generation

Executable in the target environment

7

Page 8: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Model-Driven Engineering

D

E

S

I

G

N

T

E

S

T

Functional

Requirements

Design Model

EXE

Usage Model

CODE

Test Environment

Test Case EXE

Test Case Test Cases

Test Scripts

Page 9: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Usage Model

Behavior of the SUT (System Under Test)

Stimulations or actions

Verifications

Constraints (time,…)

Formal languages are used

UML, Markov chains, states charts…

Test cases generation

Test strategies

The usage model construction has to begin as soon as we have a big part of requirements

Detect and remove ambiguities early

9

Page 10: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Model-Driven Engineering

D

E

S

I

G

N

T

E

S

T

Functional

Requirements

Design Model Usage Model

CODE

Test Environment

Test Case EXE

Test Case Test Cases

Test Scripts EXE

Page 11: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Most probable approach

Start

Close

FREQUENCY FOCUS

Start

Close

Risk based Approach User Oriented - Limit

Custom Test profile

CRITICALITY, COMPLEXITY UPDATE FOCUS

Arcs coverage approach

Close

Start

REQUIREMENTS COVERAGE

Usage Test profile

Usage approach Random

Start

Close

OPERATIONAL COVERAGE

Test Strategies

11

Page 12: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Test Cases

Manual test cases

Test suite

Test generation report

Requirement coverage reports

Translation in test scripts

According to test automation tool

Executed in a Test environment

12

Requirements Coverage

Test generation report

Page 13: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUMMARY

Introduction

Tutorial

Conclusion

13

Page 14: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Used tools

MaTeLo (Markov Test Logic)

Model-Based Testing approach

Markov chains logic

14

Page 15: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

MaTeLo Usage Models

BEGINNING

END

STATE

TRANSITION

MACRO CHAIN

Setup “Transition” as “Test Step” Mapping of Requirements Configuration for Test Automation

15

Page 16: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Inputs Stimulation Equivalence Classes Timing

Verifications Points Expected Results Timing

Model Transition = Test Step

Requirements Basic Steps(Optional)

Select_Gear(5)

Accelerate(100%)

Check_Speed(185)

Transfer Function

Stimulations

16

Page 17: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

MaTeLo Ecosystem

Test Cases

TESTSTAND

EXAM

VeriStand

JUNIT

TTCN-3

… Open to ALL languages

Bench language Scripting

Test Scripts

Native

Plugin

Selenium

Python

Selenium IDE

Custom Script

17

Page 18: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Used tools

NI TestStand

Test sequencer

- Execute test sequences generated by MaTeLo

18

Page 19: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Used tools

Matlab Simulink for design models

19

Page 20: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUT: Cruise Control Simulation

20

Control command Car Model Cruise Controller

OU

TP

UT

S

INP

UT

S

Page 21: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Used tools

NI VeriStand

Real time environment

21

Page 22: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

MaTeLo NI VeriStand System Models

Simulink®

LabVIEW®

Testing methodology

Test Stand Test Script

Functional

Requirements

Add Test Cases

Implement Scenarize

Generate

Translate

Import

Run

Real-Time Testing and Simulation Software

22

Page 23: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUT requirements

Req_01:

A push on the ON button activates the cruise control and the led is switched on

Req_02:

A push on the OFF button deactivates the cruise control and the led is switched off

Req_03:

Pressing the brake pedal deactivates the cruise control and the led is switched off

Req_04:

When the cruise control is activated:

A push on the button SET imposes the current speed as the target speed

One push on the button “Inc” increases the cruise control target speed by 1km

One push on the button “Dec” decreases the cruise control target speed by 1 km

The increase or decrease of 1km must last at maximum 50 ms

Req_05:

The cruise control is effective between [30,150] Km/h

23

Page 24: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUMMARY

Live DEMO

24

Page 25: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

SUMMARY

Introduction

Tutorial

Conclusion

25

Page 26: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

Conclusion

Quantified and optimized requirements coverage

Model-Based Testing tools give requirements coverage indicators

Consolidation of functional requirements

Ambiguities in specifications are removed early

Pertinent test cases (usage profiles, risks, …)

Possibility to define usage profiles

Risks are taken into account in the generation strategies

Easy test cases maintenance

It is more easier to maintain an usage model than manual test cases

Easy test cases automation

Test effort lowered

26

Page 27: Using Model-Based Testing during the life cycle of your product · 2013-12-13 · NI VeriStand MaTeLo System Models Simulink® LabVIEW® Testing methodology Test Stand Test Script

www.all4tec.net ALL4TEC Copyright 2013

ALL4TEC

ALL4TEC Laval (HQ) FRANCE ALL4TEC Paris FRANCE ALL4TEC Munich GERMANY ALL4TEC Stockholm SWEDEN

Sales [email protected] Support http://all4tec-support.net Marketing [email protected] To discover our company and download a full trial MaTeLo evaluation (30days), visit our web site: www.all4tec.net