Hypervolume-based search for test case prioritization - ssbse 2015

54
Hypervolume-based Search for Test Case Prioritization Dario Di Nucci Annibale Panichella Andy Zaidman Andrea De Lucia

Transcript of Hypervolume-based search for test case prioritization - ssbse 2015

Page 1: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume-based Search for Test Case Prioritization

Dario Di Nucci Annibale Panichella Andy Zaidman Andrea De Lucia

Page 2: Hypervolume-based search for test case prioritization - ssbse 2015

fau

lt

test case

Test Case Prioritization

Find an ideal sorting for executing test cases in order to reveal faults earlier

Page 3: Hypervolume-based search for test case prioritization - ssbse 2015

fau

lt

test case

Test Case Prioritization

No a priori information

about faults

Find an ideal sorting for executing test cases in order to reveal faults earlier

Page 4: Hypervolume-based search for test case prioritization - ssbse 2015

fau

lt

test case

Test Case Prioritization

No a priori information

about faultsUse of surrogates

Find an ideal sorting for executing test cases in order to reveal faults earlier

Page 5: Hypervolume-based search for test case prioritization - ssbse 2015

bra

nch

test case

Test Case Prioritization

No a priori information

about faultsUse of surrogates

Find an ideal sorting for executing test cases in order to reveal faults earlier

Page 6: Hypervolume-based search for test case prioritization - ssbse 2015

state

men

t

test case

Test Case Prioritization

No a priori information

about faultsUse of surrogates

Find an ideal sorting for executing test cases in order to reveal faults earlier

Page 7: Hypervolume-based search for test case prioritization - ssbse 2015

state

men

t

test case

Test Case Prioritization

No a priori information

about faultsUse of surrogates

Find an ideal sorting for executing test cases in order to reveal faults earlier

NP-Complete problem

Page 8: Hypervolume-based search for test case prioritization - ssbse 2015

state

men

t

test case

Test Case Prioritization

No a priori information

about faultsUse of surrogates

Find an ideal sorting for executing test cases in order to reveal faults earlier

NP-Complete problemApproximation

algorithms

Page 9: Hypervolume-based search for test case prioritization - ssbse 2015

Greedy Algorithms

Page 10: Hypervolume-based search for test case prioritization - ssbse 2015

Greedy Algorithms

Page 11: Hypervolume-based search for test case prioritization - ssbse 2015

Greedy Algorithms

Page 12: Hypervolume-based search for test case prioritization - ssbse 2015

Greedy Algorithms

Any better solution?

Page 13: Hypervolume-based search for test case prioritization - ssbse 2015

Single Objective Metaheuristics

Page 14: Hypervolume-based search for test case prioritization - ssbse 2015

Single Objective Metaheuristics

Integer permutation for

representing a test suite

3 5 1 4 7 2 8 6 9

8 5 1 9 6 2 3 7 4

Page 15: Hypervolume-based search for test case prioritization - ssbse 2015

Single Objective Metaheuristics

Integer permutation for

representing a test suite

Maximize AUC

APBC – APDC - APSC

3 5 1 4 7 2 8 6 9

8 5 1 9 6 2 3 7 4

Page 16: Hypervolume-based search for test case prioritization - ssbse 2015

Single Objective Metaheuristics

Integer permutation for

representing a test suite

Maximize AUC

APBC – APDC - APSC

3 5 1 4 7 2 8 6 9

8 5 1 9 6 2 3 7 4

TCP problem has

a multi-objective nature

Page 17: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Pareto-ranking

Algorithms (NSGA-II)

Page 18: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Pareto-ranking

Algorithms (NSGA-II)

Page 19: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Pareto-ranking

Algorithms (NSGA-II)

Page 20: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Page 21: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Bad effectiveness as the

problem dimensionality

increases

Page 22: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Bad effectiveness as the

problem dimensionality

increases

For more than 3-objectives, all

individuals are non-dominated

Poor Selective Pressure

Page 23: Hypervolume-based search for test case prioritization - ssbse 2015

Multi Objective Metaheuristics

Bad effectiveness as the

problem dimensionality

increases

No strong empirical evidence

of the cost-effectiveness with

respect to simpler heuristics

For more than 3-objectives, all

individuals are non-dominated

Poor Selective Pressure

Page 24: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume-basedGenetic Algorithm

Page 25: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

In many-objective optimization there is a growing trend to solve many-

objective problems using quality scalar indicators to condense multiple

objectives into a single objective.

Auger et al. - Theory of the hypervolume

indicator: optimal distributions and the

choice of the reference point - FOGA 2009

Page 26: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

In many-objective optimization there is a growing trend to solve many-

objective problems using quality scalar indicators to condense multiple

objectives into a single objective.

Auger et al. - Theory of the hypervolume

indicator: optimal distributions and the

choice of the reference point - FOGA 2009

The hypervolume measures the quality of a set of solutions as the total

size of the objective space that is dominated by one (or more) of such

solutions.

Page 27: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

F1

F2

min

min

A

B

A non-dominates B

C

B dominates C

B non-dominates A

Page 28: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

F1

F2

min

min

B

C

Area dominated by AA

Page 29: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

F1

F2

min

min

B

C

Area dominated by BA

Page 30: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

F1

F2

min

min

B

C

Area dominated by CA

Page 31: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume

F1

F2

min

min

A

B

C

Area(B) > Area(A)

Area(B) > Area(C)

Stronger Selective

Pressure

Page 32: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume Indicator for TCP

c2-objectives

min

max

Page 33: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume Indicator for TCP

min

max

c3-objectives

Page 34: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume Indicator for TCP

It can be used as fitness function in a Single Objective

Metaheuristic

Page 35: Hypervolume-based search for test case prioritization - ssbse 2015

Hypervolume Indicator for TCP

Computational Time 𝑶 𝒏 ∙ 𝒎

n test cases

m testing criteria

It can be used as fitness function in a Single Objective

Metaheuristic

Page 36: Hypervolume-based search for test case prioritization - ssbse 2015

Empirical Evaluation

Page 37: Hypervolume-based search for test case prioritization - ssbse 2015

Research Questions

RQ1 : What is the cost-effectiveness of HGA, compared to

cost-aware additional greedy algorithms?

Cost-cognizant Average Fault Detection Percentage (AFDPc)

Page 38: Hypervolume-based search for test case prioritization - ssbse 2015

Research Questions

RQ1 : What is the cost-effectiveness of HGA, compared to

cost-aware additional greedy algorithms?

Cost-cognizant Average Fault Detection Percentage (AFDPc)

RQ2 : What is the efficiency of HGA, compared to

cost-aware additional greedy algorithms?

Execution time (in seconds)

Page 39: Hypervolume-based search for test case prioritization - ssbse 2015

Design

Comparison with Additional Greedy algorithms

(2Obj and 3Obj)

6 programs from SIR 20 indipendent GA runs

Page 40: Hypervolume-based search for test case prioritization - ssbse 2015

Results RQ1

0

0,1

0,2

0,3

0,4

0,5

0,6

0,7

0,8

0,9

1

bash flex grep printtokens printtokens2 sed

Additional Greedy 2Obj HGA 2Obj

AFD

Pc

Average AFDPc

2-Objective formulation

Page 41: Hypervolume-based search for test case prioritization - ssbse 2015

Results RQ1

0

0,1

0,2

0,3

0,4

0,5

0,6

0,7

0,8

0,9

1

bash flex grep printtokens printtokens2 sed

Additional Greedy 3Obj HGA 3Obj

AFD

Pc

Average AFDPc

3-Objective formulation

Page 42: Hypervolume-based search for test case prioritization - ssbse 2015

Results RQ1

Program 2-Objective 3-Objective

p-value Â12 magnitude p-value Â12 magnitude

bash < 0.01 0.88 Large < 0.01 0.95 Large

flex < 0.01 0.70 Medium < 0.01 0.75 Large

grep < 0.01 0.85 Large < 0.01 0.85 Large

printtokens 1 0.10 Large 1 0.10 Large

printtokens 2 1 0.30 Large 0.73 0.40 Small

sed < 0.01 0.85 Large 0.01 0.80 Large

Page 43: Hypervolume-based search for test case prioritization - ssbse 2015

Average Execution Time

2-Objective formulation

Results RQ2

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

bash flex grep printtokens printtokens2 sed

Additional Greedy 2Obj HGA 2Obj

seco

nd

s

Page 44: Hypervolume-based search for test case prioritization - ssbse 2015

Average Execution Time

3-Objective formulation

Results RQ2

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

bash flex grep printtokens printtokens2 sed

Additional Greedy 3Obj HGA 3Obj

seco

nd

s

Page 45: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 46: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 47: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 48: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 49: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 50: Hypervolume-based search for test case prioritization - ssbse 2015

Summary

Page 51: Hypervolume-based search for test case prioritization - ssbse 2015

3+

Future Work

Investigate the scalability

for up than 3 testing criteria

Page 52: Hypervolume-based search for test case prioritization - ssbse 2015

Future Work

Investigate the scalability

for up than 3 testing criteria

Incorporate diversity as a testing criteria

Page 53: Hypervolume-based search for test case prioritization - ssbse 2015

Future Work

Incorporate diversity as a testing criteria

Apply HGA for other test case

optimization problems

Investigate the scalability

for up than 3 testing criteria

Page 54: Hypervolume-based search for test case prioritization - ssbse 2015

Thank You

for

Your Attention!

Questions?

Dario Di Nucci

University of Salerno

[email protected]

http://www.sesa.unisa.it/people/ddinucci/