Model-based Testing Part 1 Prof. Dr.-Ing. Ina Schaefer SFM:ESM - - - PowerPoint PPT Presentation

model based testing part 1
SMART_READER_LITE
LIVE PREVIEW

Model-based Testing Part 1 Prof. Dr.-Ing. Ina Schaefer SFM:ESM - - - PowerPoint PPT Presentation

Platzhalter fr Bild, Bild auf Titelfolie hinter das Logo einsetzen Model-based Testing Part 1 Prof. Dr.-Ing. Ina Schaefer SFM:ESM - Bertinoro - 18 June 2014 Contents Part 1: Foundations of Testing and Model-based Testing Fundamental


slide-1
SLIDE 1

Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen

  • Prof. Dr.-Ing. Ina Schaefer – SFM:ESM - Bertinoro - 18 June 2014

Model-based Testing – Part 1

slide-2
SLIDE 2

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 2

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-3
SLIDE 3

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 3

Testing is …

[…] ¡“an ¡activity ¡performed ¡for ¡evaluating ¡product ¡quality, ¡and ¡ for ¡improving ¡it, ¡by ¡identifying ¡defects ¡and ¡problems.” […] ¡“the ¡process ¡of ¡operating ¡a ¡system ¡or ¡component ¡under ¡ specified conditions, observing or recording the results, and making an evaluation or some aspects of the system or component.”

[IEEE, 1990]

slide-4
SLIDE 4

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 4

Software Testing is …

[…] ¡“an ¡activity ¡for ¡checking ¡or ¡measuring ¡some ¡quality ¡ characteristics of an executing object by performing experiments ¡in ¡a ¡controlled ¡way ¡w.r.t. ¡a ¡specification.”

[Tretmans, 1999]

slide-5
SLIDE 5

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 5

Factors for Testing

test aims

  • functional
  • non-functional
  • robustness
  • performance
  • reliability

test methods

  • static testing:

e.g. systematic code inspections

  • dynamic testing:

e.g. experimental executions

Specification

SUT

Tester

slide-6
SLIDE 6

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 6

public { public { if(weekend) { return true; } else { return false; } } } public class foo boolean bar()

Factors for Testing

test scale

  • unit tests
  • component tests
  • integration tests
  • system tests

information base

  • black box
  • white box
  • grey box

public class foo { p boolean bar() { if(weekend) { return true; } else { return false; } } }

slide-7
SLIDE 7

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 7

Dynamic Software Testing

Specification

System under Test (SUT)

Test Case Design Test Case Execution

Tester I O

Platform Environment

slide-8
SLIDE 8

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 8

Failure, Fault, Error

failure - A failure is an undesired observable behavior of an SUT. fault – A fault in an SUT causes a failure during test execution. error – An error is a logical flaw in the implementation.

slide-9
SLIDE 9

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 9

The Notion of Software Testing used in this Lecture

Software testing consists of the dynamic validation/verification of the behavior of a program on a finite set of test cases suitably selected from the usually infinite input domain against the expected behavior.

slide-10
SLIDE 10

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 10

Some Literature on Software Testing

  • Myers, G.J.: The Art of Software Testing. Wiley, New York
  • Beizer, B.: Software Testing Techniques. Van Nostrand Reinhold

Co.

  • Broy; M. (ed.): Model-Based Testing of Reactive Systems:

Advanced Lectures. Springer, Berlin Heidelberg

  • IEEE: Standard Glossary of Software Engineering Technology

610.121990

  • IEEE: Standard for Software Test Documentation Std. 829-2008
  • van Veenendaal, E. (ed.): ISTQB Glossary of Testing Terms 2.2.

Glossary Working Party

slide-11
SLIDE 11

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 11

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-12
SLIDE 12

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 12

Model-Based Testing

Specification

SUT

Test Case Design Test Case Execution

Tester I O

Platform Environment

slide-13
SLIDE 13

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 13

Model-Based Testing

test model

SUT

test execution I O

Platform Environment

model-based test generation

system model

pass/fail

slide-14
SLIDE 14

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 14

Model-based Testing

Model-based testing is the automation of black box tests.

test model

SUT

test execution I O

Platform Environment

model-based test generation

system model

pass/fail

centered around test model

blackbox

basis for test case selection and coverage measure abstract test case selection

dynamic observations result verdict w.r.t. expected behavior

test case concretization

slide-15
SLIDE 15

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 15

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-16
SLIDE 16

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 16

implementation relation: 𝒋 ≃ 𝒕 with implemetation i and formal behavioral specification s preorder relation: 𝒋 ⊑ 𝒕 implementation shows at most the behaviors of the specification intentional conformance: 𝒋 ¡𝒅𝒑𝒐𝒈𝒑𝒔𝒏𝒕 ¡𝒕 ∶⇔ ¡ 𝒋 ⊆ 𝒕 where ⋅ ¡defines sets of all observable behaviors extensional conformance: 𝒋 ¡𝒅𝒑𝒐𝒈𝒑𝒔𝒏𝒕 ¡𝒕 ∶⇔ ∀𝒗 ∈ 𝓥 ∶ 𝒑𝒄𝒕 𝒗, 𝒋 ≈ 𝒑𝒄𝒕(𝒗, 𝒕) where 𝒱 defines sets of all observers

MBT from a Theoretical Point of View

slide-17
SLIDE 17

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 17

Model-based I/O Conformance Testing

  • Proposed by Jan Tretman in ¡the ¡90’s
  • Model-based functional conformance testing of

systems with reactive, non-deterministic behaviors

  • Input, output, and quiescence based testing theory
  • Based on I/O labeled transition systems

as test models AND implementation models

  • Proven sound and exhaustive
  • Rich tool support
  • Formal basis for many advanced testing frameworks
slide-18
SLIDE 18

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 18

Running Example

Beverage vending machine

  • Input actions
  • 𝐽 = 1€, 2€
  • Transitions ¡labels ¡prefixed ¡with ¡“?”
  • Output actions
  • 𝑉 = {𝑑𝑝𝑔𝑔𝑓𝑓, 𝑢𝑓𝑏}
  • Transition ¡labels ¡prefixed ¡with ¡“!”
slide-19
SLIDE 19

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 19

I/O-Labeled Transition Systems

I/O Labeled Transitionsystem: 𝑹, 𝒓𝟏, 𝑱, 𝑽, → , where

  • 𝑹 is a countable set of states,
  • 𝒓𝟏 ∈ 𝑹 is the initial state,
  • 𝑱 and 𝑽 are disjoint sets of input actions and output actions, and
  • → ¡⊆ 𝑹 × 𝒃𝒅𝒖 × 𝑹 ¡is a labeled transition relation.
slide-20
SLIDE 20

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 20

LTS - Examples

𝑈𝑠 𝑟 = {? 1€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 1€ ⋅ ! 𝑢𝑓𝑏} 𝑈𝑠 𝑟 = ? 1€, ? 2€

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 ? ¡1€ ? 2€ 𝑟

slide-21
SLIDE 21

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 21

Each compution refers to some path

LTS Trace Semantics

𝑟

𝑡 𝑡 ⋅⋅⋅ 𝑡 𝑡

The behavior of a computation is defined by a trace 𝑢𝑠𝑏𝑑𝑓 ¡𝜏 = 𝜈𝜈 ⋅⋅⋅ 𝜈 ∈ 𝑏𝑑𝑢∗

slide-22
SLIDE 22

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 22

LTS - Examples

𝑈𝑠 𝑟 = ? 1€, ? 2€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 2€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑈𝑠 𝑟 = ? 1€, ? 2€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 1€ ⋅ ! 𝑢𝑓𝑏, ? 2€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 2€ ⋅ ! 𝑢𝑓𝑏

? ¡1€ ? 2€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 ? ¡1€ ? 2€ 𝜐 ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 𝜐

slide-23
SLIDE 23

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 23

LTS Trace Notations

Let s be an I/O 𝓜𝓤𝓣, 𝝂𝒋 ∈ 𝑱 ¡ ∪ 𝑽 ∪ 𝝊 and 𝒃𝒋 ∈ 𝑱 ∪ 𝑽 ¡

𝑡

⋅⋅⋅ 𝑡 ≔ ¡∃𝑡, … , 𝑡 ∶ 𝑡 = 𝑡 𝑡 ⋅⋅⋅ 𝑡 = 𝑡

𝑡

⋅⋅⋅ ≔ ¡∃𝑡′ ∶ 𝑡 = 𝑡 ⋅⋅⋅ 𝑡

¬𝑡

⋅⋅⋅ ¡≔ ∄𝑡 ∶ 𝑡 ⋅⋅⋅ 𝑡′

𝑡 𝑡 𝑡

… .

slide-24
SLIDE 24

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 24

LTS Trace Notations

Let s be an I/O 𝓜𝓤𝓣, 𝝂𝒋 ∈ 𝑱 ¡ ∪ 𝑽 ∪ 𝝊 and 𝒃𝒋 ∈ 𝑱 ∪ 𝑽 ¡

𝑡

  • ⇒ 𝑡 ≔ 𝑡 = 𝑡𝑝𝑠 ¡𝑡

⋅⋅⋅ 𝑡

𝑡

  • ⇒ 𝑡 ≔ ¡∃𝑡, 𝑡 ∶ 𝑡
  • ⇒ 𝑡
  • → 𝑡
  • ⇒ 𝑡

𝑡

⋅⋅⋅ 𝑡 ≔ ¡∃𝑡, … , 𝑡 ∶ 𝑡 = 𝑡

  • ⇒ 𝑡
  • ⇒ …

𝑡 = 𝑡

slide-25
SLIDE 25

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 25

Let ¡s ¡be ¡an ¡I/O ¡𝓜𝓤𝓣, ¡𝝉 ∈ 𝑱 ∪ 𝑽 ∗

𝑡

  • ⇒ ≔ ∃𝑡: = ∃𝑡: ¡𝑡
  • ⇒ 𝑡

¬𝑡

  • ⇒ ≔ ¡∄𝑡 ¡′: 𝑡
  • ⇒ 𝑡

LTS Trace Notations

slide-26
SLIDE 26

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 26

LTS Trace Notations

The set of traces in an ℒ𝒰𝒯 is defined as

𝑈𝑠 𝑡 ≔ 𝜏 ∈ 𝐽 ∪ 𝑉 ∗ ∃𝑡 ∈ 𝑅 ∶ 𝑟

  • ⇒ 𝑡′}.
slide-27
SLIDE 27

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 27

LTS - Examples

𝑈𝑠 𝑟 = ? 1€, ? 2€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 2€ ⋅ ! 𝑢𝑓𝑏 𝑈𝑠 𝑟 = ? 1€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 ? ¡1€ ? 2€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟

slide-28
SLIDE 28

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 28

LTS - Examples

𝑈𝑠 𝑟 = ? 1€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑈𝑠 𝑟 = {}

? ¡1€ ? 1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 𝑟

slide-29
SLIDE 29

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 29

Input-Enabled Transition Systems

An ℒ𝒰𝒯 is (weak) input-enabled iff for every state 𝑡 ∈ 𝑅 with 𝑟 ⇒∗ 𝑡 and for all 𝑏 ∈ I ¡ it holds that 𝑡

  • ⇒.
slide-30
SLIDE 30

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 30

Input Completion - Example

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 ?2€ ?1€, ?2€ ?1€, ?2€ ?1€, ?2€ ? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟

Input-enabled LTS Not input-enabled LTS

slide-31
SLIDE 31

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 31

A First Attempt: Conformance as Trace Inclusion

𝑗 ¡𝒅𝒑𝒐𝒈𝒑𝒔𝒏𝒕 ¡𝑡 ∶⇔ 𝑈𝑠 𝑗 ¡⊆ 𝑈𝑠 𝑡

  • Fails to refuse trivial implementations
  • Fails to take the asymetric nature of ℒ𝒰𝒯 traces with I/O actions into account

𝑟

Solution: explicit notion of quiescent behavior Solution: distinguish input and output behaviors in traces

slide-32
SLIDE 32

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 32

Some Auxiliary Definitions: Init Sets

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗. 𝑗𝑜𝑗𝑢 𝑞 ≔ 𝜈 ∈ 𝐽 ∪ 𝑉 𝑞

  • →}

𝑞 𝑞 𝑞 𝑞

𝑗𝑜𝑗𝑢 𝑞 ≔ ? 1€ 𝑗𝑜𝑗𝑢 𝑞 ≔ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ! 𝑢𝑓𝑏 𝑗𝑜𝑗𝑢 𝑞 ≔ 𝑗𝑜𝑗𝑢 𝑞 ≔

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏

slide-33
SLIDE 33

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 33

Some Auxiliary Definitions: Quiescent States

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗. 𝑞 ¡𝑗𝑡 ¡𝒓𝒗𝒋𝒇𝒕𝒅𝒇𝒐𝒖, 𝑒𝑓𝑜𝑝𝑢𝑓𝑒 ¡𝜀 𝑞 , 𝑗𝑔𝑔 ¡𝑗𝑜𝑗𝑢 𝑞 ⊆ 𝐽

𝑞 𝑞 𝑞 𝑞

𝑗𝑜𝑗𝑢 𝑞 ≔ ? 1€ 𝑗𝑜𝑗𝑢 𝑞 ≔ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ! 𝑢𝑓𝑏 𝑗𝑜𝑗𝑢 𝑞 ≔ 𝑗𝑜𝑗𝑢 𝑞 ≔

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏

𝐽 = ? 1€, ? 2€

δ δ δ

slide-34
SLIDE 34

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 34

Some Auxiliary Definitions: After Sets

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗. 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ≔ 𝑟 ∈ 𝑉 ¡ ¡𝑞 ¡

  • ⇒ 𝑟}

𝑞 𝑞 𝑞 𝑞

𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑑𝑝𝑔𝑔𝑓𝑓 = 𝑞 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑢𝑓𝑏 = 𝑞 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡? 2€ = 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑢𝑓𝑏 =

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏

𝑉 = ! 𝑑𝑝𝑔𝑔𝑓𝑓, ! 𝑢𝑓𝑏

δ δ δ

slide-35
SLIDE 35

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 35

Some Auxiliary Definitions: Out Sets

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗. 𝑝𝑣𝑢 𝑄 ≔ 𝜈 ∈ 𝑉 ¡ ∃𝑞 ∈ 𝑄 ∶ 𝑞 ¡

  • →} ∪ {𝜀 ¡| ¡∃𝑞 ∈ 𝑄 ∶ 𝜀 𝑞 }

𝑞 𝑞 𝑞 ? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 δ δ δ

𝑄 = 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 𝑄

= {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞

𝑄 = {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑢𝑓𝑏, 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑑𝑝𝑔𝑔𝑓𝑓} = 𝑞, 𝑞 𝑄 = {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞 𝑄

= {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞

slide-36
SLIDE 36

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 36

Some Auxiliary Definitions: After-Out Sets

𝑞 𝑞 𝑞 ? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 δ δ δ

𝑄

= {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞

𝑄 = {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑢𝑓𝑏, 𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡! 𝑑𝑝𝑔𝑔𝑓𝑓} = 𝑞, 𝑞 𝑄 = {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞 𝑄

= {𝑞 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜀} = 𝑞

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗. 𝑝𝑣𝑢 𝑄 ≔ 𝜈 ∈ 𝑉 ¡ ∃𝑞 ∈ 𝑄 ∶ 𝑞 ¡

  • →} ∪ {𝜀 ¡| ¡∃𝑞 ∈ 𝑄 ∶ 𝜀 𝑞 }

𝑃𝑣𝑢(𝑄

) = 𝜀

𝑃𝑣𝑢(𝑄) = {! 𝑢𝑓𝑏, ! 𝑑𝑝𝑔𝑔𝑓𝑓} 𝑃𝑣𝑢(𝑄) = {𝜀} 𝑃𝑣𝑢(𝑄

) = {𝜀}

slide-37
SLIDE 37

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 37

Some Auxiliary Definitions: Suspension Traces

𝑀𝑓𝑢 ¡𝑡 ¡𝑐𝑓 ¡𝑏𝑜 ¡ℒ𝒰𝒯, 𝑞 ∈ 𝑅, 𝑄 ⊆ 𝑅 ¡𝑏𝑜𝑒 ¡𝜏 ∈ 𝐽 ∪ 𝑉 ∗.

𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑞 ≔ 𝜏 ∈ (𝐽 ∪ U ∪ {𝜀} ∗| ¡𝑞

  • ⇒} ¡ ¡𝑥ℎ𝑓𝑠𝑓 ¡𝑟
  • → 𝑟 ¡𝑗𝑔𝑔 ¡𝜀(𝑞)

𝑞 𝑞 𝑞 𝑞 ? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 δ δ δ

𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑞 = {𝜀, ? 1€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 1€ ⋅ ! 𝑢𝑓𝑏, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ⋅ 𝜀, ? 1€ ⋅ ! 𝑢𝑓𝑏 ⋅ 𝜀} 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑞 = {! 𝑑𝑝𝑔𝑔𝑓𝑓, ! 𝑢𝑓𝑏, ! 𝑑𝑝𝑔𝑔𝑓𝑓 ⋅ 𝜀, 𝑢𝑓𝑏 ⋅ 𝜀} 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑞 = 𝜀 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑞 = {𝜀}

slide-38
SLIDE 38

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 38

Quiescent Behaviors

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟

Trace 𝑈𝑠 𝑟

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 δ δ δ

𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑟 = 𝜀, ? 1€, 𝜀 ⋅? 1€, ? 1€ ⋅ ! 𝑑𝑝𝑔𝑔𝑓𝑓, ? 1€ ⋅ ! coffee ⋅ 𝜀, … ¡ Allows to discriminate (non-)behaviors

  • ? 1€ ⋅ 𝜀 ∉ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑟 , 𝑥ℎ𝑓𝑠𝑓𝑏𝑡 ¡? 1€ ⋅ 𝜀 ∈ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑟

add delta transitions

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 ? ¡1€ ? 1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟

slide-39
SLIDE 39

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 39

Second Attempt: I/O Conformance (IOR) 𝑀𝑓𝑢 ¡𝑡 ∈ ℒ𝒰𝒯 𝐽 ∪ U ¡𝑏𝑜𝑒 ¡𝑗 ∈ 𝒦𝒫𝒰𝒯 𝐽, 𝑉 .

𝑗 ¡𝒋𝒑𝒔 ¡𝑡 ¡ ⟺ ¡∀𝜏 ∈ 𝑏𝑑𝑢

∗ ∶ 𝑝𝑣𝑢 𝑗 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ⊆ 𝑝𝑣𝑢(𝑡 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏)

𝑗 ¡𝒋𝒑𝒔 ¡𝑡 ¡ ⟺ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑗) ⊆ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑡)

Subclass of input-enabled I/O LTS Class of I/O LTS labeled over I and U

slide-40
SLIDE 40

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 40

Example

  • Assume δ-transitions in the ¡ℒ𝒰𝒯 ¡example
  • Possible environmental stimulations are 𝜏 = ¡? 1€ and 𝜏′ = ¡? 2€
  • Investigate the observable behavior
slide-41
SLIDE 41

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 41

Example

  • ut q ¡after ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓, 𝑢𝑓𝑏 , 𝑝𝑣𝑢 𝑟𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = {}

𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓, 𝑢𝑓𝑏 , 𝑝𝑣𝑢 𝑟𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓, 𝑢𝑓𝑏

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 ? ¡1€ ? 2€ 𝜐 ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 𝜐 δ δ δ δ

slide-42
SLIDE 42

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 42

Example

𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓}, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = {𝑑𝑝𝑔𝑔𝑓𝑓 𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓}, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = {𝑢𝑓𝑏

? ¡1€ ? 2€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 ? ¡1€ ? 2€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 δ δ δ δ δ

slide-43
SLIDE 43

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 43

Example

𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝜀}, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = {𝜀 𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓}, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = {

? ¡1€ ? 2€ 𝑟 ? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 δ δ δ δ

slide-44
SLIDE 44

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 44

Example

𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = 𝑑𝑝𝑔𝑔𝑓𝑓, 𝜀}, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = { 𝑝𝑣𝑢 𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏 = }, 𝑝𝑣𝑢(𝑟 ¡𝑏𝑔𝑢𝑓𝑠 ¡𝜏) = {

? ¡1€ ? 1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟 𝑟 δ δ δ δ

slide-45
SLIDE 45

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 45

Second Attempt: I/O Conformance (IOR) 𝑀𝑓𝑢 ¡𝑡 ∈ ℒ𝒰𝒯 𝐽 ∪ U ¡𝑏𝑜𝑒 ¡𝑗 ∈ 𝒦𝒫𝒰𝒯 𝐽, 𝑉 .

𝑗 ¡𝒋𝒑𝒔 ¡𝑡 ¡ ⟺ ¡∀𝜏 ∈ 𝑏𝑑𝑢

∗ ∶ 𝑝𝑣𝑢 𝑗 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ⊆ 𝑝𝑣𝑢(𝑡 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏)

𝑗 ¡𝒋𝒑𝒔 ¡𝑡 ¡ ⟺ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑗) ⊆ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑡)

Problem: this is quite a lot!

slide-46
SLIDE 46

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 46

𝑀𝑓𝑢 ¡𝑡 ∈ ℒ𝒰𝒯 𝐽 ∪ U ¡𝑏𝑜𝑒 ¡𝑗 ∈ ℐ𝒫𝒰𝒯 𝐽, 𝑉 .

𝑗 ¡𝒋𝒑𝒅𝒑 ¡𝑡 ¡ ⟺ ¡∀𝜏 ∈ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑡) ∶ 𝑝𝑣𝑢 𝑗 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ⊆ 𝑝𝑣𝑢(𝑡 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏) 𝒋𝒑𝒔 ¡ ⊂ 𝒋𝒑𝒅𝒑

Third Attempt: IOCO

Focus on specified behaviors only

slide-47
SLIDE 47

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 47

Example [Tretmans, 1999]

?but ! 𝑚𝑗𝑟 ?but ?but ?but ?but ?but ?but ! 𝑑ℎ𝑝𝑑 ?but ! 𝑚𝑗𝑟 ?but ?but ?but ?but ?but ?but ?but ! 𝑚𝑗𝑟 ?but

¬i𝑝𝑑𝑝 i𝑝𝑑𝑝

slide-48
SLIDE 48

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 48

𝑀𝑓𝑢 ¡𝑡 ∈ ℒ𝒰𝒯 𝐽 ∪ U ¡𝑏𝑜𝑒 ¡𝑗 ∈ ℐ𝒫𝒰𝒯 𝐽, 𝑉 .

𝑗 ¡𝒋𝒑𝒅𝒑 ¡𝑡 ¡ ⟺ ¡∀𝜏 ∈ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡(𝑡) ∶ 𝑝𝑣𝑢 𝑗 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ⊆ 𝑝𝑣𝑢(𝑡 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏) 𝒋𝒑𝒔 ¡ ⊂ 𝒋𝒑𝒅𝒑

Third Attempt: IOCO

Still infinite in case of loops

slide-49
SLIDE 49

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 49

IOCOℱ

  • The set of suspension traces under consideration is restricted to sub sets ¡ℱ ⊆ 𝑏𝑑𝑢

  • The restricted ioco relation is denoted as

𝑗 ¡𝒋𝒑𝒅𝒑ℱ ¡s ∶⇔ ∀𝜏 ∈ ¡ℱ ∶ 𝑝𝑣𝑢 𝑗 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏 ⊆ 𝑝𝑣𝑢(𝑡 ¡𝒃𝒈𝒖𝒇𝒔 ¡𝜏) ,

where 𝒋𝒑𝒔 = 𝒋𝒑𝒅𝒑

∗ and 𝒋𝒑𝒔 = 𝒋𝒑𝒅𝒑() holds.

This is still an intentional characterization of

  • conformance. How to

prove this by testing?

slide-50
SLIDE 50

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 50

Extensional IOCO

𝑗 ¡𝒒𝒃𝒕𝒕𝒇𝒕 ¡𝑢 ∶⟺ 𝑝𝑐𝑡 𝑗, 𝑢 ≈ 𝑝𝑐𝑡(𝑡, 𝑢)

Observers (testers) are characterized by a finite sets of test cases they perform on an SUT

slide-51
SLIDE 51

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 51

Test Cases

A test case t is an I/O labeled ℒ𝒰𝒯 ¡such that

  • t is deterministic and has a finite set of traces,
  • Q contains terminal states pa

pass and fai ail with 𝑗𝑜𝑗𝑢(𝒒𝒃𝒕𝒕) = 𝑗𝑜𝑗𝑢(𝒈𝒃𝒋𝒎) = ∅ ¡,

  • for each non-terminal state 𝑟 ∈ Q either
  • 1. 𝑗𝑜𝑗𝑢 𝑟 = {𝑏} for 𝑏 ∈ 𝐽 or
  • 2. 𝑗𝑜𝑗𝑢 𝑟 = ¡𝑉 ∪ ¡{𝜄}

holds. By 𝒰ℰ𝒯𝒰 we denote the subclass of I/O labeled ℒ𝒰𝒯 representing valid test cases t

denotes observation of quiescence

slide-52
SLIDE 52

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 52

Example

Test case for specification 𝑟 Stimulated input

  • !1€

Expected output

  • either coffee
  • r tea

Observable errors

  • No output occurs: Θ

¡

? ¡1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 ! 𝑢𝑓𝑏 𝑟 𝑢 ! ¡1€ ? 𝑑𝑝𝑔𝑔𝑓𝑓 pass ? 𝑢𝑓𝑏 pass θ fail

slide-53
SLIDE 53

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 53

Test case for specification 𝑟 Stimulated input

  • !1€

Expected output

  • coffee
  • no output: Θ

Observable errors

  • tea

¡

Example

𝑢 ! ¡1€ ? 𝑑𝑝𝑔𝑔𝑓𝑓 pass ? 𝑢𝑓𝑏 fail θ pass ? ¡1€ ? 1€ ! 𝑑𝑝𝑔𝑔𝑓𝑓 𝑟

slide-54
SLIDE 54

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 54

IOCO is correct = sound + exhaustive

Let 𝑡 ∈ ℒ𝒰𝒯 𝐽 ∪ 𝑉 , 𝑗 ∈ ℐ𝒫𝒰𝒯(𝐽 ∪ U) and ℱ ⊆ 𝑇𝑢𝑠𝑏𝑑𝑓𝑡 𝑡 Then it holds that

  • 1. the set 𝒰ℰ𝒯𝒰 of all derivable test cases is sound and
  • 2. the set 𝒰ℰ𝒯𝒰 of all derivable test cases is exhaustive.
slide-55
SLIDE 55

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 55

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-56
SLIDE 56

June 18th, 2014 | Ina Schaefer | Model-based Testing – Part 1 | Seite 56

Some Further Readings

  • Van der Bijn, M.,Rensink, A., Tretmans, J.: Compositional Testing with IOCO, FATES‘04. ¡
  • vol. 2931, pp. 86-100, Springer, 2004
  • Schmaltz, J., Tretmans, J.: On Conformance Testing for Timed Systems.

FMORMATS‘08. ¡vol. ¡5215, ¡pp. ¡250-164, Springer, 2012

  • Van Osch, M.: Hybrid Input-output Conformance and Test Generation. ¡FATES‘06. ¡vol. ¡

4262, pp. 70-84, Springer, 2006

  • ….
slide-57
SLIDE 57

Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen

Model-based Testing – Part 2

  • Prof. Dr.-Ing. Ina Schaefer – SFM:ESM - Bertinoro - 18 June 2014
slide-58
SLIDE 58

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 2

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-59
SLIDE 59

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 11

Challenges of Testing variant-rich Software Systems

Observations:

  • Complex systems with many interacting functions and features
  • Many system variants and versions
  • Large rate of changes, in particular in agile development

processes Consequences:

  • Increasing testing effort
  • Combinatorial explosion during integration and system testing
  • Complete re-test in case of changes mostly infeasible
slide-60
SLIDE 60

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 12

Describing and Managing Variant-rich Systems

slide-61
SLIDE 61

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 13

Describing and Managing variant-rich Systems

  • Variant-rich systems can be described as Software Product Lines.
  • SPLs are systems, which have commonalities and variabilities between each other.
  • A SPL consists of several features which are either mandatory or optional.
  • There can be further constraints between features
  • Feature A excludes feature B
  • Feature A requires feature B
  • Feature A OR feature B has to be selected
  • How to describe and manage these features and there connections?
slide-62
SLIDE 62

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 14

Feature Models

  • Kang et al. [Kang90] introduced Feature-Models as possibility to represent SPLs
  • FMs are tree-structures, which represent features and their dependencies
slide-63
SLIDE 63

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 15

Feature Interactions

  • A feature is a customer-visible product characteristic.
  • Each feature in isolation satisfies its specification.
  • If features are combined, the single specifications are
  • violated. There are unwanted side effects.

Feature Interaction!

slide-64
SLIDE 64

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 16

Example: Combine Fire and Water Alarms

If there is fire, start sprinkling system. If there is water, cut the main water line.

slide-65
SLIDE 65

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 17

Reasons for Feature Interactions

Intended Feature Interactions:

  • Communication via shared variables: one feature writes, another

feature reads values. Unintended Feature Interactions:

  • Non-synchronized write access to shared resources, such as

actuators, memory, shared variables, status flags In general, uncritical:

  • Shared read access to resources, e.g., sensors
slide-66
SLIDE 66

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 18

SPL Testing Strategies

slide-67
SLIDE 67

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 19

Software Product Line Testing

slide-68
SLIDE 68

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 20

SPL Testing Strategies

Sample-based SPL testing

  • Selection of representative subsets from a large set of possible

variants Regression-based SPL Testing:

  • Reuse test cases and test results in order to efficiently test the

selected variants Family-based SPL Testing:

  • Derive test suite from a 150%-SPL test model
slide-69
SLIDE 69

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 21

Sample-based SPL Testing

slide-70
SLIDE 70

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 22

Process of Sample-based SPL Testing

  • Problem: Number of test cases growths exponentially
  • Solution: Combinatorial Interaction Testing (CIT)

1. Create Feature Model 2. Generate a subset of variants based on the FM, covering relevant combinations of features 3. Apply single system testing to the selected variants

  • Efficiency of t-wise Covering Arrays (CA)
  • 1-wise CA: 50% of all errors
  • 2-wise CA: 75% of all errors

Trade-Off

  • 3-wise CA: 95% of all errors
slide-71
SLIDE 71

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 23

Set Covering Problem and CAs

  • S = {a,b,c,d,e}

SPL features

  • M = {{a,b,c}, {b,d}, {c,d}, {d,e}}

valid product configurations

  • What is the optimal Covering Array?
  • Solution: L = M1 + M4

minimal CA

  • Precondition: All valid product configurations already known
  • SAT-problem, which is NP-complete
  • Fortunately, we deal with realistic FMs
  • Foundation of pairwise testing
slide-72
SLIDE 72

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 24

First Solution by Chvátal (1979)

  • Idea of the algorithm:

1. = Ø 2. = Ø, , 1, 2, … , . , # 3. 4. 2

  • Worst Case:

contains only subsets with different elements

  • Best solution not guaranteed
  • Adaptation for pairwise CA generation is easy!
slide-73
SLIDE 73

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 25

Adaptation to FMs and Improvements by the ICPL

  • Adaptation is still slow in computation!
  • (Selected) Improvements

Finding core and dead features quickly Early identification of invalid t-sets Parallelization and several more

slide-74
SLIDE 74

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 26

Vending Machine and ICPL runtimes

  • VM has 12 valid variants
  • t = 2, ICPL calculates CA of size 6
  • 50% testing time saved
  • ICPL can handle large-scale SPLs
  • 2-wise with „normal“ hardware possible
  • Easily over 90% variant reduction
  • Even with ICPL: Calculation time can

be several hours

slide-75
SLIDE 75

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 27

Feature Annotations for More Efficient Combinatorics

  • Annotate features with shared resources, communication links, testing priorities
  • Use additional information for combinatorial testing
  • Consequence: Even lesser variants to test and shorter computation time

Kowal, M., Schulze, S., Schaefer, I.: Towards Efficient SPL Testing by Variant Reduction. In: VariComp. pp. 1–6. ACM (2013)

slide-76
SLIDE 76

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 28

Regression-based SPL Testing

slide-77
SLIDE 77

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 29

Model-based Testing - Procedure

Coverage Criterion: e.g., all transitions Test Model Test Goals

slide-78
SLIDE 78

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 30

Model-based Testing – Procedure (2)

Test Case Generation Test Suite Test Plan Test Selection

slide-79
SLIDE 79

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 31

Institut für Softwaretechnik und Fahrzeuginformatik

Incremental Model-based Testing

T est Model TM T est Goals TG T est Suite TS T est Plan TP T est Model TM’ T est Goals TG’ T est Suite TS’ T est Plan TP’

Evolution/Variation

slide-80
SLIDE 80

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 32

Institut für Softwaretechnik und Fahrzeuginformatik

Delta-Modeling of Variant-Rich Systems

  • Modifications of Core Product.
  • Application conditions over product features.
  • Partial ordering for conflict resolution.

[...] Core Product Product Delta1 Product Deltan

  • Product for valid

feature configuration.

  • Developed with

Standard T echniques

slide-81
SLIDE 81

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 33

Delta-Modeling - Background

Instances of Delta-Languages:

  • Software architectures (Delta-MontiArc)
  • Programming languages (Delta-Java)
  • Modeling languages (Delta-Simulink, Delta-State Machines, Deltarx)

Advantages of Delta-Modeling:

  • Modular and flexible description of change
  • Intuitively understandable and well-structured
  • Traceability of changes and extensions
  • Support for proactive, reactive and extractive SPLE
slide-82
SLIDE 82

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 34

Delta-oriented Testing approaches

  • Based on delta languages and modeling techniques, different testing approaches can be

defined [Lity13]

  • Goal: Reduce regression testing effort by only testing differences between products and

not every product as a whole

  • Deltas on variable test-models:
  • Statemachines
  • Architectures
  • Activity Diagrams
  • Deltas on requirements in natural language
slide-83
SLIDE 83

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 35

Delta-oriented Test Models (Examples)

Adding a state to a State Machine: Changing the transition labels:

slide-84
SLIDE 84

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 36

Delta-oriented Test Modeling

slide-85
SLIDE 85

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 37

Institut für Softwaretechnik und Fahrzeuginformatik

Classification of Test Cases by Delta-Analysis

Test cases Vn Test cases V2 Test cases V1

Retest V2

Variant 1 Variant 2 Variant n

[…] Invalid V2

slide-86
SLIDE 86

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 38

Delta Testing - Procedure

  • 0. Fully test first product variant
  • 1. Generate test cases for subsequent variants
  • Still valid and reuseable test cases?
  • Invalid test cases?
  • New test cases?
  • 1. Selection of test cases by delta analysis:
  • Always test new test cases
  • Select subset of reuseable test cases for re-test
  • 2. Optionally minimize resulting test suite by redundancy elimination
slide-87
SLIDE 87

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 39

Institut für Softwaretechnik und Fahrzeuginformatik

Delta-Testing Strategy

Core Product Variant 1 Variant 2 Variant 3 Variant 4

slide-88
SLIDE 88

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 40

Case Study – Body Comfort System 2

28 Features, 11616 Product Variants, 1 Core Product, 40 Deltas 16 Products for Pair-Wise Feature Coverage

For more information see [BCS12]

slide-89
SLIDE 89

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 41

Case Study BCM 2 – Delta-Testing Results

slide-90
SLIDE 90

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 42

Case Study BCM 2 – Delta-Testing Results (2)

slide-91
SLIDE 91

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 43

Requirements-Based Delta-oriented Testing

slide-92
SLIDE 92

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 45

Possible Strategies for Re-Test Selection

  • Manually by test engineer
  • (Semi-)Automatical classification of test cases into variants
  • Formulation of requirements in delta-sets with linking of test

cases to requirements

  • Model-based impact analysis of changes by delta analysis
slide-93
SLIDE 93

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 46

Contents

Part 1: Foundations of Testing and Model-based Testing

  • Fundamental Notions and Concepts of Software Testing
  • Model-based Testing
  • A Theoretical Perspective on Model-based Testing

Part 2: Model-based Testing of Software Product Lines

  • Sample-based Software Product Line Testing
  • Regression-based Software Product Line Testing
  • Variability-Aware Software Product Line Testing
slide-94
SLIDE 94

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 47

Software Product Line Testing

150% SPL specification 150% SPL implementation

slide-95
SLIDE 95

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 48

Meaning of Specifications

Implementation freedom in single system IOCO testing

  • The implementation must show at least one

specified output behavior for specified input behaviors

  • The implementation may show arbritrary output behaviors

for unspecified input behaviors Implementation variability in SPL IOCO testing

  • Distinction between mandatory and possible

input/ouput behaviors

  • SPL specification with explicit transition modality

? 1€ ! !

slide-96
SLIDE 96

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 49

Modal I/O Transition Systems

may transition must transition

slide-97
SLIDE 97

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 2

Institut für Softwaretechnik und Fahrzeuginformatik

Contents

Part 1: Foundations of Testing and Model-based Testing ! Fundamental Notions and Concepts of Software Testing ! Model-based Testing ! A Theoretical Perspective on Model-based Testing Part 2: Model-based Testing of Software Product Lines ! Sample-based Software Product Line Testing ! Regression-based Software Product Line Testing ! Variability-Aware Software Product Line Testing

slide-98
SLIDE 98

18 June 2014 | Ina Schaefer | Model-based Testing – Part 2 | Slide 70

Literature

  • [BCS12] - S. Lity, R. Lachmann, M. Lochau, I. Schaefer: Delta-oriented Software Product

Line Test Models - The Body Comfort System Case Study, Technische Universität Braunschweig, 2012

  • [Kang90] - Kyo C. Kang, Sholom G. Cohen, James A. Hess, William E. Novak, A.

Spencer Peterson - Feature-Oriented Domain Analysis (FODA) Feasibility Study, Technical Report, 1990

  • [Lity13] - S. Lity, R. Lachmann, M. Lochau, M. Dukaczewski, I. Schaefer: Delta-
  • rientiertes Testen von variantenreichen Systemen, ObjektSpektrum, 2013