SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type

Boosting Search Based Testing by using
Constraint Based Testing
Abdelilah Sakti

Yann-Ga¨l Gu´h´neuc
e
e e

Gilles Pesant

Department of Computer and Software Engineering
´
Ecole Polytechnique de Montr´al, Qu´bec, Canada
e
e

Evaluation
Related work
Conclusions

September 28, 2012
SSBSE, Riva del Garda

Pattern Trace Identification, Detection, and Enhancement in Java
SOftware Cost-effective Change and Evolution Research Lab
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
What is the cost of a
programming error ?
Software testing approaches
for finding errors

What is the cost of a programming error ?
Every year inadequate infrastructure software costs the U.S.
economy around 60 billion $.
1996 : Flight 501 caused the destruction of the
Ariane 5 rocket just 40 seconds after launching.

CBT versus SBT

Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type

Between 1985 and 1987 : the radiotherapy
machine Therac-25 sent to patients a X-ray dose
100 times greater than expected.

Evaluation
Related work
Conclusions

2 / 19

The test is a very important phase in the life cycle of
software. It may cost more than 50 % of the budget of a
critical software.
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
What is the cost of a
programming error ?
Software testing approaches
for finding errors
CBT versus SBT

Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

3 / 19

Software testing approaches for finding errors

Search based testing (SBT)
Was introduced in 1976 by Miller and Spooner ;
Dynamic analysis of the program ;
Consists of translating the test problem into an
optimization problem.

Constraint based testing (CBT)
Was introduced in 1976 by J.C. KING ;
Static analysis of the program ;
Consist of translating a test problem into a constraint
satisfaction problem (CSP).
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
What is the cost of a
programming error ?
Software testing approaches
for finding errors
CBT versus SBT

CBT versus SBT

Search based testing (SBT)
+ Handles any sort of programs ;
- Incomplete
- Depends on many parameters.

Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

4 / 19

Constraint based testing (CBT)
+ Precision in test data generation ;
+ Ability to prove that some paths are unreachable ;
- Not Scalable ;
- The incompleteness of decision procedures.
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Example : foo function

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
1
Introduction

2

Motivating
Example

3

Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing

4
5
6
7
8
9

Implementation for
integer data type

10
11

Evaluation
Related work
Conclusions

5 / 19

12
13
14

int foo(int X, int Y){
if(X<=0 || Y<=0)
return 0;
int Z;
if ((X < Y/2)|| (Y==0))
Z= 1 ; //Target 1
else if (Y>3∗X)
Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied
else{
Z = fun(X,Y); //native function that returns X 2 /Y
if ((Z >8) && (Y==10))
if(Z==Y)
Z=3 ;//Target 3 is a nested branch predicates (10,10)
}
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Example : foo function

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
1
Introduction

2

Motivating
Example

3

Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing

4
5
6
7
8
9

Implementation for
integer data type

10
11

Evaluation
Related work
Conclusions

5 / 19

12
13
14

int foo(int X, int Y){
if(X<=0 || Y<=0)
return 0;
int Z;
if ((X < Y/2)|| (Y==0))
Z= 1 ; //Target 1
else if (Y>3∗X)
Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied
else{
Z = fun(X,Y); //native function that returns X 2 /Y
if ((Z >8) && (Y==10))
if(Z==Y)
Z=3 ;//Target 3 is a nested branch predicates (10,10)
}
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Example : foo function

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
1
Introduction

2

Motivating
Example

3

Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing

4
5
6
7
8
9

Implementation for
integer data type

10
11

Evaluation
Related work
Conclusions

5 / 19

12
13
14

int foo(int X, int Y){
if(X<=0 || Y<=0)
return 0;
int Z;
if ((X < Y/2)|| (Y==0))
Z= 1 ; //Target 1
else if (Y>3∗X)
Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied
else{
Z = fun(X,Y); //native function that returns X 2 /Y
if ((Z >8) && (Y==10))
if(Z==Y)
Z=3 ;//Target 3 is a nested branch predicates (10,10)
}
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Example : foo function

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
1
Introduction

2

Motivating
Example

3

Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing

4
5
6
7
8
9

Implementation for
integer data type

10
11

Evaluation
Related work
Conclusions

5 / 19

12
13
14

int foo(int X, int Y){
if(X<=0 || Y<=0)
return 0;
int Z;
if ((X < Y/2)|| (Y==0))
Z= 1 ; //Target 1
else if (Y>3∗X)
Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied
else{
Z = fun(X,Y); //native function that returns X 2 /Y
if ((Z >8) && (Y==10))
if(Z==Y)
Z=3 ;//Target 3 is a nested branch predicates (10,10)
}
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Example : foo function

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
1
Introduction

2

Motivating
Example

3

Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing

4
5
6
7
8
9

Implementation for
integer data type

10
11

Evaluation
Related work
Conclusions

12
13
14

int foo(int X, int Y){
if(X<=0 || Y<=0)
return 0;
int Z;
if ((X < Y/2)|| (Y==0))
Z= 1 ; //Target 1
else if (Y>3∗X)
Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied
else{
Z = fun(X,Y); //native function that returns X 2 /Y
if ((Z >8) && (Y==10))
if(Z==Y)
Z=3 ;//Target 3 is a nested branch predicates (10,10)
}

Challenge
Combine CBT and SBT to overcome the limitations
associated with each of them.
5 / 19
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

6 / 19

6

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing

6

Implementation for
integer data type

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Example 1 : Constraints solutions in the domain
[−2 × 104 + 1, 2 × 104 ]

Evaluation
Related work

Original version :

Conclusions
1
2
3
4

6 / 19

Unsolvable
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing

6

Implementation for
integer data type

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Example 1 : Constraints solutions in the domain
[−2 × 104 + 1, 2 × 104 ]

Evaluation
Related work

Original version :

Conclusions
1
2
3
4

6 / 19

Unsolvable
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing

6

Implementation for
integer data type

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

1
2
3
4
5
6

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Example 1 : Constraints solutions in the domain
[−2 × 104 + 1, 2 × 104 ]

Evaluation
Related work

Original version :

Conclusions
1
2
3
4

6 / 19

Relaxed version :

Unsolvable
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing

6

Implementation for
integer data type

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Relaxed version :
1
2
3
4
5
6

Example 1 : Constraints solutions in the domain
[−2 × 104 + 1, 2 × 104 ]

Evaluation
Related work

Original version :

Relaxed version :

Conclusions
1

Unsolvable

1

2

2

3

3

4

6 / 19

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

4

x0 ∈ [5, 2 × 104 ]
y0 ∈ [10, 10]
Boosting Search
Based Testing by
using Constraint
Based Testing

Motivating Example
Constraint Based Testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

Example 1 : Generated constraints for Target 3
Original version :
1
2

Motivating
Example

3

Constraint Based Testing

4

Search based testing

5

CSBT :
Constrained Search
Based Testing

6

Implementation for
integer data type

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Relaxed version :
1
2
3
4
5
6

Example 1 : Constraints solutions in the domain
[−2 × 104 + 1, 2 × 104 ]

Evaluation
Related work

Original version :

Relaxed version :

Conclusions
1

Unsolvable

x0 ∈ [5, 2 × 104 ]
y0 ∈ [10, 10]

3

3
4

1
2

2

6 / 19

not((x0 ≤ 0)||(y0 ≤ 0))∧
not((x0 < y0 /2)||(y0 = 0))∧
not(y0 > 3 × x0 )∧
z3 = f un(x0 , y0 )∧
((z3 > 8) ∧ (y0 = 10))∧
(z3 = y0 )

Search space size is (16 × 108 )

4

Search space size is (2 × 104 − 5)
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

7 / 19

Search based testing
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

7 / 19

Search based testing
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

7 / 19

Search based testing
Boosting Search
Based Testing by
using Constraint
Based Testing

Search based testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

7 / 19

Random aspect used to generate the initial population and
also, less often, during the evolution process ;
Boosting Search
Based Testing by
using Constraint
Based Testing

Search based testing

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
Constraint Based Testing
Search based testing

CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

Random aspect used to generate the initial population and
also, less often, during the evolution process ;
Start SBT with some test candidates drawn from CBT is
better than a random initial population.

7 / 19
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

CSBT : Constrained Search Based Testing
Overview

Program input data
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction
Motivating
Example
T1

CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)

T3

Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

T2
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction
Motivating
Example
T1

CSBT :
Constrained Search
Based Testing

R1

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)

T3

Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

R2
T2

Unit Under Test
Relaxation.
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction

×

Motivating
Example
CSBT :
Constrained Search
Based Testing

×

Unit Under Test
Relaxation.

T1

R1

Overview
Unit Under Test Relaxation

×

Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)

T3

Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

×

R2
T2

×
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction

×

Motivating
Example
CSBT :
Constrained Search
Based Testing

×

T1

Unit Under Test
Relaxation.

∗

R1

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

∗ ∗
∗ ∗
R2

×

T3

T2

×

×

Constrained Population
Generator (CPG).
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction

×

Motivating
Example
CSBT :
Constrained Search
Based Testing

×

T1

Unit Under Test
Relaxation.

∗

R1

Overview
Unit Under Test Relaxation

×

Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

∗ ∗
∗
R2
T3

∗

T2

×

×

Constrained Population
Generator (CPG).
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Overview

Program input data

Introduction

×

Motivating
Example
CSBT :
Constrained Search
Based Testing

×

T1

Unit Under Test
Relaxation.

∗

R1

Overview
Unit Under Test Relaxation

×

Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

8 / 19

∗ ∗
∗
R2 ∗

Constrained Population
Generator (CPG).

T3

∗

T2

×

×
Constrained Evolution
Operator (CEO).
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Unit Under Test Relaxation

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing

1. For each data type that needs a different solver a new
relaxed version is created.
2. Any statement over unsupported data type is ignored ;

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

9 / 19

3. Any unsupported expression (function call, operator) is
relaxed ;
4. Any variable assigned inside a loop is relaxed just after
this loop ;
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation
1
2
3

Introduction

4

Motivating
Example

6

CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

10 / 19

5
7
8
9
10

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation
1
2
3

Introduction

4

Motivating
Example

6

CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

10 / 19

5
7
8
9
10

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation
1
2
3

Introduction

4

Motivating
Example

6

CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

10 / 19

5
7
8
9
10

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

1
2
3

Introduction

4

Motivating
Example

6

5
7

CSBT :
Constrained Search
Based Testing

8
9

Overview

10

Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type

1
2
3
4
5

Evaluation

6

Related work

7

Conclusions

8
9
10

10 / 19

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}

intStr(int x,int y,String
S1,String S2) {
x«y;
int y=
int x=y+x/y;
String s=S1+S2;
OK”)
if((s.equals(”
&& (x>0)
&&
s.length()>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

1
2
3

Introduction

4

Motivating
Example

6

5
7

CSBT :
Constrained Search
Based Testing

8
9

Overview

10

Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type

1
2
3
4
5

Evaluation

6

Related work

7

Conclusions

8
9
10

10 / 19

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}

intStr(int x,int y,
){
x«y;
int y=
int x=y+x/y;
;
if((
&& (x>0)
&&
s.length()>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

1
2
3

Introduction

4

Motivating
Example

6

5
7

CSBT :
Constrained Search
Based Testing

8
9

Overview

10

Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type

1
2
3
4
5

Evaluation

6

Related work

7

Conclusions

8
9
10

10 / 19

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}

intStr(int x,int y,
){
;
int y= R1
int x=y+x/y;
;
if((
&& (x>0)
&& R2
>x)
return 1; // Target
return 0;
}
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Example : Unit Under Test Relaxation

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

1
2
3

Introduction

4

Motivating
Example

6

5
7

CSBT :
Constrained Search
Based Testing

8
9

Overview

10

Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type

1
2
3
4
5

Evaluation

6

Related work

7

Conclusions

8
9
10

10 / 19

intStr(int x,int y,String
S1,String S2) {
int y= x«y;
int x=y+x/y;
String s=S1+S2;
if((s.equals(”
OK”
)
&& (x>0)
&& s.length()>x)
return 1; // Target
return 0;
}

intStr(int x,int y,
){
;
int y= R1
int x=y+x/y;
;
if((
&& (x>0)
&& R2
>x)
return 1; // Target
return 0;
}

1
2

intStr(
String S1,String S2) {

3
4

String s=S1+S2;
if(s.equals(”
OK”
))

5
6
7
8

return 1; // Target
return 0;

9
10
11

}
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Constrained Population Generator(CPG)

RV1 (integer)

CSBT :
Constrained Search
Based Testing
Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

11 / 19

RV2 (string)

s21

s31

s22

s32

s11

Introduction
Motivating
Example

RV2 (float)

s12

s13
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Constrained Population Generator(CPG)

RV1 (integer)

CSBT :
Constrained Search
Based Testing

RV2 (string)

s21

s31

s22

s32

s11

Introduction
Motivating
Example

RV2 (float)

s12

s13

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)

Initial Population

Constrained Evolution
Operator (CEO)

Implementation for
integer data type
Evaluation
Related work
Conclusions

11 / 19

s11 , s21 , s31
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

CSBT : Constrained Search Based Testing
Constrained Population Generator(CPG)

RV1 (integer)

RV2 (float)

RV2 (string)

s21

s31

s22

s32

s11

Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing

s12

s13

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)

Initial Population
s11 , s22 , s32

Constrained Evolution
Operator (CEO)
s11 , s21 , s31

s11 , s21 , s32

s11 , s22 , s31

Implementation for
integer data type
s11 , s22 , s32

Evaluation
s11 , s21 , s31

s11 , s21 , s32

s11 , s22 , s31

Related work
s11 , s22 , s32

Conclusions
s11 , s21 , s31

11 / 19

s11 , s21 , s32

s11 , s22 , s31
Boosting Search
Based Testing by
using Constraint
Based Testing

CSBT : Constrained Search Based Testing
Constrained Evolution Operator (CEO)

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction

smallinteger Solver
int

f loat

Motivating
Example
CSBT :
Constrained Search
Based Testing

(val1 , val2 , ? , val4 )

type ?
small

smallfloat Solver

Overview
Unit Under Test Relaxation
Example : Unit Under Test
Relaxation
Constrained Population
Generator(CPG)
Constrained Evolution
Operator (CEO)

smallstring Solver
(val1 , val2 , nval3 , val4 )

Implementation for
integer data type

solvable ?
small

Evaluation
Related work
Conclusions

12 / 19

(val1 , val2 ,nval3 , nval4 )
Boosting Search
Based Testing by
using Constraint
Based Testing

Implementation for integer data type

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

For SBT, CSBT uses eToc [P. Tonella, ISSTA 2004] ;
For CBT, CSBT uses Cp-sst [A. SAKTI, JFPC 2011] ;
13 / 19
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Subjects

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Subjects
Configurations
Results

Related work
Conclusions

14 / 19

Publicly available classes from Java standard library and
Apache Commons project

Subject
Integer
BitSet
ArithmticUtils

# LOC
1244
755
959

# Branches
38
145
102
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Subjects
Configurations

Evaluation
Configurations

analysed approaches
SBT alone : eToc ;
CBT alone : CP-SST ;
CSBT : SBT+CPG ; SBT+CEO ; SBT+CPG+CEO.

Parameters
All default eToc parameters are kept as is.
Integer domain : [−2 × 104 , 2 × 104 ] ;

Results

Related work
Conclusions

15 / 19

Solver time out : 500ms ;
Every approach has been executed 10 times on every
class for a runtime limited at 300 s.
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Results

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

Comparing all techniques on all classes
90

Introduction
Motivating
Example

Implementation for
integer data type
Evaluation
Subjects

80

Branch Coverage %

CSBT :
Constrained Search
Based Testing

70

60

Configurations
Results

Related work

50

SBT
CBT
CPG
CEO
CPG+CEO

Conclusions

40
0

50

100

150
Time (s)

16 / 19

200

250

300
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Results

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

Comparing all techniques on all classes
90

Introduction
Motivating
Example

Implementation for
integer data type
Evaluation
Subjects

80

Branch Coverage %

CSBT :
Constrained Search
Based Testing

70

60

Configurations
Results

Related work

50

SBT
CBT
CPG
CEO
CPG+CEO

Conclusions

40
0

50

100

150
Time (s)

16 / 19

200

250

300
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Results

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

Comparing all techniques on all classes
90

Introduction
Motivating
Example

Implementation for
integer data type
Evaluation
Subjects

80

Branch Coverage %

CSBT :
Constrained Search
Based Testing

70

60

Configurations
Results

Related work

50

SBT
CBT
CPG
CEO
CPG+CEO

Conclusions

40
0

50

100

150
Time (s)

16 / 19

200

250

300
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Results

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

Comparing all techniques on all classes
90

Introduction
Motivating
Example

Implementation for
integer data type
Evaluation
Subjects

80

Branch Coverage %

CSBT :
Constrained Search
Based Testing

70

60

Configurations
Results

Related work

50

SBT
CBT
CPG
CEO
CPG+CEO

Conclusions

40
0

50

100

150
Time (s)

16 / 19

200

250

300
Boosting Search
Based Testing by
using Constraint
Based Testing

Evaluation
Results

Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant

Comparing all techniques on all classes
90

Introduction
Motivating
Example

Implementation for
integer data type
Evaluation
Subjects

80

Branch Coverage %

CSBT :
Constrained Search
Based Testing

70

60

Configurations
Results

Related work

50

SBT
CBT
CPG
CEO
CPG+CEO

Conclusions

40
0

50

100

150
Time (s)

16 / 19

200

250

300
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work

Related work

Using SBT to overcame CBT limits
FLoPSy [K. Lakhotia et al, ICTSS 2010]

Using CBT to overcame SBT limits
Combining search based and constraint based testing.
[Malburg and Fraser, ISSTA 2011] ;
Symbolic search-based testing [M. Harman et al., ASE
2011].

Conclusions

Others
EVACON [T. Xie et al, ASE 2007].

17 / 19
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

Conclusions
CSBT
CPG and CEO are two new techniques for combining
CBT and SBT.
The obtained results are promising but more
experiments must be performed.

Future work
Enhancing our technique CEO.
Extending results by using several solvers at the same
time.
Extending our approach by exploring new combination
techniques.

18 / 19
Boosting Search
Based Testing by
using Constraint
Based Testing
Abdelilah Sakti,
Yann-Ga¨l
e
Gu´h´neuc, Gilles
e e
Pesant
Introduction
Motivating
Example
CSBT :
Constrained Search
Based Testing
Implementation for
integer data type
Evaluation
Related work
Conclusions

19 / 19

Thank you
Questions ?

Mais conteúdo relacionado

Destaque

Destaque (19)

Icsm07 tooldemo.pdf
Icsm07 tooldemo.pdfIcsm07 tooldemo.pdf
Icsm07 tooldemo.pdf
 
Ppap13a.ppt
Ppap13a.pptPpap13a.ppt
Ppap13a.ppt
 
Ssbse12b.ppt
Ssbse12b.pptSsbse12b.ppt
Ssbse12b.ppt
 
Wcre13c.pdf
Wcre13c.pdfWcre13c.pdf
Wcre13c.pdf
 
Ppap13b.ppt
Ppap13b.pptPpap13b.ppt
Ppap13b.ppt
 
Wcre12c.ppt
Wcre12c.pptWcre12c.ppt
Wcre12c.ppt
 
See12.ppt
See12.pptSee12.ppt
See12.ppt
 
Rsse12.ppt
Rsse12.pptRsse12.ppt
Rsse12.ppt
 
Wcre13b.ppt
Wcre13b.pptWcre13b.ppt
Wcre13b.ppt
 
Wcre12b.ppt
Wcre12b.pptWcre12b.ppt
Wcre12b.ppt
 
Mribp13.ppt
Mribp13.pptMribp13.ppt
Mribp13.ppt
 
MSR Asia Summit
MSR Asia SummitMSR Asia Summit
MSR Asia Summit
 
Icsoc12 tooldemo.ppt
Icsoc12 tooldemo.pptIcsoc12 tooldemo.ppt
Icsoc12 tooldemo.ppt
 
Wcre13a.ppt
Wcre13a.pptWcre13a.ppt
Wcre13a.ppt
 
Software Design Patterns in Theory
Software Design Patterns in TheorySoftware Design Patterns in Theory
Software Design Patterns in Theory
 
Quality and Software Design Patterns
Quality and Software Design PatternsQuality and Software Design Patterns
Quality and Software Design Patterns
 
AsianPLoP'14: How and Why Design Patterns Impact Quality and Future Challenges
AsianPLoP'14: How and Why Design Patterns Impact Quality and Future ChallengesAsianPLoP'14: How and Why Design Patterns Impact Quality and Future Challenges
AsianPLoP'14: How and Why Design Patterns Impact Quality and Future Challenges
 
Software Design Patterns in Practice
Software Design Patterns in PracticeSoftware Design Patterns in Practice
Software Design Patterns in Practice
 
Jcom02.ppt
Jcom02.pptJcom02.ppt
Jcom02.ppt
 

Semelhante a Ssbse12a.ppt

Testing survey by_directions
Testing survey by_directionsTesting survey by_directions
Testing survey by_directions
Tao He
 
Dynamic Symbolic Database Application Testing
Dynamic Symbolic Database Application TestingDynamic Symbolic Database Application Testing

Semelhante a Ssbse12a.ppt (20)

Ssbse12a.ppt
Ssbse12a.pptSsbse12a.ppt
Ssbse12a.ppt
 
Cpaior13.ppt
Cpaior13.pptCpaior13.ppt
Cpaior13.ppt
 
Cpaior13.ppt
Cpaior13.pptCpaior13.ppt
Cpaior13.ppt
 
Sbst16 tooldemo.ppt
Sbst16 tooldemo.pptSbst16 tooldemo.ppt
Sbst16 tooldemo.ppt
 
Sbst16 tooldemo.ppt
Sbst16 tooldemo.pptSbst16 tooldemo.ppt
Sbst16 tooldemo.ppt
 
Sbst17 tooldemo.ppt
Sbst17 tooldemo.pptSbst17 tooldemo.ppt
Sbst17 tooldemo.ppt
 
Sbst17 tooldemo.ppt
Sbst17 tooldemo.pptSbst17 tooldemo.ppt
Sbst17 tooldemo.ppt
 
Sbst15 tooldemo.ppt
Sbst15 tooldemo.pptSbst15 tooldemo.ppt
Sbst15 tooldemo.ppt
 
Sbst15 tooldemo.ppt
Sbst15 tooldemo.pptSbst15 tooldemo.ppt
Sbst15 tooldemo.ppt
 
Ssbse11a.ppt
Ssbse11a.pptSsbse11a.ppt
Ssbse11a.ppt
 
Slides for a talk on search-based testing for Event-B models
Slides for a talk on search-based testing for Event-B modelsSlides for a talk on search-based testing for Event-B models
Slides for a talk on search-based testing for Event-B models
 
White-box Unit Test Generation with Microsoft IntelliTest
White-box Unit Test Generation with Microsoft IntelliTestWhite-box Unit Test Generation with Microsoft IntelliTest
White-box Unit Test Generation with Microsoft IntelliTest
 
Examples Implementing Black-Box Discrete Optimization Benchmarking Survey for...
Examples Implementing Black-Box Discrete Optimization Benchmarking Survey for...Examples Implementing Black-Box Discrete Optimization Benchmarking Survey for...
Examples Implementing Black-Box Discrete Optimization Benchmarking Survey for...
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)
 
Testing survey by_directions
Testing survey by_directionsTesting survey by_directions
Testing survey by_directions
 
Dynamic Symbolic Database Application Testing
Dynamic Symbolic Database Application TestingDynamic Symbolic Database Application Testing
Dynamic Symbolic Database Application Testing
 
8. Recursion.pptx
8. Recursion.pptx8. Recursion.pptx
8. Recursion.pptx
 
16May_ICSE_MIP_APR_2023.pptx
16May_ICSE_MIP_APR_2023.pptx16May_ICSE_MIP_APR_2023.pptx
16May_ICSE_MIP_APR_2023.pptx
 
Visual Object Tracking: Action-Decision Networks (ADNets)
Visual Object Tracking: Action-Decision Networks (ADNets)Visual Object Tracking: Action-Decision Networks (ADNets)
Visual Object Tracking: Action-Decision Networks (ADNets)
 
Présentation ifac'17 bouazza
Présentation ifac'17 bouazzaPrésentation ifac'17 bouazza
Présentation ifac'17 bouazza
 

Mais de Ptidej Team

Mais de Ptidej Team (20)

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software Miniaturisation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel Briand
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel Abdellatif
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh Kermansaravi
 
Mouna Abidi
Mouna AbidiMouna Abidi
Mouna Abidi
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel Grichi
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano Politowski
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisis
 
MIPA
MIPAMIPA
MIPA
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.ppt
 
Medicine15.ppt
Medicine15.pptMedicine15.ppt
Medicine15.ppt
 
Qrs17b.ppt
Qrs17b.pptQrs17b.ppt
Qrs17b.ppt
 
Icpc11c.ppt
Icpc11c.pptIcpc11c.ppt
Icpc11c.ppt
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Icsoc15.ppt
Icsoc15.pptIcsoc15.ppt
Icsoc15.ppt
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

Ssbse12a.ppt

  • 1. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti Yann-Ga¨l Gu´h´neuc e e e Gilles Pesant Department of Computer and Software Engineering ´ Ecole Polytechnique de Montr´al, Qu´bec, Canada e e Evaluation Related work Conclusions September 28, 2012 SSBSE, Riva del Garda Pattern Trace Identification, Detection, and Enhancement in Java SOftware Cost-effective Change and Evolution Research Lab
  • 2. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction What is the cost of a programming error ? Software testing approaches for finding errors What is the cost of a programming error ? Every year inadequate infrastructure software costs the U.S. economy around 60 billion $. 1996 : Flight 501 caused the destruction of the Ariane 5 rocket just 40 seconds after launching. CBT versus SBT Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Between 1985 and 1987 : the radiotherapy machine Therac-25 sent to patients a X-ray dose 100 times greater than expected. Evaluation Related work Conclusions 2 / 19 The test is a very important phase in the life cycle of software. It may cost more than 50 % of the budget of a critical software.
  • 3. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction What is the cost of a programming error ? Software testing approaches for finding errors CBT versus SBT Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 3 / 19 Software testing approaches for finding errors Search based testing (SBT) Was introduced in 1976 by Miller and Spooner ; Dynamic analysis of the program ; Consists of translating the test problem into an optimization problem. Constraint based testing (CBT) Was introduced in 1976 by J.C. KING ; Static analysis of the program ; Consist of translating a test problem into a constraint satisfaction problem (CSP).
  • 4. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction What is the cost of a programming error ? Software testing approaches for finding errors CBT versus SBT CBT versus SBT Search based testing (SBT) + Handles any sort of programs ; - Incomplete - Depends on many parameters. Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 4 / 19 Constraint based testing (CBT) + Precision in test data generation ; + Ability to prove that some paths are unreachable ; - Not Scalable ; - The incompleteness of decision procedures.
  • 5. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Example : foo function Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 Introduction 2 Motivating Example 3 Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing 4 5 6 7 8 9 Implementation for integer data type 10 11 Evaluation Related work Conclusions 5 / 19 12 13 14 int foo(int X, int Y){ if(X<=0 || Y<=0) return 0; int Z; if ((X < Y/2)|| (Y==0)) Z= 1 ; //Target 1 else if (Y>3∗X) Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied else{ Z = fun(X,Y); //native function that returns X 2 /Y if ((Z >8) && (Y==10)) if(Z==Y) Z=3 ;//Target 3 is a nested branch predicates (10,10) }
  • 6. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Example : foo function Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 Introduction 2 Motivating Example 3 Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing 4 5 6 7 8 9 Implementation for integer data type 10 11 Evaluation Related work Conclusions 5 / 19 12 13 14 int foo(int X, int Y){ if(X<=0 || Y<=0) return 0; int Z; if ((X < Y/2)|| (Y==0)) Z= 1 ; //Target 1 else if (Y>3∗X) Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied else{ Z = fun(X,Y); //native function that returns X 2 /Y if ((Z >8) && (Y==10)) if(Z==Y) Z=3 ;//Target 3 is a nested branch predicates (10,10) }
  • 7. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Example : foo function Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 Introduction 2 Motivating Example 3 Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing 4 5 6 7 8 9 Implementation for integer data type 10 11 Evaluation Related work Conclusions 5 / 19 12 13 14 int foo(int X, int Y){ if(X<=0 || Y<=0) return 0; int Z; if ((X < Y/2)|| (Y==0)) Z= 1 ; //Target 1 else if (Y>3∗X) Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied else{ Z = fun(X,Y); //native function that returns X 2 /Y if ((Z >8) && (Y==10)) if(Z==Y) Z=3 ;//Target 3 is a nested branch predicates (10,10) }
  • 8. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Example : foo function Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 Introduction 2 Motivating Example 3 Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing 4 5 6 7 8 9 Implementation for integer data type 10 11 Evaluation Related work Conclusions 5 / 19 12 13 14 int foo(int X, int Y){ if(X<=0 || Y<=0) return 0; int Z; if ((X < Y/2)|| (Y==0)) Z= 1 ; //Target 1 else if (Y>3∗X) Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied else{ Z = fun(X,Y); //native function that returns X 2 /Y if ((Z >8) && (Y==10)) if(Z==Y) Z=3 ;//Target 3 is a nested branch predicates (10,10) }
  • 9. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Example : foo function Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 Introduction 2 Motivating Example 3 Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing 4 5 6 7 8 9 Implementation for integer data type 10 11 Evaluation Related work Conclusions 12 13 14 int foo(int X, int Y){ if(X<=0 || Y<=0) return 0; int Z; if ((X < Y/2)|| (Y==0)) Z= 1 ; //Target 1 else if (Y>3∗X) Z=2 ; //Target 2 : (2 ∗ X >= Y ) ∧ (Y > 3 ∗ X) is unsatisfied else{ Z = fun(X,Y); //native function that returns X 2 /Y if ((Z >8) && (Y==10)) if(Z==Y) Z=3 ;//Target 3 is a nested branch predicates (10,10) } Challenge Combine CBT and SBT to overcome the limitations associated with each of them. 5 / 19
  • 10. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 6 / 19 6 not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 )
  • 11. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing 6 Implementation for integer data type not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Example 1 : Constraints solutions in the domain [−2 × 104 + 1, 2 × 104 ] Evaluation Related work Original version : Conclusions 1 2 3 4 6 / 19 Unsolvable
  • 12. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing 6 Implementation for integer data type not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Example 1 : Constraints solutions in the domain [−2 × 104 + 1, 2 × 104 ] Evaluation Related work Original version : Conclusions 1 2 3 4 6 / 19 Unsolvable
  • 13. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing 6 Implementation for integer data type not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) 1 2 3 4 5 6 not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Example 1 : Constraints solutions in the domain [−2 × 104 + 1, 2 × 104 ] Evaluation Related work Original version : Conclusions 1 2 3 4 6 / 19 Relaxed version : Unsolvable
  • 14. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing 6 Implementation for integer data type not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Relaxed version : 1 2 3 4 5 6 Example 1 : Constraints solutions in the domain [−2 × 104 + 1, 2 × 104 ] Evaluation Related work Original version : Relaxed version : Conclusions 1 Unsolvable 1 2 2 3 3 4 6 / 19 not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) 4 x0 ∈ [5, 2 × 104 ] y0 ∈ [10, 10]
  • 15. Boosting Search Based Testing by using Constraint Based Testing Motivating Example Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Example 1 : Generated constraints for Target 3 Original version : 1 2 Motivating Example 3 Constraint Based Testing 4 Search based testing 5 CSBT : Constrained Search Based Testing 6 Implementation for integer data type not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Relaxed version : 1 2 3 4 5 6 Example 1 : Constraints solutions in the domain [−2 × 104 + 1, 2 × 104 ] Evaluation Related work Original version : Relaxed version : Conclusions 1 Unsolvable x0 ∈ [5, 2 × 104 ] y0 ∈ [10, 10] 3 3 4 1 2 2 6 / 19 not((x0 ≤ 0)||(y0 ≤ 0))∧ not((x0 < y0 /2)||(y0 = 0))∧ not(y0 > 3 × x0 )∧ z3 = f un(x0 , y0 )∧ ((z3 > 8) ∧ (y0 = 10))∧ (z3 = y0 ) Search space size is (16 × 108 ) 4 Search space size is (2 × 104 − 5)
  • 16. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 7 / 19 Search based testing
  • 17. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 7 / 19 Search based testing
  • 18. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 7 / 19 Search based testing
  • 19. Boosting Search Based Testing by using Constraint Based Testing Search based testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 7 / 19 Random aspect used to generate the initial population and also, less often, during the evolution process ;
  • 20. Boosting Search Based Testing by using Constraint Based Testing Search based testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example Constraint Based Testing Search based testing CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions Random aspect used to generate the initial population and also, less often, during the evolution process ; Start SBT with some test candidates drawn from CBT is better than a random initial population. 7 / 19
  • 21. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 CSBT : Constrained Search Based Testing Overview Program input data
  • 22. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction Motivating Example T1 CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) T3 Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 T2
  • 23. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction Motivating Example T1 CSBT : Constrained Search Based Testing R1 Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) T3 Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 R2 T2 Unit Under Test Relaxation.
  • 24. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction × Motivating Example CSBT : Constrained Search Based Testing × Unit Under Test Relaxation. T1 R1 Overview Unit Under Test Relaxation × Example : Unit Under Test Relaxation Constrained Population Generator(CPG) T3 Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 × R2 T2 ×
  • 25. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction × Motivating Example CSBT : Constrained Search Based Testing × T1 Unit Under Test Relaxation. ∗ R1 Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 ∗ ∗ ∗ ∗ R2 × T3 T2 × × Constrained Population Generator (CPG).
  • 26. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction × Motivating Example CSBT : Constrained Search Based Testing × T1 Unit Under Test Relaxation. ∗ R1 Overview Unit Under Test Relaxation × Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 ∗ ∗ ∗ R2 T3 ∗ T2 × × Constrained Population Generator (CPG).
  • 27. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Overview Program input data Introduction × Motivating Example CSBT : Constrained Search Based Testing × T1 Unit Under Test Relaxation. ∗ R1 Overview Unit Under Test Relaxation × Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 8 / 19 ∗ ∗ ∗ R2 ∗ Constrained Population Generator (CPG). T3 ∗ T2 × × Constrained Evolution Operator (CEO).
  • 28. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Unit Under Test Relaxation Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing 1. For each data type that needs a different solver a new relaxed version is created. 2. Any statement over unsupported data type is ignored ; Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 9 / 19 3. Any unsupported expression (function call, operator) is relaxed ; 4. Any variable assigned inside a loop is relaxed just after this loop ;
  • 29. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation 1 2 3 Introduction 4 Motivating Example 6 CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 10 / 19 5 7 8 9 10 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; }
  • 30. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation 1 2 3 Introduction 4 Motivating Example 6 CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 10 / 19 5 7 8 9 10 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; }
  • 31. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation 1 2 3 Introduction 4 Motivating Example 6 CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 10 / 19 5 7 8 9 10 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; }
  • 32. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 2 3 Introduction 4 Motivating Example 6 5 7 CSBT : Constrained Search Based Testing 8 9 Overview 10 Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type 1 2 3 4 5 Evaluation 6 Related work 7 Conclusions 8 9 10 10 / 19 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; } intStr(int x,int y,String S1,String S2) { x«y; int y= int x=y+x/y; String s=S1+S2; OK”) if((s.equals(” && (x>0) && s.length()>x) return 1; // Target return 0; }
  • 33. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 2 3 Introduction 4 Motivating Example 6 5 7 CSBT : Constrained Search Based Testing 8 9 Overview 10 Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type 1 2 3 4 5 Evaluation 6 Related work 7 Conclusions 8 9 10 10 / 19 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; } intStr(int x,int y, ){ x«y; int y= int x=y+x/y; ; if(( && (x>0) && s.length()>x) return 1; // Target return 0; }
  • 34. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 2 3 Introduction 4 Motivating Example 6 5 7 CSBT : Constrained Search Based Testing 8 9 Overview 10 Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type 1 2 3 4 5 Evaluation 6 Related work 7 Conclusions 8 9 10 10 / 19 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; } intStr(int x,int y, ){ ; int y= R1 int x=y+x/y; ; if(( && (x>0) && R2 >x) return 1; // Target return 0; }
  • 35. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Example : Unit Under Test Relaxation Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant 1 2 3 Introduction 4 Motivating Example 6 5 7 CSBT : Constrained Search Based Testing 8 9 Overview 10 Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type 1 2 3 4 5 Evaluation 6 Related work 7 Conclusions 8 9 10 10 / 19 intStr(int x,int y,String S1,String S2) { int y= x«y; int x=y+x/y; String s=S1+S2; if((s.equals(” OK” ) && (x>0) && s.length()>x) return 1; // Target return 0; } intStr(int x,int y, ){ ; int y= R1 int x=y+x/y; ; if(( && (x>0) && R2 >x) return 1; // Target return 0; } 1 2 intStr( String S1,String S2) { 3 4 String s=S1+S2; if(s.equals(” OK” )) 5 6 7 8 return 1; // Target return 0; 9 10 11 }
  • 36. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Constrained Population Generator(CPG) RV1 (integer) CSBT : Constrained Search Based Testing Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 11 / 19 RV2 (string) s21 s31 s22 s32 s11 Introduction Motivating Example RV2 (float) s12 s13
  • 37. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Constrained Population Generator(CPG) RV1 (integer) CSBT : Constrained Search Based Testing RV2 (string) s21 s31 s22 s32 s11 Introduction Motivating Example RV2 (float) s12 s13 Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Initial Population Constrained Evolution Operator (CEO) Implementation for integer data type Evaluation Related work Conclusions 11 / 19 s11 , s21 , s31
  • 38. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant CSBT : Constrained Search Based Testing Constrained Population Generator(CPG) RV1 (integer) RV2 (float) RV2 (string) s21 s31 s22 s32 s11 Introduction Motivating Example CSBT : Constrained Search Based Testing s12 s13 Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Initial Population s11 , s22 , s32 Constrained Evolution Operator (CEO) s11 , s21 , s31 s11 , s21 , s32 s11 , s22 , s31 Implementation for integer data type s11 , s22 , s32 Evaluation s11 , s21 , s31 s11 , s21 , s32 s11 , s22 , s31 Related work s11 , s22 , s32 Conclusions s11 , s21 , s31 11 / 19 s11 , s21 , s32 s11 , s22 , s31
  • 39. Boosting Search Based Testing by using Constraint Based Testing CSBT : Constrained Search Based Testing Constrained Evolution Operator (CEO) Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction smallinteger Solver int f loat Motivating Example CSBT : Constrained Search Based Testing (val1 , val2 , ? , val4 ) type ? small smallfloat Solver Overview Unit Under Test Relaxation Example : Unit Under Test Relaxation Constrained Population Generator(CPG) Constrained Evolution Operator (CEO) smallstring Solver (val1 , val2 , nval3 , val4 ) Implementation for integer data type solvable ? small Evaluation Related work Conclusions 12 / 19 (val1 , val2 ,nval3 , nval4 )
  • 40. Boosting Search Based Testing by using Constraint Based Testing Implementation for integer data type Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions For SBT, CSBT uses eToc [P. Tonella, ISSTA 2004] ; For CBT, CSBT uses Cp-sst [A. SAKTI, JFPC 2011] ; 13 / 19
  • 41. Boosting Search Based Testing by using Constraint Based Testing Evaluation Subjects Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Subjects Configurations Results Related work Conclusions 14 / 19 Publicly available classes from Java standard library and Apache Commons project Subject Integer BitSet ArithmticUtils # LOC 1244 755 959 # Branches 38 145 102
  • 42. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Subjects Configurations Evaluation Configurations analysed approaches SBT alone : eToc ; CBT alone : CP-SST ; CSBT : SBT+CPG ; SBT+CEO ; SBT+CPG+CEO. Parameters All default eToc parameters are kept as is. Integer domain : [−2 × 104 , 2 × 104 ] ; Results Related work Conclusions 15 / 19 Solver time out : 500ms ; Every approach has been executed 10 times on every class for a runtime limited at 300 s.
  • 43. Boosting Search Based Testing by using Constraint Based Testing Evaluation Results Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Comparing all techniques on all classes 90 Introduction Motivating Example Implementation for integer data type Evaluation Subjects 80 Branch Coverage % CSBT : Constrained Search Based Testing 70 60 Configurations Results Related work 50 SBT CBT CPG CEO CPG+CEO Conclusions 40 0 50 100 150 Time (s) 16 / 19 200 250 300
  • 44. Boosting Search Based Testing by using Constraint Based Testing Evaluation Results Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Comparing all techniques on all classes 90 Introduction Motivating Example Implementation for integer data type Evaluation Subjects 80 Branch Coverage % CSBT : Constrained Search Based Testing 70 60 Configurations Results Related work 50 SBT CBT CPG CEO CPG+CEO Conclusions 40 0 50 100 150 Time (s) 16 / 19 200 250 300
  • 45. Boosting Search Based Testing by using Constraint Based Testing Evaluation Results Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Comparing all techniques on all classes 90 Introduction Motivating Example Implementation for integer data type Evaluation Subjects 80 Branch Coverage % CSBT : Constrained Search Based Testing 70 60 Configurations Results Related work 50 SBT CBT CPG CEO CPG+CEO Conclusions 40 0 50 100 150 Time (s) 16 / 19 200 250 300
  • 46. Boosting Search Based Testing by using Constraint Based Testing Evaluation Results Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Comparing all techniques on all classes 90 Introduction Motivating Example Implementation for integer data type Evaluation Subjects 80 Branch Coverage % CSBT : Constrained Search Based Testing 70 60 Configurations Results Related work 50 SBT CBT CPG CEO CPG+CEO Conclusions 40 0 50 100 150 Time (s) 16 / 19 200 250 300
  • 47. Boosting Search Based Testing by using Constraint Based Testing Evaluation Results Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Comparing all techniques on all classes 90 Introduction Motivating Example Implementation for integer data type Evaluation Subjects 80 Branch Coverage % CSBT : Constrained Search Based Testing 70 60 Configurations Results Related work 50 SBT CBT CPG CEO CPG+CEO Conclusions 40 0 50 100 150 Time (s) 16 / 19 200 250 300
  • 48. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Related work Using SBT to overcame CBT limits FLoPSy [K. Lakhotia et al, ICTSS 2010] Using CBT to overcame SBT limits Combining search based and constraint based testing. [Malburg and Fraser, ISSTA 2011] ; Symbolic search-based testing [M. Harman et al., ASE 2011]. Conclusions Others EVACON [T. Xie et al, ASE 2007]. 17 / 19
  • 49. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions Conclusions CSBT CPG and CEO are two new techniques for combining CBT and SBT. The obtained results are promising but more experiments must be performed. Future work Enhancing our technique CEO. Extending results by using several solvers at the same time. Extending our approach by exploring new combination techniques. 18 / 19
  • 50. Boosting Search Based Testing by using Constraint Based Testing Abdelilah Sakti, Yann-Ga¨l e Gu´h´neuc, Gilles e e Pesant Introduction Motivating Example CSBT : Constrained Search Based Testing Implementation for integer data type Evaluation Related work Conclusions 19 / 19 Thank you Questions ?