tactic-based testing peter braun, benjamin flach, reinhard jeschull, jan philipps mbtuc 2011 |...

17
Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Upload: rocio-ballester

Post on 29-Mar-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Tactic-Based TestingPeter Braun, Benjamin Flach,Reinhard Jeschull, Jan Philipps

MBTUC 2011 | Berlin, 18-20 October 2011

Page 2: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 2Validas AG

Model-Based Testing

Search criteria

Test case generator

Behavior model

Test cases

Model determines search paths

Model provides reference values

Model returns coverage data

Page 3: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 3Validas AG

Lessons Learned

Complex data spaces and algorithms

Modeling language and tool issues

Inclusion of prior knowledge of developers

Page 4: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 4Validas AG

Tactic-Based Testing

Data model

Tactic Interpreter &

Coverage measurement

Tactics

Test cases

Oracle model

Tactic determines search paths

Coverage over tactic, data and oracle

models

Oracle model provides reference

values

Main idea: Seamless combination of model- and script-based testing

Page 5: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 5Validas AG

Tactic-Based Testing - Framework

Data model

Tactic Interpreter &

Coverage measurement

Tactics

Test cases

Oracle model

Data models based on EMF,

Java, …

Oracle models in UML, Java or JRuby. Generic interface

for other languages

Test case and coverage data output as XML

JRuby as tactic language

Page 6: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 6Validas AG

Tactic-Based Testing – Tactics Use of tactics to build up arbitrary search strategies The structure of the tactics defines the structure of the

test cases

Tactic parameters

Partial test case T Set of partial

test cases

Page 7: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 7Validas AG

Tactic Based Testing – Sample

incorrect_pins = [...] # List of 5 incorrect PINstacSelFile = step("select", {"file" => ["1C38", "69A5", "CA4B"]})tacNothing = identity();tacVerifyOnce = step("verify_chv", {"chvValue" => CORRECT_CHV})tacVerifyTwice = step("verify_chv", {"chvValue" => incorrect_pins}) >> step("verify_chv", {"chvValue" => CORRECT_PIN})tacRead = step("select", {"recNo" => [1, 3, 10], "mode" => [RecordMode::ABSOLUTE]})

# Try to read a record of a file after (in)correct/missing card holder verificationreturn tacSelFile >> (tacNothing | tacVerifyOnce | tacVerifyTwice) >> tacRead

Results in 63

generated test cases

Visualization of a tactic structure

Tactic written in JRuby

Page 8: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 8Validas AG

Validas AG‣Founded 2000

‣17 employees

‣Competences- Model-based development- (Test-) Specification- Test automation- Tool qualification- AUTOSAR

‣Customers & Partners- BMW- EADS- ESG- Giesecke & Devrient- Infineon- Audi/AEV

Page 9: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 9Validas AG

FreeRTOS – Interface Testing

Interface and robustness testing of off-the-self components

Large parameter space

Sequences of interface calls

Parameter structures

Parameter data Crash

Return code

Nontermination

Potential side effects

Functional dependencies Hardware

configuration (memory size, address layout, …)

Page 10: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 10Validas AG

FreeRTOS – Test Setup

Tactics

Oracle model

Tactic interpreter

Data model

XMLtest

cases

Code generator

Compiler

Test framework

FreeRTOS

Compiledtest cases

Test control

Test Case Generation Test Case Compilation Test Case Execution on SUT (Cortex M3)

About 1600 lines of JAVA

code

About 850 lines of JAVA

code

41 tactics

41 API-interfaces tested

30.444 test cases, 153.851 test steps

Execution time of about 7 hours

Page 11: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 11Validas AG

FreeRTOS – Test Results

Example: pvPortMalloc (232-5)– Expected result: NULL-Pointer– Observed result: Valid memory address– Reason: Integer overflow

(232 – 5) + 16 = 232 + 11 11 Header of linked list block for heap management

Crash

Nontermination

Incorrect Returncode

Correct Returncode

0 5000 10000 15000 20000 25000

5496

805

19474

7092

Page 12: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 12Validas AG

Smart Card – Command Testing

Exhaustive testing of CREATE_FILE and its parameters to create elementary files on a smart card

Complex parameters

Functional dependencies

High variability of parameter structures Configuration of the

smart card (max. file size, reserved IDs, …)

CreateEF

Command sequences

Parameter structures

Parameter data Crash

Statusword

Data

Page 13: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 13Validas AG

Create File – Test Setup

Tactics

Oracle model

Tactic interpreter

Data model

Test cases

Test results

Test executer

Report

Report generator

Smart card

About 900 lines of Ruby code (CREATE_EF and 10 supporting

commands)

EMF-based, generated JAVA code

About 1000 test cases

Execution time 7:30 minutes

Test Case Generation Test Execution on SUT Report Generation

16 tactics

Page 14: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 14Validas AG

Create File – Data Model

Generic and domain-specific data models

based on EMF

Page 15: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 15Validas AG

Create File – Test ExecutionTactics to achieve

test goals

Test reports & analysis support

Test execution environment

Page 16: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 16Validas AG

Lessons Learned

Complex data spaces and algorithms

Modeling language and tool issues

Inclusion of prior knowledge of developers

Page 17: Tactic-Based Testing Peter Braun, Benjamin Flach, Reinhard Jeschull, Jan Philipps MBTUC 2011 | Berlin, 18-20 October 2011

Page 17Validas AG

Summary Tactic-based testing for

flexible control of test case generation

Precise specification of test cases with varying parameters and structures

Applicable to wide range of test objects

CreateEF Validas AGArnulfstraße 27

80335 MünchenFon +49 (0) 89-53 88 669-0

Fax +49 (0) 89-53 88 [email protected]

Data model

Tactic Interpreter &

Coverage measurement

Tactics

Test cases

Oracle model