• No results found

Model-Based Testing of Software Product Lines

N/A
N/A
Protected

Academic year: 2021

Share "Model-Based Testing of Software Product Lines"

Copied!
39
0
0

Loading.... (view fulltext now)

Full text

(1)

Prof. Dr. Holger Schlingloff

Fraunhofer FOKUS & Humboldt Universität

[email protected]

Model-Based Testing of

Software Product Lines

(2)

© H. Schlingloff 2013 Seite 2 /36

Fraunhofer FOKUS

Fraunhofer Institute for

Open Communication Systems

• formed July 2012 by a merger of

three institutes (FOKUS, FIRST, ISST) • located in the center of Berlin

• staff: approx. 500 computer scientists • main topic: smart cities

Competence Centers:

• Embedded Systems Quality Management

• Modelling and Testing for Systems and Service Solutions • Next Generation Network Infrastructures

• Electronic Safety and Security Systems for the Public and Industries • Future Applications and Media

(3)

Structure of this Talk

1. Software product lines, feature modeling

2. Testing software product lines

3. A testing theory based on CSP-CASL

4. Implementation and applications

(4)

© H. Schlingloff 2013 Seite 4 /36

I. Software Product Lines (SPL)

Concept emerged from CMU SEI in the 1990s Goal: Managing variability in software

Sources of variability

• planned diversity (“basic/professional/ultimate edition”) • user alternatives (“for MAC/Win/Linux”)

• evolution (“version 8”) • re-use (different histories)

CMU SEI: „ A software product line (SPL) is a set of software-intensive systems that share a common,

managed set of features satisfying the specific needs of a particular market segment or mission and that are developed from a common set of core assets in a prescribed way“

(5)
(6)
(7)

Examples for Software Product Lines

Schindler elevator controls division

· mergers, different devices, new user concepts · >20 different controllers reduced to 3 product lines

Thales ETCS RBC

· one product (line), highly diverse market · 700 features, >10100 variants

AUTOSAR ECUs

· 1000s of configuration parameters

(8)

© H. Schlingloff 2013 Seite 8 /36

Features of Product Lines

A feature is the description of a designated functionality – a special added value for the customer

– a characteristics of the product which is interesting for a stakeholder

– e.g., a requirement, a function or function group, or a quality criterion

Typically, products are evolved by adding new features

e.g., Galaxy S4 phone with new IR-emitter diode to work as a remote control for your home TV

(9)

Feature Modelling

For multi-variant systems (e.g., product lines), features are represented in a feature model

– usually in a tree-like manner (and / or – tree)

– additional constraints (mandatory, optional, includes, excludes)

(10)

© H. Schlingloff 2013 Seite 10 /36 pinKm pin Date pinDoService CbsWd MotorOil Adaptive pinSensorsMo Cbs ComputeServiceDate Cbs Display CbsWdSparkPlugs pin SensorsSp pinDoService CbsReset pin Sensors Mo pin Sensors Sp p o u t D i s p l a y B a s i c pinKm pinDate pinKm pinDate CbsWd ParticleFilter Adaptive pinDoService pinKm pinDate pinSensorsPf pin Sensors Pf pin D o S e r v i c e pout Availability p o u t A v a i l a b i l i t y p o u t A v a i l a b i l i t y CbsWd SparkPlugs Linear CbsWd SparkPlugs Adaptive p o u t S e r v P f p o u t S e r v S p p o u t S e r v M o pinAvailabilityPf pinAvailabilitySp pinAvailabilityMo pout ServiceDate pin ServiceDate pout Reset pinReset CarTime Car Mileage Sensors MotorOil Sensors SparkPlugs Sensors Particle Filter Car Service Car Display Cbs pinKm pin Date pinDoService CbsWd MotorOil Adaptive pinSensorsMo Cbs ComputeServiceDate Cbs Display CbsWdSparkPlugs pin SensorsSp pinDoService CbsReset pin Sensors Mo pin Sensors Sp p o u t D i s p l a y B a s i c pinKm pinDate pinKm pinDate p i n D o S e r v i c e pout Availability po u t Av a i la b i li t y CbsWd SparkPlugs Linear CbsWd SparkPlugs Adaptive po u t Se r v Sp p o u t S e r v M o pinAvailabilitySp pinAvailabilityMo pout ServiceDate pin ServiceDate pout Reset pinReset CarTime Car Mileage Sensors MotorOil Car Service Car Display Cbs

Instantiation („Materialization“)

Vehicle

Engine Maintenance Vehicle

Diesel Otto Wd MotorOil Adaptive Wd ParticleFilter Adaptive Wd SparkPlugs Wd SparkPlugs Adaptive Wd SparkPlugs Linear Cbs <<needs>> <<needs>> Vehicle

Engine Maintenance Vehicle

Diesel Otto Wd MotorOil Adaptive Wd ParticleFilter Adaptive Wd SparkPlugs Wd SparkPlugs Adaptive Wd SparkPlugs Linear Cbs <<needs>> <<needs>> Feature-model Implementation model Variant-model 150% model

(11)

Model-Based SPL Testing Strategies

Main problem: which variants to choose? (n features  2n instances)

 The feature model represents a Boolean condition on the set of features

 The set of satisfying interpretations forms a partial order Reasonable choices for variant selection (feature coverage):

• All possible product variants • All features

• Pairwise

• Minimal and maximal elements • Selected and unselected

• ...

FFF

FFT FTF TFF

FTT TFT TTF

(12)

© H. Schlingloff 2013 Seite 12 /36

Structure of this Talk

1. Software product lines, feature modeling

2. Testing software product lines

3. A testing theory based on CSP-CASL

4. Implementation and applications

(13)

Application Scenario

Test cases are first-class artefacts (manually created, engineered, ...)

Furthermore, systems are not designed “from scratch”

Often, both product and test cases pre-exist and make good money

Then, the product is enhanced by new features

And the regression tests fail

Q.: Is this due to a bug in the product (line) or due to a bad test case?

(14)

© H. Schlingloff 2013 Seite 14 /36

Vertical and Horizontal Systems Development

There are many systems development models.

Refinement: means vertical development (top-down)

Product lines are almost never conceived in one go. Enhancement means horizontal development (left-right)

Enhancement

Refinement

...

(15)

Abstraction and Nondeterminism

Task: Given a (150%-) model and a test suite,

characterize those test cases which should pass.

What does “should pass” mean? (Model used as a test oracle)

In contrast to concrete implementations, models are abstract

and, therefore, in general nondeterministic

Test outcome may not be decided yet

 Test result “undecided” at this stage

m:=getSensorValue (x); calibrate(m); if (m>17) signal(0) else signal(1) getSensorValue calibrate signal(0) signal(1)

(16)

© H. Schlingloff 2013 Seite 16 /36

Three-Valued Test Oracles

Task: Given a (150%-) model and a test suite,

characterize those test cases which should pass.

What does “should pass” mean? (Model used as a test oracle)

Usual test generation algorithms only produce tests that “should pass”

How to test that “it must not happen”?

Test case may check for unwanted behavior

 Test result “expected fail”

m:=getSensorValue (x); calibrate(m); if (m>17) signal(0) else signal(1) getSensorValue calibrate signal(0) signal(1)

(17)

Defining Expected Results

A test case T is a sequence or tree of i/o-events, potentially with variables

We define the colour of a test with respect to a specification

A test case T is green if

– all of its traces are possible system runs according to the specification, – whose execution can’t be refused T is red, if

– not all of its traces are possible system runs T is yellow, otherwise

(18)

© H. Schlingloff 2013 Seite 18 /36

Structure of this Talk

1. Software product lines, feature modeling

2. Testing software product lines

3. A testing theory based on CSP-CASL

4. Implementation and applications

(19)
(20)

© H. Schlingloff 2013 Seite 20 /36

(21)
(22)

© H. Schlingloff 2013 Seite 22 /36

Extending the Abstract RCU (Data Enhancement)

NOT a refinement:

Signature is extended by supersort EButton; operation codeOf is extended by overloading

Are the test verdicts still valid for this modified specification?

(23)

Modifier Button (Behavioural Enhancement)

If arbitrary changes to data and process specification are allowed in the enhancement process, preservation of features cannot be guaranteed.

(24)

© H. Schlingloff 2013 Seite 24 /36

Enhancement in CSP-CASL

Principle:

• Add “more data symbols” • add “more behaviours”

• however, keep the “old” system

Data enhancement:

(25)

Data Enhancement

(26)

© H. Schlingloff 2013 Seite 26 /36

Behavioral Enhancement

(27)

Re-Use of Test Cases

That is, if the enhancement is done in a “controlled” way,

(28)

© H. Schlingloff 2013 Seite 28 /36

(29)

Structure of this Talk

1. Software product lines, feature modeling

2. Testing software product lines

3. A testing theory based on CSP-CASL

4. Implementation and applications

(30)

© H. Schlingloff 2013 Seite 30 /36

(31)
(32)

© H. Schlingloff 2013 Seite 32 /36

Bringing It Onto a Test Rig

Simulation and verification of the model (FDR)

Manual test case definition, automated coloring

Automated execution and evaluation

(33)
(34)

© H. Schlingloff 2013 Seite 34 /36

Variability in CVL

CVL defines different kinds of variation points – Object existence

i.e., some model element is deleted or inserted – Value assignment

i.e., a variable is assigned a value – Substitution

i.e., one model fragment is replaced by another one – Opaque variation point

i.e., an arbitrary model transformation is applied

Even uncontrolled object existence can cause problems Needed: rules (profile) for variation points

(35)

Structure of this Talk

1. Software product lines, feature modeling

2. Testing software product lines

3. A testing theory based on CSP-CASL

4. Implementation and applications

(36)

© H. Schlingloff 2013 Seite 36 /36

Summary, Remarks and Open Issues

• Software product lines, feature modeling,

• Theory of test case rating based on process algebraic specifications

• Preservation of test ratings under certain refinements and enhancements • Work in progress (with interruptions)

• Semantical theory, some syntactic results

• Currently working on UML as a modeling language

(37)
(38)

© H. Schlingloff 2013 Seite 38 /36

(39)

Mode Buttton

References

Related documents

Compared with SCF income, our measure shows that the share of income from wealth in inequality was 16.8 percentage points higher at 35.8 percent in 1983 and 17.6 percentage

Stay health Follow-up health Right drug Right disease Right time Disease management Living at home Cost efficient Processes in Health care... Future age distribution

Annette Holland, Public Health, Seattle/King County; Alice Ferrier, Marci Williams, Hopelink; Judy Roberts, Bellevue Community College; Jeanette Lozovsky, Jewish Family

Since the VCC endorsed the Programme in June 2008 we have spoken with around 250 staff in face to face meetings; have made the leadership devel- opment proposal document available

SPM Solution Project Manager Performance Test Dependency Mgmt. Project Manager

I do weigh that there is no clear evidence that Mr Webley is owed holiday pay and that information was provided by Bish Automotive to attempt to establish

“ A new Integrated Operating Room will allow us to perform more minimally invasive procedures, increasing the efficiency and speed of the surgical process, which will allow

FL cells T FH Treg/ T FR Th CD8 T γδ γδ γδ γδ NK TAM Stromal cells Anti-PD-1 mAb CXCR4 antagonists BTK/SYK inhibitors Anti-CTLA4 mAb Anti-PD 1 mAb Anti-CTLA4 mAb Anti-PD-1