+ All Categories
Home > Documents > Code Change Impact Analysis for Testing Configurable...

Code Change Impact Analysis for Testing Configurable...

Date post: 08-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
128
Code Change Impact Analysis for Testing Configurable Software Systems Mithun Acharya ABB Corporate Research Raleigh NC USA
Transcript
Page 1: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Code Change Impact Analysis for Testing Configurable Software Systems

Mithun Acharya ABB Corporate Research Raleigh NC USA

Page 2: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ABB: A power and automation company

2

>125 years, >100 nations, ~150,000 employees

Power products and electronics, Control Systems, Robotics, Smart Grid, Renewable Energy, …

Page 3: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ABB Corporate Research Industrial Software Systems (ISS) research group

USAGermanySwitzerlandPolandSwedenIndiaChina

7 research centers worldwideRaleigh, NC

3

Page 4: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Software in ABB

4

Hardware with software inside

Software with few hardware components Pure Software

Page 5: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

5

Software Evolution: A CSS constantly changes

Hundreds of such changes committed daily

Page 6: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Change Control Board meetings

6

Change impact visualizationsfor managers for decisionmaking

Change impact at the code levelfor developers

Unit/module-level change impactfor testers

Page 7: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Imp: Code change impact analysis for C/C++ programs

7

C23

586

BUILDSERVER

Impact database

Impact of C23567Impact of C23586Impact of C23712Impact of changes since last nightly build…

NIGHTLY BUILD

Version control SERVER

CHECKOUT

IMP

Page 8: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Quantifiable risk/cost analysis of changes to CSS

8

Automated Dependency Analysis

Automated Risk/Cost Analysis Automated What-If Analysis

Will changes to foo.c, affect Bob’s module? Dependency analysis

3 days to release!!! Should I implement this feature or bug fix? What is the ‘best’ way to fix this bug or implement that new feature?

Automated Regression TestingShould I re-run ALL of my test suite for this change? New tests required?

Overlay change impact with risky areas in code

Test suite

3941 lines vs. 6 lines

Page 9: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Program and System Dependence Graphs for Slicing

9

void main() {int i = 1;int sum = 0;while (i<11) {

sum = add(sum, i);i = add(i, 1);

}printf("sum = %d\n", sum);printf("i = %d\n", i);

}

static int add(int a, int b) {

return(a+b); }

Code/Image Source: GrammaTech

PDG for add

Program Dependence Graph (PDG) for main

System

Dependence G

raph (SD

G)

Page 10: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Making impact analysis practical and useful

10

Page 11: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Making impact analysis practical and useful

10

Mithun Acharya, Brian Robinson. Practical Change Impact Analysis based on Static Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE 2012 (tool demo)

Mithun Acharya, Xiao Qu, Brian Robinson. Cross-System Change Impact Analysis Using Test Cases. Under submission.

Scaling beyond million lines

Page 12: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Making impact analysis practical and useful

10

Mithun Acharya, Brian Robinson. Practical Change Impact Analysis based on Static Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE 2012 (tool demo)

Mithun Acharya, Xiao Qu, Brian Robinson. Cross-System Change Impact Analysis Using Test Cases. Under submission.

Testing configurable systems

Scaling beyond million lines

Xiao Qu, Mithun Acharya, Brian Robinson. Configuration Selection Using Code Change Impact Analysis for Regression Testing. ICSM 2012

Xiao Qu, Mithun Acharya, Brian Robinson. Impact Analysis of Configuration Changes for Test Case Selection. ISSRE 2011

Page 13: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Making impact analysis practical and useful

10

Mithun Acharya, Brian Robinson. Practical Change Impact Analysis based on Static Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE 2012 (tool demo)

Mithun Acharya, Xiao Qu, Brian Robinson. Cross-System Change Impact Analysis Using Test Cases. Under submission.

Testing configurable systems

Regression test selection

Scaling beyond million lines

Xiao Qu, Mithun Acharya, Brian Robinson. Configuration Selection Using Code Change Impact Analysis for Regression Testing. ICSM 2012

Xiao Qu, Mithun Acharya, Brian Robinson. Impact Analysis of Configuration Changes for Test Case Selection. ISSRE 2011

Tingting Yu, Xiao Qu, Mithun Achayra, Gregg Rothermel. Oracle-Based Regression Test Selection. Under submission.

Page 14: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

What configurations should we select for retesting?

11

Mithun Acharya, Brian Robinson. Practical Change Impact Analysis based on Static Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE 2012 (tool demo)

Mithun Acharya, Xiao Qu, Brian Robinson. Cross-System Change Impact Analysis Using Test Cases. Under submission.

Testing configurable systems

Regression test selection

Scaling beyond million lines

Xiao Qu, Mithun Acharya, Brian Robinson. Configuration Selection Using Code Change Impact Analysis for Regression Testing. ICSM 2012

Xiao Qu, Mithun Acharya, Brian Robinson. Impact Analysis of Configuration Changes for Test Case Selection. ISSRE 2011

Tingting Yu, Xiao Qu, Mithun Achayra, Gregg Rothermel. Oracle-Based Regression Test Selection. Under submission.

Page 15: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Regression testing of CSS with code change impact analysis

12

Automated Dependency Analysis

Automated Risk/Cost Analysis Automated What-If Analysis

Will changes to foo.c, affect Bob’s module? Dependency analysis

3 days to release!!! Should I implement this feature or bug fix? What is the ‘best’ way to fix this bug or implement that new feature?

Automated Regression TestingShould I re-run ALL of my test suite for this change? New tests required?

Overlay change impact with risky areas in code

Test suite

3941 lines vs. 6 lines

Page 16: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Outline

Motivation

Approach

Implementation

Empirical Evaluation

Conclusions

16

Page 17: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurable Software Systems

Software that can be customized through a set of options Example: Internet Explorer

17

Page 18: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurable Software Systems

Software that can be customized through a set of options Example: Internet Explorer

Configurable option: “Pop-up Blocker”

Values: ON, OFF18

Page 19: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Internet Explorer Configurations

C1 C2 …

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

19

Page 20: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Internet Explorer Configurations

C1 C2 …

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Option

20

Page 21: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Internet Explorer Configurations

C1 C2 …

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Option

Value

21

Page 22: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Internet Explorer Configurations

C1 C2 …

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Configuration instance C1 = {ON, Disabled, Yes, …}

Option

Value

22

Page 23: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Internet Explorer Configurations

C1 C2 …

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Configuration instance C1 = {ON, Disabled, Yes, …}

Option

Value

Configuration C123

Page 24: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Faulty System Behavior under Certain Configurations

I have discovered that using the newly released IE 7 with Google Toolbar = Enabledcan cause the right-click menu to lose the “Open In New Tab” option

Impact of Configurations on System Behavior

24

Page 25: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Impact of Configuration on System Behavior

To fix this, open IE7, click “Tools > Manage Add-ons > Disable Google Toolbar”

25

Page 26: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test Case: Open IE7, Right Click a link on webpage

C1 C2

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

26

Page 27: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test Case: Open IE7, Right Click a link on webpage

C1 C2

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Test: PASS

27

Page 28: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test Case: Open IE7, Right Click a link on webpage

C1 C2

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Test: PASSTest: FAILNo “Open in New Tab”

28

Page 29: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test Case: Open IE7, Right Click a link on webpage

C1 C2

Pop Up Blocker ON ON …

Google Toolbar Disabled Enabled …

Do Not Track Yes Yes …

… … … …

Test: PASSTest: FAILNo “Open in New Tab”

A test case that passes with one configuration may fail with another29

Page 30: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

IE7IE7

30

Page 31: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

C1 = {ON, disabled, Yes, …}

IE7IE7

31

Page 32: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

Test: PASS

C1 = {ON, disabled, Yes, …}

IE7IE7

32

Page 33: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

Test: PASS

C2 = {ON, enabled, Yes, …}C1 = {ON, disabled, Yes, …}

IE7IE7

33

Page 34: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

Test: FAILTest: PASS

C2 = {ON, enabled, Yes, …}C1 = {ON, disabled, Yes, …}

IE7IE7

34

Page 35: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configurations control system execution

Test: FAILTest: PASS

C2 = {ON, enabled, Yes, …}C1 = {ON, disabled, Yes, …}

IE7IE7

Can we statically approximate how configurations (options) control system execution?

35

Page 36: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Challenges for testing configurable systems

36

Page 37: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Challenges for testing configurable systems

n options 2n configurations

37

Page 38: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Challenges for testing configurable systems

n options 2n configurations

IE7IE5Product evolves

38

Page 39: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Challenges for testing configurable systems

n options 2n configurations

IE7IE5

T = {t1, t2, t3, t4, t5} T’ = {t2, t5}Test case selection

Product evolves

39

Page 40: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Challenges for testing configurable systems

n options 2n configurations

IE7IE5

T = {t1, t2, t3, t4, t5} T’ = {t2, t5}

{C1, C2, C3, C4, C5} {C1, C5}Configuration selection

Test case selection

Product evolves

40

Page 41: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

41

Page 42: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

{C1, C2, C3, C4, C5, …}

IE7

T = {t1, t2, t3, t4, t5}

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

Exponentially large set

42

Page 43: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

{C1, C2, C3, C4, C5, …} {C1, C3, C4}

IE7

T = {t1, t2, t3, t4, t5}

Sampling

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

IE7

Exponentially large set Manageable size set

43

Page 44: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

{C1, C2, C3, C4, C5, …} {C1, C3, C4}

IE7

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}

Sampling

No test case selection

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

IE7

Exponentially large set Manageable size set

44

Page 45: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

{C1, C2, C3, C4, C5, …} {C1, C3, C4}

IE7

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}

Sampling

No test case selection

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

Example: Configuration Interaction Testing (CIT)

IE7

Exponentially large set Manageable size set

45

Page 46: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

{C1, C2, C3, C4, C5, …} {C1, C3, C4}

IE7

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}

Sampling

No test case selection

Reducing the exponential number of configurations to a manageable sizeConfiguration Sampling

Example: Configuration Interaction Testing (CIT)

IE7

Exponentially large set Manageable size set

We choose to test IE7 only under sampled configurations C1, C3, and C4and for each configurations we test IE7 with all tests {t1, t2, t3, t4, t5}

46

Page 47: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

47

Page 48: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

290 configurations

48

Page 49: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

290 configurations sampling CIT selects60 configurations

49

Page 50: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

290 configurations sampling CIT selects60 configurations

Rerun the full test suite on each 60 configurations

50

Page 51: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

290 configurations sampling CIT selects60 configurations

Rerun the full test suite on each 60 configurations

7 hours to execute the full test suiteTakes 7*60 = 420 hours (~2.5 weeks) to run all test cases under each configuration

51

Page 52: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

vim: A configurable system

290 configurations sampling CIT selects60 configurations

Rerun the full test suite on each 60 configurations

Do we have to run all tests under each configuration?

7 hours to execute the full test suiteTakes 7*60 = 420 hours (~2.5 weeks) to run all test cases under each configuration

52

Page 53: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201153

Page 54: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

IE7

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201154

Page 55: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

C1 = {ON, Disabled, Yes, …} C2 = {ON, Enabled, Yes, …}

IE7

Source code DOES NOT change

IE7Configuration under test changes

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201155

Page 56: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

C1 = {ON, Disabled, Yes, …} C2 = {ON, Enabled, Yes, …}

IE7

Source code DOES NOT change

IE7

T = {t1, t2, t3, t4, t5}

Configuration under test changes

What test cases should I re-run for the new configuration?

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201156

Page 57: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

C1 = {ON, Disabled, Yes, …} C2 = {ON, Enabled, Yes, …}

IE7

Source code DOES NOT change

IE7

T = {t1, t2, t3, t4, t5} T’ = {t2, t5}

Configuration under test changes

What test cases should I re-run for the new configuration?

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201157

Page 58: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Test case selection when configuration under test changes*

C1 = {ON, Disabled, Yes, …} C2 = {ON, Enabled, Yes, …}

IE7

Source code DOES NOT change

IE7

T = {t1, t2, t3, t4, t5} T’ = {t2, t5}

For the ABB system analyzed, only about 20% of the tests had to be re-run for a configuration change

Configuration under test changes

What test cases should I re-run for the new configuration?

* Qu, Acharya, Robinson, “Impact analysis of configuration changes for test case selection”, ISSRE 201158

Page 59: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Product Evolution

Internet Explorer

IE1.0 & 2.0

IE5

IE6

IE7

59

Page 60: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 200860

Page 61: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE5

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5}

T = {t1, t2, t3, t4, t5}

61

Page 62: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5}

T = {t1, t2, t3, t4, t5}

62

Page 63: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5}

63

Page 64: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5}

Reorder and run as many as you can

64

Page 65: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

Reorder and run as many as you can

65

Page 66: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Increases rate of fault detection. But…

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

Reorder and run as many as you can

66

Page 67: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Increases rate of fault detection. But…

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

Does not eliminate redundancy.Does not detect all faults. Not safe.

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

Reorder and run as many as you can

67

Page 68: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Increases rate of fault detection. But…

Configuration prioritization for regression testing*

*Qu, Cohen, Rothermel, “Configuration-aware regression testing: An empirical study of sampling and prioritization”, ISSTA 2008

Does not eliminate redundancy.Does not detect all faults. Not safe.

{C1, C2, C3, C4, C5} {C1, C4, C3. …}Prioritization

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

Can we select a subset of {C1, C2, C3, C4, C5} that is both non-redundant and safe?

Reorder and run as many as you can

68

Page 69: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Configuration selection for regression testing (Focus of this talk)

69

Page 70: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE5

Configuration selection for regression testing (Focus of this talk)

{C1, C2, C3, C4, C5}

T = {t1, t2, t3, t4, t5}

70

Page 71: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration selection for regression testing (Focus of this talk)

{C1, C2, C3, C4, C5}

T = {t1, t2, t3, t4, t5}

71

Page 72: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration selection for regression testing (Focus of this talk)

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5}

72

Page 73: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration selection for regression testing (Focus of this talk)

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

73

Page 74: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

Configuration selection for regression testing (Focus of this talk)

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

{C1, C5} is both safe (wrt retest-all configurations) and non redundant

74

Page 75: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

State of the Art in Configurable System Testing

Focus of this talk

75

Page 76: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

State of the Art in Configurable System Testing Configuration sampling Single version No test case selection Example, CIT

Focus of this talk

76

Page 77: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

State of the Art in Configurable System Testing Configuration sampling Single version No test case selection Example, CIT

Test case selection [ISSRE ‘11] Single version Configuration under test changes Non-redundant Safe

Focus of this talk

77

Page 78: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

State of the Art in Configurable System Testing

Configuration prioritization [ISSTA ‘08] Source code changes Regression Testing No test case selection Redundant Not safe

Configuration sampling Single version No test case selection Example, CIT

Test case selection [ISSRE ‘11] Single version Configuration under test changes Non-redundant Safe

Focus of this talk

78

Page 79: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

State of the Art in Configurable System Testing

Configuration selection[ICSM ‘12] Source code changes Regression testing Non-redundant Safe No test case selection

Configuration prioritization [ISSTA ‘08] Source code changes Regression Testing No test case selection Redundant Not safe

Configuration sampling Single version No test case selection Example, CIT

Test case selection [ISSRE ‘11] Single version Configuration under test changes Non-redundant Safe

Focus of this talk

79

Page 80: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Outline

Motivation

Approach

Implementation

Empirical Evaluation

Conclusions

80

Page 81: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Map configuration options to code

81

Page 82: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Map configuration options to code

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE5

82

Page 83: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Map configuration options to code

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE5 IE7

change

83

Page 84: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Map configuration options to code

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE5 IE7

change

84

Page 85: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Map configuration options to code

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

For ABB systems, configurable options (stored in a DB) maps to variables in the source code

IE5 IE7

change

85

Page 86: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: statically compute configuration option impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

86

Page 87: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: statically compute configuration option impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

87

Page 88: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: statically compute configuration option impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

88

Page 89: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: statically compute configuration option impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

89

Page 90: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: statically compute impact of the changes

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

90

Page 91: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Intersect configuration impact with change impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

91

Page 92: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Key Idea: Intersect configuration impact with change impact

Configuration options: {pop-up-blocker, Google Toolbar, Do Not Track}

IE7

Select configuration option “Google Toolbar” for regression testingSafely discard “pop-up blocker” and “Do Not Track”92

Page 93: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example Program

Configurable Options: {P1, P2, P3}

Mapping configurable options to source code

93

Page 94: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example Program

Configurable Options: {P1, P2, P3}

Mapping configurable options to source code

94

Page 95: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example Program

Configurable Options: {P1, P2, P3}

Mapping configurable options to source code

95

Page 96: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example Program

Configurable Options: {P1, P2, P3}

Mapping configurable options to source code

96

Page 97: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example Program

Configurable Options: {P1, P2, P3}

Mapping configurable options to source code

Function f1 changes

97

Page 98: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example

98

Page 99: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example

Options Values

P1 True False

P2 True False

P3 True False

Configurable Options

99

Page 100: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Example

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

100

Page 101: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ExampleSimplified dependency graph

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

101

Page 102: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Impact of configuration option P1f1, f2, f6, f7, and f8

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

102

Page 103: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Impact of configuration option P2f7 and f8

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

103

Page 104: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Impact of configuration option P3f4

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

104

Page 105: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Impact of changed function f1

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

f1, f2, and f6

105

Page 106: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Select option P1 and safely discard P2 and P3

Options Values

P1 True False

P2 True False

P3 True False

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurable Options

Configurations by pair-wise CIT

106

Page 107: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Select option P1 and safely discard P2 and P3

Options Values

P1 True False

P2 True False

P3 True False

Configurable Options

P1 P2 P3

C1 True True True

C2 True False False

C3 False True False

C4 False False True

Configurations by pair-wise CIT

107

Page 108: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Outline

Motivation

Configuration Selection Approach

Implementation

Empirical Evaluation

Conclusions

108

Page 109: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Research Questions

Effectiveness

1

How does our selection compare to retest-all, in terms of fault detection?

2

What percentage of configurations is discarded as redundant by our selection?

Efficiency

3

How much regression time can our selection save?

109

Page 110: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Research Questions

Effectiveness

1

How does our selection compare to retest-all, in terms of fault detection?

2

What percentage of configurations is discarded as redundant by our selection?

Efficiency

3

How much regression time can our selection save?

110

Page 111: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Subjects

Make (Software Infrastructure Repository) V3.77 to v3.78.1 LOC: ≈ 15k LOC Code changes: selects 60 from 869 Seeded 15 faults Configurable options: 11 (binary) 7 configurations

Grep V1.0 to V2.0 LOC: ≈ 8k LOC Code changes: 15 Seeded 15 faults Configurable options: 14 (binary) 7 configurations

111

Page 112: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Results

Make GrepRetest-all 8/15 6/15Our selection 8/15 6/15Random selection 3/15 5/15

Fault Detection Ability

112

Page 113: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Results

Make GrepRetest-all 8/15 6/15Our selection 8/15 6/15Random selection 3/15 5/15

Fault Detection Ability

Our approach is safe wrt retest-all configurations

113

Page 114: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Research Questions

Effectiveness

1

How does our selection compare to retest-all, in terms of fault detection?

2

What percentage of configurations is discarded as redundant by our selection?

Efficiency

3

How much regression time can our selection save?

114

Page 115: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Subject

LOC: 1.18 MLOC Number of Functions: 20,432 functions Code changes: 203 Configurable options: 545 (number of values range from 2 to 9) 159

configurations Among the 203 changes, we selected three sets of 30 changes for analysis

ABB1

115

Page 116: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ResultsPercentage of configurations selected

NUMBER OF CONFIGURABLE OPTIONS SELECTED

NUMBER OF CONFIGURATIONS SELECTED

Change set 1 Change set 2 Change set 3 AverageRetest-all 545Selected 167 161 161 163reduction 69% 70% 70% 70%

Change set 1 Change set 2 Change set 3 AverageRetest-all 159Selected 120 120 120 120reduction 25% 25% 25% 25%

116

Page 117: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Research Questions

Effectiveness

1

How does our selection compare to retest-all, in terms of fault detection?

2

What percentage of configurations is discarded as redundant by our selection?

Efficiency

3

How much regression time can our selection save?

117

Page 118: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ResultsTesting time savings

grep make ABB1Testing time

Retest-all 70m 700m 795hOur approach 60m 300m 600h

Overheadof selection

5.2m 13m 28h

Time savings

5m 387m 167h50% 55% 21%

118

Page 119: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

ResultsTesting time savings

grep make ABB1Testing time

Retest-all 70m 700m 795hOur approach 60m 300m 600h

Overheadof selection

5.2m 13m 28h

Time savings

5m 387m 167h50% 55% 21%

Our configuration selection approach saves about 20-55% of testing time wrt retest-all configurations

119

Page 120: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Better than random, safe wrt retest-all

safe

Effectiveness

1

How does our selection compare to retest-all and random in terms of fault detection?

15 – 60%

2

What percentage of configurations is discarded as redundant by our selection?

Efficiency

20 – 55%

3

How much regression time can our selection save?

120

Page 121: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

Outline

Motivation

Configuration Selection Approach

Implementation

Empirical Evaluation

Conclusions

121

Page 122: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

First configuration selection approach for regression testing

122

Page 123: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

First configuration selection approach for regression testing

123

Page 124: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

First configuration selection approach for regression testing

{C1, C2, C3, C4, C5} {C1, C5}Selection

124

Page 125: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

First configuration selection approach for regression testing

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

125

Page 126: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

First configuration selection approach for regression testing

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

{C1, C5} is both safe (wrt retest-all configurations) and non redundant

126

Page 127: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

IE7

Source code CHANGES

IE5

First configuration selection approach for regression testing

{C1, C2, C3, C4, C5} {C1, C5}Selection

T = {t1, t2, t3, t4, t5} T’ = {t1, t2, t3, t4, t5}No test case selection

{C1, C5} is both safe (wrt retest-all configurations) and non redundant

In our experiments, 15-60% of configurations were discarded as redundant saving 20-55% of regression testing time

127

Page 128: Code Change Impact Analysis for Testing Configurable ...crest.cs.ucl.ac.uk/cow/23/slides/COW23_Acharya.pdf · Program Slicing for Industrial Software Systems. ICSE 2011 SEiP, FSE

128


Recommended