Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

38
www.unamur.be Covering SPL Behaviour with Sampled Configurations: An Initial Assessment Xavier Devroey <[email protected]> Gilles Perrouin <[email protected]> Axel Legay <[email protected]> Pierre-Yves Schobbens <[email protected]> Patrick Heymans <[email protected]> 9 th International Workshop on Variability Modelling of Software- intensive Systems, VaMoS ‘15 Hildesheim, Germany

Transcript of Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

Page 1: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

www.unamur.be

Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

Xavier Devroey <[email protected]> Gilles Perrouin <[email protected]>Axel Legay <[email protected]>Pierre-Yves Schobbens <[email protected]>Patrick Heymans <[email protected]>

9th International Workshop on Variability Modelling of Software-intensive Systems, VaMoS ‘15

Hildesheim, Germany

Page 2: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

2

Introduction

• Software Product Line Model Based Testing• Structural approaches– Sample configurations to test in a Feature Diagram– Similarity – Pairwise

• Behavioural approaches– Select test cases in a behavioural model of the SPL

VaMoS '15 [email protected]

Devroey et al. (2014). Towards Statistical Prioritization for Software Product Lines Testing. In VaMoS ’14.

Page 3: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

3

Introduction

• Software Product Line Model Based Testing• Structural approaches– Sample configurations to test in a Feature Diagram– Similarity – Pairwise

• Behavioural approaches– Select test cases in a behavioural model of the SPL

Practically, which behavioural coverage similarity and pairwise sampling do achieve ?

VaMoS '15 [email protected]

Page 4: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

SPECIFYING A PRODUCT LINE

Featured Transition Systems (FTSs) [Classen et al. 2011]

Page 5: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 5VaMoS '15

Images credit: http://hedbonstudios.deviantart.com

Page 6: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 6VaMoS '15

Images credit: http://hedbonstudios.deviantart.com

Page 7: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 7

Featured Transition System

VaMoS '15

Page 8: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

STRUCTURAL VS BEHAVIOURAL COVERAGE CRITERIA

Image credits: http://domonated.deviantart.com

Page 9: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 9

Structural Coverage

• Which configurations do I select in the FD ?• Pairwise criterion– All pairs of features appears in at least one configuration to test– T-wise – 3-wise interactions are common [Steffens et al. 2012]

VaMoS '15

Page 10: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 10

Structural Coverage

• Which configurations do I select in the FD ?• Pairwise criteria– All pairs of features appears in at least one configuration to test– T-wise – 3-wise interactions are common [Steffens et al. 2012]

• (Di)Similarity criteria– Dissimilar configurations to test– With few selected/deselected features in common– Uses a distance function (easy to compute)– Empirically validated [Henard et al. 2013]

VaMoS '15

Steffens et al. (2012). Industrial Evaluation of Pairwise SPL Testing with MoSo-PoLiTe. In VaMoS ‘12

Page 11: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 11

Structural Coverage

VaMoS '15

Page 12: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 12

Structural Coverage

VaMoS '15

Page 13: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 13

Behavioural Coverage

• Behavioural test case – Sequence of actions in a FTS– Executable by a valid product of the SPL

VaMoS '15

Devroey et al. (2014). Coverage Criteria for Behavioural Testing of Software Product Lines. In ISoLA’1

Page 14: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 14

Behavioural Coverage

VaMoS '15

Page 15: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 15

Behavioural Coverage

VaMoS '15

Page 16: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 16

Behavioural Coverage

VaMoS '15

Page 17: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 17

Behavioural Coverage

• Behavioural test case – Sequence of actions in a FTS– Executable by a valid product of the SPL

• Coverage criteria– Executable set of test cases, FTS → [0, 1]– State coverage– Transition coverage – Transition-pairs coverage

VaMoS '15

Devroey et al. (2014). Coverage Criteria for Behavioural Testing of Software Product Lines. In ISoLA’14

Page 18: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 18

Behavioural Coverage

Exec. Test-Suite TS is Minimal for cov iff

• There is no exec. TS’ with a better coverage cov

• There is no exec. TS’ with fewer Test-Cases

Exec. Test-Suite TS is P-Minimal for cov iff

• There is no exec. TS’ with a better coverage cov

• There is no exec. TS’ which request fewer products to execute TS’

SPLat @ SPLC'14

Devroey et al. (2014). Coverage Criteria for Behavioural Testing of Software Product Lines. In ISoLA’14

Page 19: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 19

FTS Test-Case Selection

Number of Exec T.

C.

Number of

Products

Test Case Selection

Coverage

SPLat @ SPLC'14

Page 20: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 20

Behavioural Coverage

VaMoS '15

Page 21: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 21

Behavioural Coverage

VaMoS '15

Page 22: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

EXPERIMENT

… using PLEDGE and SPLCAT

Page 23: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 23

Setup

• SPLCAT– T-wise criterion, with T in [1,3]

• PLEDGE– (Di)Similarity criterion– Uses a genetic algorithm

• Number of configurations (population) given by SPLCAT• Time = 60 sec. (default time)

VaMoS '15

Page 24: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 24

Coverage computation process

Compute coverage and cumulated coverage

Projects the FTS Model

Generate a set of configurations from the FD

VaMoS '15

Page 25: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 25

Coverage computation process

Compute coverage and cumulated coverage

Project the FTS Model

Generate a set of configurations from the FD

VaMoS '15

Page 26: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 26

Coverage computation process

Compute coverage and cumulated coverage on FTS

Project the FTS Model

Generate a set of configurations from the FD

VaMoS '15

Page 27: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 27

Results

VaMoS '15

Page 28: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 28

Results

VaMoS '15

Page 29: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 29

Results

VaMoS '15

Page 30: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 30

Observations

• Relatively few configurations are needed to cover 100% of states, transitions and actions– Tendency is confirmed both on academic and Claroline

• T-Wise coverage (SPLCAT) provides better coverage (for all our behavioural criteria) for T = 3

VaMoS '15

Page 31: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 31

Observations

• For both approaches, there is a need for prioritization and optimal behavioural coverage – E.g., from the 73 config. Generated for Claroline, only 1 is

needed to achieve state coverage

• Threat: Considered FDs have few features and cross-tree constraints

VaMoS '15

Page 32: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

CONCLUSION

… and Future Works

Page 33: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 33

Conclusion

• For our models (9 up to 44 features), a small set of configurations allows good coverage– From 3 to achieve 100% actions and states coverage– Between 5 and 8 for 100% transitions coverage

VaMoS '15

Page 34: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 34

Conclusion

• For our models (9 up to 44 features), a small set of configurations allows good coverage– From 3 to achieve 100% actions and states coverage– Between 5 and 8 for 100% transitions coverage

• Maximising Behavioural coverage cannot be done only using structural coverage criteria

VaMoS '15

Page 35: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 35

Future Works

• Formally establish the relationship between structural and behavioural SPL Coverage

VaMoS '15

Page 36: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 36

Future Works

• Formally establish the relationship between structural and behavioural SPL Coverage

• … in order to define hybrid behavioural/structural criteria

VaMoS '15

Page 37: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

[email protected] 37

Future Works

• Formally establish the relationship between structural and behavioural SPL Coverage

• … in order to define hybrid behavioural/structural criteria

• Guided by replication of the experiment on more complex case studies (more features, more constraints, more complex behaviour, etc.)

VaMoS '15

Page 38: Covering SPL Behaviour with Sampled Configurations: An Initial Assessment

THANK YOU FOR YOUR ATTENTION !

Models and tools available at https://projects.info.unamur.be/vibes/