SlideShare a Scribd company logo
1 of 42
Download to read offline
1 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
On the application of SAT solvers for
Search Based Software Testing
Francisco Chicano
Departamento de Lenguajes y Ciencias de la ComputaciĆ³n
Universidad de MƔlaga
Spain
2 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
An optimization problem is a pair: P = (S,f) where:
S is a set of solutions (solution or search space)
f: S ā†’ R is an objective function to minimize or maximize
If our goal is to minimize the function we search for:
Global maximum
Local maximum
Global minimum
Local minimum
sā€™ āˆˆ S | f(sā€™) ā‰¤ f(s), āˆ€s āˆˆ S
Optimization Problem
Search Software Testing SBSE
3 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
In a MO problem there are several objectives (functions) we want to optimize
Multi-Objective Optimization Problem
Search Software Testing SBSE
4 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Optimization Techniques
EXACT APPROXIMATED
AD HOC HEURISTICS METAHEURISTICS
Gradient
Lagrange multipliers
Based on Calculus
Dynamic Programming
Branch and Bound
Enumerative
SA
VNS
TS
Trajectory
EA
ACO
PSO
Population
Optimization Techniques
Search Software Testing SBSE
5 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Pseudocode of a simple EA
Three main steps: selection, reproduction, replacement
Variation operators Ć ļƒ  Make the population to evolve
Recombination: exchange of features
Mutation: generation of new features
P = generateInitialPopulation ();
evaluate (P);
while not stoppingCondition () do
PĀ“ = selectParents (P);
PĀ“ = applyVariationOpterators (PĀ“);
evaluate(PĀ“);
P = selectNewPopulation (P,PĀ“);
end while
return the best solution found
Evolutionary Algorithm
Search Software Testing SBSE
6 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Genetic Algorithms
ā€¢ā€Æ Individuals
ā€¢ā€Æ Recombination
Ā§ļ‚§ā€Æ One point
Ā§ļ‚§ā€Æ Two points
Ā§ļ‚§ā€Æ Uniform
ā€¢ā€Æ Mutation ā†’ bit flips
0111000110
Binary Chromosome
0111000110
1100011001
000110 0111
011001 1100
1001 011010
1010 100101
0111010010 1 0
Evolutionary Algorithm
Search Software Testing SBSE
7 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
ā€¢ā€Æ What is software testing?
ā€“ā€Æ It is the process of running a software product or a portion of it in
a controlled environment with a given input followed by the
collection and analysis of the output and/or other relevant
information of the execution.
ā€¢ā€Æ What is the goal of software testing?
ā€“ā€Æ To find out errors in a portion or the complete software product
and/or to assure with a high probability that the software is
correct (according to the requirements).
Software Testing: Definition and Goal
Search Software Testing SBSE
8 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Software testing is important becauseā€¦
60.000 M$ annually
(0,6% GDP) in USA
Software
errors
60 % of project
cost
Software Testing: Impact
Search Software Testing SBSE
9 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Classification of testing techniques (by goal)
ā€“ā€Æ Unit testing: test one module of the software.
ā€“ā€Æ Integration testing: test the interfaces between different modules in the software.
ā€“ā€Æ System testing: test the complete system.
ā€“ā€Æ Validation testing: test if the software system fulfills the requirements.
ā€“ā€Æ Acceptance testing: the client test whether the system is what s/he wants.
ā€“ā€Æ Regression testing: after a change in the software test whether a new error has
been introduced.
ā€“ā€Æ Stress testing: test the system under a high load
ā€“ā€Æ Load testing: test the response of the system under a normal load of work.
Software Testing: Classification
Search Software Testing SBSE
10 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
1.0, 2.3 Error!
Test case design Test case run Check of results
2.7, 5.4
JUnit, EasyMock,
XMLUnit, Jmeter,
Selenium
Automatic test
case generation
Software Testing: Automatization
Search
Techniques
Search Based
Software Testing
Search Software Testing SBSE
11 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Search Based Software Engineering
Search Based
Software Engineering
(SBSE)
Search Based
Software Testing
Search Software Testing SBSE
12 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Our Research on SBSE
Search Software Testing SBSE
ā€¢ā€ÆSoftware Project Scheduling
ā€¢ā€ÆWhite-box Software Testing
ā€¢ā€ÆTesting of Concurrent Systems (based on Model Checking)
ā€¢ā€ÆTest Sequences for Functional Testing
ā€¢ā€ÆTest Suite Minimization in Regression Testing
ā€¢ā€ÆSoftware Product Lines Testing
ā€¢ā€ÆPrioritized Pairwise Combinatorial Interaction Testing
ā€¢ā€ÆTesting Complexity
13 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Problem Formulation SAT Transf. Results
14 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Test Suite Minimization
Given:
Ƙļƒ˜ā€ÆA set of test cases T = {t1, t2, ..., tn}
Ƙļƒ˜ā€ÆA set of program elements to be covered (e.g., branches) E= {e1, e2, ..., ek}
Ƙļƒ˜ā€ÆA coverage matrix
Find a subset of tests X āŠ† T maximizing coverage and minimizing the testing cost
The single-objective version of this problem consists in ļ¬nding a subset of
sts X āœ“ T with minimum cost covering all the program elements. In formal
rms:
minimize cost(X) =
nX
i=1
ti2X
ci (2)
ubject to:
ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mij = 1.
The multi-objective version of the TSMP does not impose the constraint of
ll coverage, but it deļ¬nes the coverage as the second objective to optimize,
ading to a bi-objective problem. In short, the bi-objective TSMP consists in
nding a subset of tests X āœ“ T having minimum cost and maximum coverage.
ormally:
minimize cost(X) =
nX
i=1
ti2X
ci (3)
maximize cov(X) = |{ej 2 E|9ti 2 X with mij = 1}| (4)
e1 e2 e3 ... ek
t1 1 0 1 ā€¦ 1
t2 0 0 1 ā€¦ 0
ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦
tn 1 1 0 ā€¦ 0
M=
3 Test Suite Minimization Problem
When a piece of software is modiļ¬ed, the new software is tested using
previous test cases in order to check if new errors were introduced. This
is known as regression testing. One problem related to regression testing
Test Suite Minimization Problem (TSMP). This problem is equivalent t
Minimal Hitting Set Problem which is NP-hard [17]. Let T = {t1, t2, Ā· Ā· Ā·
be a set of tests for a program where the cost of running test ti is ci an
E = {e1, e2, Ā· Ā· Ā· , em} be a set of elements of the program that we want to
with the tests. After running all the tests T we ļ¬nd that each test can
several program elements. This information is stored in a matrix M = [m
dimension n ā‡„ m that is deļ¬ned as:
mij =
(
1 if element ej is covered by test ti
0 otherwise
The single-objective version of this problem consists in ļ¬nding a subs
tests X āœ“ T with minimum cost covering all the program elements. In fo
terms:
minimize cost(X) =
nX
i=1
ti2X
ci
subject to:
8ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mi
Yoo & Harman
Problem Formulation SAT Transf. Results
15 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
NP-hard Problems
In many papers we can readā€¦
ā€œOur optimization problem is NP-hard, and for this reason we useā€¦
ā€¦ which do not ensure an optimal solution but they are able to find
good solutions in a reasonable time.ā€
ā€¢ā€Æ Metaheuristic techniques
ā€¢ā€Æ Heuristic algorithms
ā€¢ā€Æ Stochastic algorithms
As far as we know: no efficient (polynomial time) algorithm exists for solving
NP-hard problems
But we know inefficient algorithms (at least exponential time)
Problem Formulation SAT Transf. Results
16 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
The SATisfiability Problem
Can we find an assignment of boolean values (true and false) to the variables
such that all the formulas are satisfied?
The first NP-complete problem (Stephen Cook, 1971)
If it can be solved efficiently (polynomial time) then P=NP
The known algorithms solve this problem in exponential time (worst case)
Nowadays, SAT solvers can solve instances with 500 000 boolean variables
This means a search space of 2500 000 ā‰ˆ 10150514
State-of-the-art algorithms in SAT
Problem Formulation SAT Transf. Results
17 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
The SATisfiability Problem
My favourite
problem
SAT
instance
Use SAT
solvers
Optimal
solution
Main research question:
Can we use the advances of SAT solvers to
solve optimization algorithms up to optimality?
Test Suite
Minimization
Translation to SAT
Algorithms
MiniSAT+
Experimental
Results
Problem Formulation SAT Transf. Results
18 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Outline
Original
TSM
Instance
PB
Constraints
SAT
Instance
F. Arito et al., SSBSE 2012
Problem Formulation SAT Transf. Results
19 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Pseudo-Boolean Constraints
A Pseudo-Boolean (PB) constraint has the form:
der to use SAT solvers to solve optimization problems,
ate the constraints f(y) ļ£æ B to Boolean formulas. To
f Pseudo-Boolean constraint plays a main role. A Pseudo
t is an inequality on a linear combination of Boolean va
nX
i=1
aixi B
2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB co
isļ¬ed under an assignment if the sum of the coe cient
tisļ¬es the relational operator with respect to B.
nstraints can be translated into SAT instances. The simpl
the PB constraint to an equivalent Boolean formula w
The main drawback of these approaches is that the num
grows exponentially with respect to the variables. In
2 2
...
fm(y) ļ£æ Bm
er to use SAT solvers to solve optimization problems, we sti
te the constraints f(y) ļ£æ B to Boolean formulas. To this a
Pseudo-Boolean constraint plays a main role. A Pseudo-Boolea
is an inequality on a linear combination of Boolean variables:
nX
i=1
aixi B
2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB constraint
sļ¬ed under an assignment if the sum of the coe cients ai for
isļ¬es the relational operator with respect to B.
nstraints can be translated into SAT instances. The simplest appr
the PB constraint to an equivalent Boolean formula with th
The main drawback of these approaches is that the number of
where
.
fm(y) ļ£æ Bm
In order to use SAT solvers to solve opti
to translate the constraints f(y) ļ£æ B to Bo
concept of Pseudo-Boolean constraint plays a m
constraint is an inequality on a linear combina
nX
i=1
aixi B
where 2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and x
to be satisļ¬ed under an assignment if the sum
xi = 1 satisļ¬es the relational operator with
PB constraints can be translated into SAT in
translate the PB constraint to an equivalent
variables. The main drawback of these approac
generated grows exponentially with respect t
f2(y) ļ£æ B2
...
fm(y) ļ£æ Bm
order to use SAT solvers to solve optimization problems, we
slate the constraints f(y) ļ£æ B to Boolean formulas. To this
of Pseudo-Boolean constraint plays a main role. A Pseudo-Boo
int is an inequality on a linear combination of Boolean variable
nX
i=1
aixi B
2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB constra
atisļ¬ed under an assignment if the sum of the coe cients ai
satisļ¬es the relational operator with respect to B.
constraints can be translated into SAT instances. The simplest ap
te the PB constraint to an equivalent Boolean formula with
es. The main drawback of these approaches is that the number
Can be translated to SAT instances (usually efficient)
Are a higher level formalism to specify a decision problem
Can be the input for MiniSAT+
Problem Formulation SAT Transf. Results
20 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Translating Optimization to Decision Problems
Let us assume we want to minimize f(x)
B
f(x) ļ£æ B
Check
B B B
f(x) ļ£æ B
Check
f(x) ļ£æ B
Check
f(x) ļ£æ B
Check
no no no yes
Optimal solution found
The same can be done with multi-objective problems, but we need more
PB constraints
s of generality that we want to ļ¬nd a solution xā‡¤
2 X
, f(xā‡¤
) ļ£æ f(x) for all the solutions x 2 X. This opti-
transformed in a series of decision problems in which
lution y 2 X for which the constraint f(y) ļ£æ B holds,
nt integer values. This series of decision problems can
l (minimal) solution of the optimization problem. The
ows. We start with a value of B low enough for the
be. We solve the decision problem to check that it is
ter a loop in which the value of B is increased and the
n. The loop is repeated until the result is satisļ¬able.
e value of B is the minimal value of f in the search
the decision problem is an optimal solution of the
blem has several objective functions f1, f2, . . . , fm to
nstraint for each objective function:
f1(y) ļ£æ B1
f2(y) ļ£æ B2
.
ose without loss of generality that we want to ļ¬nd a solution xā‡¤
2 X
izes3
f, that is, f(xā‡¤
) ļ£æ f(x) for all the solutions x 2 X. This opti-
oblem can be transformed in a series of decision problems in which
ve is to ļ¬nd a solution y 2 X for which the constraint f(y) ļ£æ B holds,
Z takes diā†µerent integer values. This series of decision problems can
ļ¬nd the optimal (minimal) solution of the optimization problem. The
ould be as follows. We start with a value of B low enough for the
o be unsatisļ¬abe. We solve the decision problem to check that it is
e. Then, we enter a loop in which the value of B is increased and the
s checked again. The loop is repeated until the result is satisļ¬able.
oop ļ¬nishes, the value of B is the minimal value of f in the search
the solution to the decision problem is an optimal solution of the
n problem.
ptimization problem has several objective functions f1, f2, . . . , fm to
we need one constraint for each objective function:
f1(y) ļ£æ B1
f2(y) ļ£æ B2
...
that minimizes3
f, that is, f(xā‡¤
) ļ£æ f(x) for all the solutions x 2 X
mization problem can be transformed in a series of decision problem
the objective is to ļ¬nd a solution y 2 X for which the constraint f(y)
where B 2 Z takes diā†µerent integer values. This series of decision pr
be used to ļ¬nd the optimal (minimal) solution of the optimization pr
procedure could be as follows. We start with a value of B low eno
constraint to be unsatisļ¬abe. We solve the decision problem to chec
unsatisļ¬able. Then, we enter a loop in which the value of B is increa
constraint is checked again. The loop is repeated until the result is
Once the loop ļ¬nishes, the value of B is the minimal value of f in
space and the solution to the decision problem is an optimal solu
optimization problem.
If the optimization problem has several objective functions f1, f2
minimize, we need one constraint for each objective function:
f1(y) ļ£æ B1
f2(y) ļ£æ B2
...
fm(y) ļ£æ Bm
In order to use SAT solvers to solve optimization problems, w
ā€¦
Problem Formulation SAT Transf. Results
21 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
PB Constraints for the TSM Problem
e1 e2 e3 ... em
t1 1 0 1 ā€¦ 1
t2 0 0 1 ā€¦ 0
ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦
tn 1 1 0 ā€¦ 0
M=
previous test cases in order to check if new errors were introduced. This
is known as regression testing. One problem related to regression testing
Test Suite Minimization Problem (TSMP). This problem is equivalent t
Minimal Hitting Set Problem which is NP-hard [17]. Let T = {t1, t2, Ā· Ā· Ā·
be a set of tests for a program where the cost of running test ti is ci an
E = {e1, e2, Ā· Ā· Ā· , em} be a set of elements of the program that we want to
with the tests. After running all the tests T we ļ¬nd that each test can
several program elements. This information is stored in a matrix M = [m
dimension n ā‡„ m that is deļ¬ned as:
mij =
(
1 if element ej is covered by test ti
0 otherwise
The single-objective version of this problem consists in ļ¬nding a subs
tests X āœ“ T with minimum cost covering all the program elements. In fo
terms:
minimize cost(X) =
nX
i=1
ti2X
ci
subject to:
8ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mi
The multi-objective version of the TSMP does not impose the constra
full coverage, but it deļ¬nes the coverage as the second objective to opti
leading to a bi-objective problem. In short, the bi-objective TSMP consi
ļ¬nding a subset of tests X āœ“ T having minimum cost and maximum cove
Formally:
n
ase is not included. We also introduce m binary variables e
ch program element to cover. If ej = 1 then the correspondin
by one of the selected test cases and if ej = 0 the elem
y a selected test case.
lues of the ej variables are not independent of the ti variable
j must be 1 if and only if there exists a ti variable for whic
1. The dependence between both sets of variables can be wr
ing 2m PB constraints:
ej ļ£æ
nX
i=1
mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ m.
n see that if the sum in the middle is zero (no test is co
j) then the variable ej = 0. However, if the sum is greater
ow we need to introduce a constraint related to each objectiv
o transform the optimization problem in a decision probl
in Section 2.2. These constraints are:
variables are not independent of the ti variables. A given
and only if there exists a ti variable for which mij = 1
ence between both sets of variables can be written with
nstraints:
nX
i=1
mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ m. (5)
the sum in the middle is zero (no test is covering the
ariable ej = 0. However, if the sum is greater than zero
introduce a constraint related to each objective function
the optimization problem in a decision problem, as we
. These constraints are:
nX
i=1
citi ļ£æ B, (6)
mX
the following 2m PB constraints:
ej ļ£æ
nX
i=1
mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ
We can see that if the sum in the middle is zero (no
element ej) then the variable ej = 0. However, if the sum
ej = 1. Now we need to introduce a constraint related to ea
in order to transform the optimization problem in a dec
described in Section 2.2. These constraints are:
nX
i=1
citi ļ£æ B,
mX
j=1
ej P,
Cost Coverage
Problem Formulation SAT Transf. Results
22 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Example
e
ough a small example how to model with PB con-
SMP according to the methodology above described.
E = {e1, e2, e3, e4} and M:
e1 e2 e3 e4
t1 1 0 1 0
t2 1 1 0 0
t3 0 0 1 0
t4 1 0 0 0
t5 1 0 0 1
t6 0 1 1 0
-obj TSMP we need to instantiate Eqs. (5), (6) and
ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1 (10)
ļ£æ t2 + t6 ļ£æ 4e2 (11)
ļ£æ t1 + t3 + t6 ļ£æ 4e3 (12)
ļ£æ t5 ļ£æ 4e4 (13)
t5 1 0 0 1
t6 0 1 1 0
If we want to solve the 2-obj TSMP we need to instantia
(7). The result is:
e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1
e2 ļ£æ t2 + t6 ļ£æ 4e2
e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3
e4 ļ£æ t5 ļ£æ 4e4
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
e1 + e2 + e3 + e4 P
where P, B 2 N.
If we are otherwise interested in the 1-obj version the form
t1 + t2 + t4 + t5 1
t2 + t6 1
t1 + t3 + t6 1
t5 1
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
(7). The result is:
e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1
e2 ļ£æ t2 + t6 ļ£æ 4e2
e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3
e4 ļ£æ t5 ļ£æ 4e4
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
e1 + e2 + e3 + e4 P
where P, B 2 N.
If we are otherwise interested in the 1-obj version th
t1 + t2 + t4 + t5 1
t2 + t6 1
t1 + t3 + t6 1
t5 1
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
e2 ļ£æ t2 + t6 ļ£æ 4e2
e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3
e4 ļ£æ t5 ļ£æ 4e4
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
e1 + e2 + e3 + e4 P
where P, B 2 N.
If we are otherwise interested in the 1-obj version the for
t1 + t2 + t4 + t5 1
t2 + t6 1
t1 + t3 + t6 1
t5 1
t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B
Bi-objective problem
Single-objective problem
(total coverage)
f(x) ļ£æ B
e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 6e1
e2 ļ£æ t2 + t6 ļ£æ 6e2
e3 ļ£æ t1 + t3 + t6 ļ£æ 6e3
e4 ļ£æ t5 ļ£æ 6e4
Problem Formulation SAT Transf. Results
23 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Algorithm for Solving the 2-obj TSM
Cost
Coverage
Total coverage
With coverage=|E| increase cost until success
Decrease cost and find
the maximum coverage
again
and again
Problem Formulation SAT Transf. Results
24 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Instances from the Software-artifact Infrastructure Repository (SIR)
TSM Instances
The result is an instance with fewer test cases but having the same P
These transformed instances were solved using Algorithm 2. Table
size of the test suites with and without the reduction for each progr
observe a really great reduction in the number of test cases when t
approach is used.
Table 1: Details of the instances used in the experiments
Instance Original Size Reduced Size Elements to co
printtokens 4130 40
printtokens2 4115 28
replace 5542 215
schedule 2650 4
schedule2 2710 13
tcas 1608 5
totinfo 1052 21
In Table 2 we present the Pareto optimal set and the Pareto fr
t is an instance with fewer test cases but having the same Pareto front.
nsformed instances were solved using Algorithm 2. Table 1 shows the
e test suites with and without the reduction for each program. We can
really great reduction in the number of test cases when the previous
is used.
Table 1: Details of the instances used in the experiments
stance Original Size Reduced Size Elements to cover
rinttokens 4130 40 195
rinttokens2 4115 28 192
eplace 5542 215 208
chedule 2650 4 126
chedule2 2710 13 119
cas 1608 5 54
otinfo 1052 21 117
ble 2 we present the Pareto optimal set and the Pareto front for the
Tests
http://sir.unl.edu/portal/index.php !
Cost of each test: 1
Problem Formulation SAT Transf. Results
25 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Pareto Front
80
82.5
85
87.5
90
92.5
95
97.5
100
0 1 2 3 4 5 6 7 8 9
coveragelevel
number of test cases
Pareto front
printtokens
printtokens2
replace
schedule
schedule2
tcas
totinfo
printtokens
printtokens2
replace
schedule
schedule2
tcas
totinfo
The result is an instance with fewer test cases but having the same Pareto front.
These transformed instances were solved using Algorithm 2. Table 1 shows the
size of the test suites with and without the reduction for each program. We can
observe a really great reduction in the number of test cases when the previous
approach is used.
Table 1: Details of the instances used in the experiments
Instance Original Size Reduced Size Elements to cover
printtokens 4130 40 195
printtokens2 4115 28 192
replace 5542 215 208
schedule 2650 4 126
schedule2 2710 13 119
tcas 1608 5 54
totinfo 1052 21 117
In Table 2 we present the Pareto optimal set and the Pareto front for the
instances described above. The columns ā€œTestsā€ and ā€œElementsā€ correspond to
the functions cost and cov of the 2-obj TSMP. The column ā€œCoverageā€ is the
number of covered elements divided by the total number of elements. The optimal
solution for the 1-obj TSMP can be found in the lines with 100% coverage,
as explained in Section 3. It is not common to show the Pareto optimal set
or the Pareto front in numbers in the multi-objective literature because only
approximate Pareto fronts can be obtained for NP-hard problems. However, in
this case we obtain the exact Pareto fronts and optimal sets, so we think that this
The result is an instance with fewer test cases but having the same Pareto front.
These transformed instances were solved using Algorithm 2. Table 1 shows the
size of the test suites with and without the reduction for each program. We can
observe a really great reduction in the number of test cases when the previous
approach is used.
Table 1: Details of the instances used in the experiments
Instance Original Size Reduced Size Elements to cover
printtokens 4130 40 195
printtokens2 4115 28 192
replace 5542 215 208
schedule 2650 4 126
schedule2 2710 13 119
tcas 1608 5 54
totinfo 1052 21 117
In Table 2 we present the Pareto optimal set and the Pareto front for the
instances described above. The columns ā€œTestsā€ and ā€œElementsā€ correspond to
the functions cost and cov of the 2-obj TSMP. The column ā€œCoverageā€ is the
number of covered elements divided by the total number of elements. The optimal
solution for the 1-obj TSMP can be found in the lines with 100% coverage,
as explained in Section 3. It is not common to show the Pareto optimal set
or the Pareto front in numbers in the multi-objective literature because only
approximate Pareto fronts can be obtained for NP-hard problems. However, in
this case we obtain the exact Pareto fronts and optimal sets, so we think that this
80
0 1 2 3
tcas
Fig. 1: Pareto fron
Table 3: Information about clauses-t
gorithm 2, average coverage and num
rithms for the instances from SIR.
Instance Ratio Algorithm 2
Original (s) Reduced (
printtokens 4.61 3400.74 2.1
printtokens2 4.61 3370.44 1.4
replace 4.62 1469272.00 345.6
schedule 2.19 492.38 0.2
schedule2 4.61 195.55 0.2
tcas 4.61 73.44 0.3
totinfo 4.53 181823.50 0.9
independent runs. However, the requ
printtokens, printtokens2 and re
rest of the programs. However, we sh
the result is an optimal solution, as
Tests Time
Problem Formulation SAT Transf. Results
26 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Pareto Front Table 2: Pareto optimal set and Front for the instances of SIR.
Instance Elements Tests Coverage Solution
printtokens 195 5 100% (t2222, t2375, t3438, t4100, t4101)
194 4 99.48% (t1908, t2375, t4099, t4101)
192 3 98.46% (t1658, t2363, t4072)
190 2 97.43% (t1658, t3669)
186 1 95.38% (t2597)
printtokens2 192 4 100% (t2521, t2526, t4085, t4088)
190 3 98.95% (t457, t3717, t4098)
188 2 97.91% (t2190, t3282)
184 1 95.83% (t3717)
replace 208 8 100% (t306, t410, t653, t1279, t1301, t3134, t4057, t4328)
207 7 99.51% (t309, t358, t653, t776, t1279, t1795, t3248)
206 6 99.03% (t275, t290, t1279, t1938, t2723, t2785)
205 5 98.55% (t426, t1279, t1898, t2875, t3324)
203 4 97.59% (t298, t653, t3324, t5054)
200 3 96.15% (t2723, t2901, t3324)
195 2 93.75% (t358, t5387)
187 1 89.90% (t358)
schedule 126 3 100% (t1403, t1559, t1564)
124 2 98.41% (t1570, t1595)
122 1 96.82% (t1572)
schedule2 119 4 100% (t2226, t2458, t2462, t2681)
118 3 99.15% (t101, t1406, t2516)
117 2 98.31% (t2461, t2710)
116 1 97.47% (t1584)
tcas 54 4 100% (t5, t1191, t1229, t1608)
53 3 98.14% (t13, t25, t1581)
50 2 92.59% (t72, t1584)
44 1 81.48% (t217)
totinfo 117 5 100% (t62, t118, t218, t1000, t1038)
115 4 98.29% (t62, t118, t913, t1016)
113 3 96.58% (t65, t216, t913)
111 2 94.87% (t65, t919)
110 1 94.01% (t179)
Problem Formulation SAT Transf. Results
27 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Reduction in the Number of Test Cases
Since we are considering cost 1 for the tests, we can apply an a priori reduction
in the original test suite
e1 e2 e3 ... em
t1 1 0 0 ā€¦ 1
t2 1 0 1 ā€¦ 1
ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦
tn 1 1 0 ā€¦ 0
Test t1 can be removedThe result is an instance with fewer test cases but having the same Pareto front.
These transformed instances were solved using Algorithm 2. Table 1 shows the
size of the test suites with and without the reduction for each program. We can
observe a really great reduction in the number of test cases when the previous
approach is used.
Table 1: Details of the instances used in the experiments
Instance Original Size Reduced Size Elements to cover
printtokens 4130 40 195
printtokens2 4115 28 192
replace 5542 215 208
schedule 2650 4 126
schedule2 2710 13 119
tcas 1608 5 54
totinfo 1052 21 117
Problem Formulation SAT Transf. Results
28 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Results with the Reduction
The optimal Pareto Front for the reduced test suite can be found from 200 to
180 000 times faster
Table 3: Information about clauses-to-variab
gorithm 2, average coverage and number of te
rithms for the instances from SIR.
Instance Ratio Algorithm 2
Original (s) Reduced (s) Avg.
printtokens 4.61 3400.74 2.17 100
printtokens2 4.61 3370.44 1.43 100
replace 4.62 1469272.00 345.62 100
schedule 2.19 492.38 0.24 100
schedule2 4.61 195.55 0.27 100
tcas 4.61 73.44 0.33 100
totinfo 4.53 181823.50 0.96 100
Problem Formulation SAT Transf. Results
29 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Background Testing SAT Transform. Results
R. Lopez-Herrejon et al., ICSM 2013
30 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Software Product Lines
A product line is a set of related products developed from a shared set of assets
ā€¢ā€Æ The products have similar characteristics
ā€¢ā€Æ The products have unique characteristics
Advantages
ā€¢ā€Æ Support customization
ā€¢ā€Æ Improves reuse
ā€¢ā€Æ Reduce time to market
Product Lines are Pervasive
19
BMW Car Configurator
Ā© RELH
Background Testing SAT Transform. Results
31 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Software Product Lines
In Software Product Lines the product is Software
They are modelled using Feature Models
Background Testing SAT Transform. Results
32 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Feature Models
Fig. 1. Graph Product Line Feature Model
Mandatory features Optional features
Exclusive-or
relations
Inclusive-or
relations
Cross-tree constraints
Graph Product Line Feature Model
Background Testing SAT Transform. Results
33 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of Software Product Lines
Fig. 1. Graph Product Line Feature Model
In a feature model, each feature (except the root) has one
parent feature and can have a set of child features. Notice
here that a child feature can only be included in a feature
combination of a valid product if its parent is included as
well. The root feature is always included. There are four kinds
of feature relationships: i) Mandatory features are depicted
with a ļ¬lled circle. A mandatory feature is selected whenever
its respective parent feature is selected. For example, features
Driver and GraphType, ii) Optional features are depicted
with an empty circle. An optional feature may or may not
be selected if its respective parent feature is selected. An
example is feature Weight, iii) Exclusive-or relations are
depicted as empty arcs crossing over a set of lines connecting
a parent feature with its child features. They indicate that
exactly one of the features in the exclusive-or group must be
selected whenever the parent feature is selected. For example,
if feature Search is selected, then either feature DFS or
feature BFS must be selected, iv) Inclusive-or relations are
depicted as ļ¬lled arcs crossing over a set of lines connecting
a parent feature with its child features. They indicate that
at least one of the features in the inclusive-or group must
be selected if the parent is selected. If for instance, feature
Algorithms is selected then at least one of the features Num,
CC, SCC, Cycle, Shortest, Prim, and Kruskal must
be selected. Besides the parent-child relations, features can
also relate across different branches of the feature model with
the so called Cross-Tree Constraints (CTC). Figure 1 shows
some of the CTCs of our feature model2
. For instance, Cycle
requires DFS means that whenever feature Cycle is
an
co
pr
an
co
by
m
va
al
w
of
of
{0
xi
co
w
bo
C
w
pr
ea
de
W
co
The GPL Feature Model is small: 73 distinct products
But the number of products grows exponentially with the
number of featuresā€¦
ā€¦ and testing each particular product is not viable
Background Testing SAT Transform. Results
34 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Combinatorial Interaction Testing
Assuming each features has been tested in isolation, most of the defects come
from the interaction between features
Combinatorial Interaction Testing consists in selecting the minimum number of
products that covers all t-wise interactions (t-wise coverage).
ZipMe
Compress Extract Checksum Adapt GZIP ArchCheck CRC
āœ” āœ” āœ” āœ” āœ”
āœ” āœ” āœ”
āœ” āœ” āœ” āœ”
āœ” āœ” āœ” āœ”
āœ” āœ” āœ”
āœ” āœ” āœ” āœ”
1
2
3
4
5
6
64 productsExample: 2-wise
ICPL
CASA
Background Testing SAT Transform. Results
35 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Multi-Objective Formulation
If we donā€™t have the resources to run all the tests, which one to choose?
Multi-objective formulation:
minimize the number of products
maximize the coverage (t-wise interactions)
The solution is not anymore a table of products, but a Pareto set
by the number of variables dj,k,l that
as:
1X
=1
fX
k=j+1
3X
l=0
dj,k,l (7)
rogram is composed of the goal (7)
(f 1) constraints given by (2) to (6)
he FM expressed with the inequalities
e number of variables of the program
). The solution to this zero-one linear
with the maximum coverage that can
ucts.
ALGORITHM
e for obtaining the optimal Pareto set
This algorithm takes as input the FM
l Pareto set. It starts by adding to the
always in the set: the empty solution
one arbitrary solution (with coverage
ons of the set of features). After that
h successive zero-one linear programs
creasing number of products starting
l model is solved using a extended
. This solver provides a test suite with
This solution is stored in the optimal
m stops when adding a new product to
crease the coverage. The result is the
EXPERIMENTS
s how the evaluation was carried out
sis. The experimental corpus of our
y a benchmark of 118 feature models,
ts ranges from 16 to 640 products, that
om the SPL Conqueror [16] and the
s. The objectives to optimize are the
//minisat.se/MiniSat+.html
want the algorithm to be as fast as possible. For comparison
these experiments were run in a cluster of 16 machines with
Intel Core2 Quad processors Q9400 at 2.66 GHz and 4 GB
running Ubuntu 12.04.1 LTS managed by the HT Condor 7.8.4
manager. Each experiment was executed in one core.
We computed the Pareto optimal front for each model.
Figure 2 shows this front for our running example GPL,
where the total coverage is obtained with 12 products, and
for every test suite size the obtained coverage is also optimal.
As our approach is able to compute the Pareto optimal front
for every feature model in our corpus, it makes no sense to
analyze the quality of the solutions. Instead, we consider more
interesting to study the scalability of our approach. For that,
we analyzed the execution time of the algorithm as a function
of the number of products represented by the feature model as
shown in Figure 3. In this ļ¬gure we can observe a tendency:
the higher the number of products, the higher the execution
time. Although it cannot be clearly appreciated in the ļ¬gure,
the execution time does not grow linearly with the number of
products, the growth is faster than linear.
Fig. 2. Pareto optimal front for our running example (GPL).
GPL
2-wise interactions
Background Testing SAT Transform. Results
36 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Approach
Original
SPLT
Instance
PB
Constraints
SAT
Instance
Background Testing SAT Transform. Results
37 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Approach
Modelling SPLT using PseudoBoolean constraints
All the variables are boolean {0,1}
The values of the signature are:
ā€“ā€Æ 00 (both unselected)
ā€“ā€Æ 10 (only first selected)
ā€“ā€Æ 01 (only second selected)
ā€“ā€Æ 11 (both selected)
1 Variables
Variable Meaning
xp,i Presence of feature i in product p
cp,i,j,k Product p covers the pair (i, j) with signature k
di,j,k The pair (i, j) with signature k is covered by some product
k takes values 0, 1, 2 and 3.
2 Equations
For each p:
The equations related to the constraints of the model
For all p, i and j:
2cp,i,j,3 ļ£æ xp,i + xp,j ļ£æ 1 + cp,i,j,3 (1
Background Testing SAT Transform. Results
38 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Approach
Equations of the model
ā€“ā€Æ For each product p
ā€¢ā€Æ Constraints imposed by the Feature Model
ā€“ā€Æ For each product p and pair of features i and j
tions
ions related to the constraints of the model
i and j:
2cp,i,j,3 ļ£æ xp,i + xp,j ļ£æ 1 + cp,i,j,3
2cp,i,j,2 ļ£æ xp,i + (1 xp,j) ļ£æ 1 + cp,i,j,3
2cp,i,j,1 ļ£æ (1 xp,i) + xp,j ļ£æ 1 + cp,i,j,3
2cp,i,j,0 ļ£æ (1 xp,i) + (1 xp,j) ļ£æ 1 + cp,i,j,3
and k:
Background Testing SAT Transform. Results
39 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Approach
Equations of the model (cont.)
ā€“ā€Æ For each pair of features i and j and signature k
ā€¢ā€Æ n is the number of products
ā€“ā€Æ Objective: maximize coverage
2cp,i,j,0 ļ£æ (1 xp,i) + (1 xp,j) ļ£æ 1 + cp,i,j,3
nd k:
di,j,k ļ£æ
X
p
cp,i,j,k ļ£æ ndi,j,k
umber of products
max :
X
i,j,k
di,j,k
k:
di,j,k ļ£æ
X
p
cp,i,j,k ļ£æ ndi,j,k
mber of products
max :
X
i,j,k
di,j,k
Background Testing SAT Transform. Results
40 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Approach
ļ£æ f:
,k,0 (2)
(3)
(4)
(5)
product.
when all
d dj,k,l,
k with
herwise.
he dj,k,l
lities for
Algorithm 1 Algorithm for obtaining the optimal Pareto set.
optimal set {;};
cov[0] 0;
cov[1] Cf
2 ;
sol arbitraryValidSolution(fm);
i 1;
while cov[i] 6= cov[i 1] do
optimal set optimal set [ {sol};
i i + 1;
m prepareMathModel(fm,i);
sol solveMathModel(m);
cov[i] |sol|;
end while
number of products required to test the SPL and the achieved
Background Testing SAT Transform. Results
41 / 42Polytechnique MontrƩal, July 10, 2014
Introduction
Test Suite
Minimization
Software
Product Lines
Testing of SPLs: Results
of the redundant constraints can incr
adding more constraints could help th
a solution. We plan to study the right b
and augmenting constraints. Second,
feature models to further study the sca
ACKNOWLEDGEME
Funded by Austrian Science Fund
N15 and Lise Meitner Fellowship M
Ministry of Economy and Competitive
contract TIN2011-28194 and fellowsh
REFERENCES
[1] P. Zave, ā€œFaq sheet on
http://www.research.att.com/ pamela/faq.h
[2] K. Pohl, G. Bockle, and F. J. van der L
Engineering: Foundations, Principles and
Experiments on 118 feature models taken from
SPLOT repository (http://www.splot-research.org)
SPL Conqueror (http://wwwiti.cs.uni-magdeburg.de/~nsiegmun/SPLConqueror/)
16 to 640 products
Intel Core2 Quad Q9400
2.66 GHz, 4 GB
Background Testing SAT Transform. Results
42 / 42Polytechnique MontrƩal, July 10, 2014
Thanks for your attention !!!
On the application of SAT solvers for
Search Based Software Testing

More Related Content

What's hot

Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
catherinewall
Ā 
Experimental design
Experimental designExperimental design
Experimental design
Dan Toma
Ā 
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
Chakkrit (Kla) Tantithamthavorn
Ā 
Towards a Better Understanding of the Impact of Experimental Components on De...
Towards a Better Understanding of the Impact of Experimental Components on De...Towards a Better Understanding of the Impact of Experimental Components on De...
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
Ā 
Industry-Academia Communication In Empirical Software Engineering
Industry-Academia Communication In Empirical Software EngineeringIndustry-Academia Communication In Empirical Software Engineering
Industry-Academia Communication In Empirical Software Engineering
Per Runeson
Ā 

What's hot (20)

[Tho Quan] Fault Localization - Where is the root cause of a bug?
[Tho Quan] Fault Localization - Where is the root cause of a bug?[Tho Quan] Fault Localization - Where is the root cause of a bug?
[Tho Quan] Fault Localization - Where is the root cause of a bug?
Ā 
Experiments on Design Pattern Discovery
Experiments on Design Pattern DiscoveryExperiments on Design Pattern Discovery
Experiments on Design Pattern Discovery
Ā 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
Ā 
Evolutionary Search Techniques with Strong Heuristics for Multi-Objective Fea...
Evolutionary Search Techniques with Strong Heuristics for Multi-Objective Fea...Evolutionary Search Techniques with Strong Heuristics for Multi-Objective Fea...
Evolutionary Search Techniques with Strong Heuristics for Multi-Objective Fea...
Ā 
Ssbse12b.ppt
Ssbse12b.pptSsbse12b.ppt
Ssbse12b.ppt
Ā 
Using Developer Information as a Prediction Factor
Using Developer Information as a Prediction FactorUsing Developer Information as a Prediction Factor
Using Developer Information as a Prediction Factor
Ā 
Sound Empirical Evidence in Software Testing
Sound Empirical Evidence in Software TestingSound Empirical Evidence in Software Testing
Sound Empirical Evidence in Software Testing
Ā 
Experimental design
Experimental designExperimental design
Experimental design
Ā 
Wcre13b.ppt
Wcre13b.pptWcre13b.ppt
Wcre13b.ppt
Ā 
Wcre13a.ppt
Wcre13a.pptWcre13a.ppt
Wcre13a.ppt
Ā 
VST2022.pdf
VST2022.pdfVST2022.pdf
VST2022.pdf
Ā 
Cause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case DesignCause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case Design
Ā 
Exploratory testing STEW 2016
Exploratory testing STEW 2016Exploratory testing STEW 2016
Exploratory testing STEW 2016
Ā 
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
Ā 
Software testing using genetic algorithms
Software testing using genetic algorithmsSoftware testing using genetic algorithms
Software testing using genetic algorithms
Ā 
Practical Guidelines to Improve Defect Prediction Model ā€“ A Review
Practical Guidelines to Improve Defect Prediction Model ā€“ A ReviewPractical Guidelines to Improve Defect Prediction Model ā€“ A Review
Practical Guidelines to Improve Defect Prediction Model ā€“ A Review
Ā 
Complexity Measures for Secure Service-Orieted Software Architectures
Complexity Measures for Secure Service-Orieted Software ArchitecturesComplexity Measures for Secure Service-Orieted Software Architectures
Complexity Measures for Secure Service-Orieted Software Architectures
Ā 
Towards a Better Understanding of the Impact of Experimental Components on De...
Towards a Better Understanding of the Impact of Experimental Components on De...Towards a Better Understanding of the Impact of Experimental Components on De...
Towards a Better Understanding of the Impact of Experimental Components on De...
Ā 
Industry-Academia Communication In Empirical Software Engineering
Industry-Academia Communication In Empirical Software EngineeringIndustry-Academia Communication In Empirical Software Engineering
Industry-Academia Communication In Empirical Software Engineering
Ā 
130411 francis palma - detection of process antipatterns -- a bpel perspective
130411   francis palma - detection of process antipatterns -- a bpel perspective130411   francis palma - detection of process antipatterns -- a bpel perspective
130411 francis palma - detection of process antipatterns -- a bpel perspective
Ā 

Viewers also liked

FĆŗtbol Al MĆ”ximo
FĆŗtbol Al MĆ”ximo FĆŗtbol Al MĆ”ximo
FĆŗtbol Al MĆ”ximo
carlosagr96
Ā 
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
Aleksandr Poshchupailov
Ā 
Motivos
MotivosMotivos
Motivos
BubaisHot
Ā 

Viewers also liked (20)

Lei do-m.i
Lei do-m.iLei do-m.i
Lei do-m.i
Ā 
FĆŗtbol Al MĆ”ximo
FĆŗtbol Al MĆ”ximo FĆŗtbol Al MĆ”ximo
FĆŗtbol Al MĆ”ximo
Ā 
Efficient Hill Climber for Constrained Pseudo-Boolean Optimization Problems
Efficient Hill Climber for Constrained Pseudo-Boolean Optimization ProblemsEfficient Hill Climber for Constrained Pseudo-Boolean Optimization Problems
Efficient Hill Climber for Constrained Pseudo-Boolean Optimization Problems
Ā 
Hemorragia uterina anormal
Hemorragia uterina anormalHemorragia uterina anormal
Hemorragia uterina anormal
Ā 
Educacion
EducacionEducacion
Educacion
Ā 
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
AF POSHCHUPAILOV, Aleksandr (RUSSIAN-CHENG-DP2-AHTS-PSV)
Ā 
5. Seguridad
5.  Seguridad5.  Seguridad
5. Seguridad
Ā 
GAMBARAN PENGETAHUAN IBU TERHADAP JADWAL PEMBERIAN IMUNISASI DASARPADA BAYI 0...
GAMBARAN PENGETAHUAN IBU TERHADAP JADWAL PEMBERIAN IMUNISASI DASARPADA BAYI 0...GAMBARAN PENGETAHUAN IBU TERHADAP JADWAL PEMBERIAN IMUNISASI DASARPADA BAYI 0...
GAMBARAN PENGETAHUAN IBU TERHADAP JADWAL PEMBERIAN IMUNISASI DASARPADA BAYI 0...
Ā 
Aprendizajes y competencias bĆ”sicas en la educaciĆ³n primaria
Aprendizajes y competencias bĆ”sicas en la educaciĆ³n primariaAprendizajes y competencias bĆ”sicas en la educaciĆ³n primaria
Aprendizajes y competencias bĆ”sicas en la educaciĆ³n primaria
Ā 
The Meisner Law Group - Community Association Seminar pt 3
The Meisner Law Group - Community Association Seminar pt 3The Meisner Law Group - Community Association Seminar pt 3
The Meisner Law Group - Community Association Seminar pt 3
Ā 
A fase preĢ processual
A fase preĢ processualA fase preĢ processual
A fase preĢ processual
Ā 
The Norwegian telecare and telehealth program. Experiences and results
The Norwegian telecare and telehealth program. Experiences and resultsThe Norwegian telecare and telehealth program. Experiences and results
The Norwegian telecare and telehealth program. Experiences and results
Ā 
Adam lu trip advisor bl_en
Adam lu trip advisor bl_enAdam lu trip advisor bl_en
Adam lu trip advisor bl_en
Ā 
MANAJEMENDANPENDOKUMENTASIANASUHANKEBIDANAN IBU BERSALINPADA NY.ā€œRā€DENGAN RE...
MANAJEMENDANPENDOKUMENTASIANASUHANKEBIDANAN  IBU BERSALINPADA NY.ā€œRā€DENGAN RE...MANAJEMENDANPENDOKUMENTASIANASUHANKEBIDANAN  IBU BERSALINPADA NY.ā€œRā€DENGAN RE...
MANAJEMENDANPENDOKUMENTASIANASUHANKEBIDANAN IBU BERSALINPADA NY.ā€œRā€DENGAN RE...
Ā 
Prueba historia 7Āŗ aƱo
Prueba historia 7Āŗ aƱoPrueba historia 7Āŗ aƱo
Prueba historia 7Āŗ aƱo
Ā 
Materi Cyber Public Relation 1
Materi Cyber Public Relation 1Materi Cyber Public Relation 1
Materi Cyber Public Relation 1
Ā 
PEMANASAN GLOBAL
PEMANASAN GLOBALPEMANASAN GLOBAL
PEMANASAN GLOBAL
Ā 
LAPISAN OZON DAN PEMANASAN GLOBAL
LAPISAN OZON DAN PEMANASAN GLOBALLAPISAN OZON DAN PEMANASAN GLOBAL
LAPISAN OZON DAN PEMANASAN GLOBAL
Ā 
Presentazione ITALSIMPATIA ENGLISH
Presentazione ITALSIMPATIA ENGLISHPresentazione ITALSIMPATIA ENGLISH
Presentazione ITALSIMPATIA ENGLISH
Ā 
Motivos
MotivosMotivos
Motivos
Ā 

Similar to On the application of SAT solvers for Search Based Software Testing

Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsight
chiportal
Ā 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
Ā 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docx
keturahhazelhurst
Ā 

Similar to On the application of SAT solvers for Search Based Software Testing (20)

Recent Research in Search Based Software Testing
Recent Research in Search Based Software TestingRecent Research in Search Based Software Testing
Recent Research in Search Based Software Testing
Ā 
Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsight
Ā 
Introduction to testing.
Introduction to testing.Introduction to testing.
Introduction to testing.
Ā 
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)
Ā 
Testing methodology
Testing methodologyTesting methodology
Testing methodology
Ā 
STAMP at Open Cloud Forum by OW2 2017
STAMP at Open Cloud Forum by OW2 2017STAMP at Open Cloud Forum by OW2 2017
STAMP at Open Cloud Forum by OW2 2017
Ā 
Testing
TestingTesting
Testing
Ā 
STAMP: Software Testing Amplification in DevOps, Etienne Sauvage, OW2con'17
STAMP: Software Testing Amplification in DevOps, Etienne Sauvage, OW2con'17STAMP: Software Testing Amplification in DevOps, Etienne Sauvage, OW2con'17
STAMP: Software Testing Amplification in DevOps, Etienne Sauvage, OW2con'17
Ā 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
Ā 
Stamp Project presentation at OW2con'17
Stamp Project presentation at OW2con'17Stamp Project presentation at OW2con'17
Stamp Project presentation at OW2con'17
Ā 
SE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.pptSE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.ppt
Ā 
Testing
TestingTesting
Testing
Ā 
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
Ā 
Cursus phpunit
Cursus phpunitCursus phpunit
Cursus phpunit
Ā 
Cs 568 Spring 10 Lecture 5 Estimation
Cs 568 Spring 10  Lecture 5 EstimationCs 568 Spring 10  Lecture 5 Estimation
Cs 568 Spring 10 Lecture 5 Estimation
Ā 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Ā 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
Ā 
Upstate CSCI 540 Unit testing
Upstate CSCI 540 Unit testingUpstate CSCI 540 Unit testing
Upstate CSCI 540 Unit testing
Ā 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docx
Ā 
C41041120
C41041120C41041120
C41041120
Ā 

More from jfrchicanog

More from jfrchicanog (20)

Seminario-taller: IntroducciĆ³n a la IngenierĆ­a del Software Guiada or BĆŗsqueda
Seminario-taller: IntroducciĆ³n a la IngenierĆ­a del Software Guiada or BĆŗsquedaSeminario-taller: IntroducciĆ³n a la IngenierĆ­a del Software Guiada or BĆŗsqueda
Seminario-taller: IntroducciĆ³n a la IngenierĆ­a del Software Guiada or BĆŗsqueda
Ā 
Combinando algoritmos exactos y heurĆ­sticos para problemas en ISGB
Combinando algoritmos exactos y heurĆ­sticos para problemas en ISGBCombinando algoritmos exactos y heurĆ­sticos para problemas en ISGB
Combinando algoritmos exactos y heurĆ­sticos para problemas en ISGB
Ā 
Quasi-Optimal Recombination Operator
Quasi-Optimal Recombination OperatorQuasi-Optimal Recombination Operator
Quasi-Optimal Recombination Operator
Ā 
Uso de CMSA para resolver el problema de selecciĆ³n de requisitos
Uso de CMSA para resolver el problema de selecciĆ³n de requisitosUso de CMSA para resolver el problema de selecciĆ³n de requisitos
Uso de CMSA para resolver el problema de selecciĆ³n de requisitos
Ā 
Enhancing Partition Crossover with Articulation Points Analysis
Enhancing Partition Crossover with Articulation Points AnalysisEnhancing Partition Crossover with Articulation Points Analysis
Enhancing Partition Crossover with Articulation Points Analysis
Ā 
Search-Based Software Project Scheduling
Search-Based Software Project SchedulingSearch-Based Software Project Scheduling
Search-Based Software Project Scheduling
Ā 
Dos estrategias de bĆŗsqueda anytime basadas en programaciĆ³n lineal entera par...
Dos estrategias de bĆŗsqueda anytime basadas en programaciĆ³n lineal entera par...Dos estrategias de bĆŗsqueda anytime basadas en programaciĆ³n lineal entera par...
Dos estrategias de bĆŗsqueda anytime basadas en programaciĆ³n lineal entera par...
Ā 
Efficient Hill Climber for Multi-Objective Pseudo-Boolean Optimization
Efficient Hill Climber for Multi-Objective Pseudo-Boolean OptimizationEfficient Hill Climber for Multi-Objective Pseudo-Boolean Optimization
Efficient Hill Climber for Multi-Objective Pseudo-Boolean Optimization
Ā 
Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem
Mixed Integer Linear Programming Formulation for the Taxi Sharing ProblemMixed Integer Linear Programming Formulation for the Taxi Sharing Problem
Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem
Ā 
DescomposiciĆ³n en Landscapes Elementales del Problema de DiseƱo de Redes de R...
DescomposiciĆ³n en Landscapes Elementales del Problema de DiseƱo de Redes de R...DescomposiciĆ³n en Landscapes Elementales del Problema de DiseƱo de Redes de R...
DescomposiciĆ³n en Landscapes Elementales del Problema de DiseƱo de Redes de R...
Ā 
OptimizaciĆ³n Multi-objetivo Basada en Preferencias para la PlanificaciĆ³n de P...
OptimizaciĆ³n Multi-objetivo Basada en Preferencias para la PlanificaciĆ³n de P...OptimizaciĆ³n Multi-objetivo Basada en Preferencias para la PlanificaciĆ³n de P...
OptimizaciĆ³n Multi-objetivo Basada en Preferencias para la PlanificaciĆ³n de P...
Ā 
Resolviendo in problema multi-objetivo de selecciĆ³n de requisitos mediante re...
Resolviendo in problema multi-objetivo de selecciĆ³n de requisitos mediante re...Resolviendo in problema multi-objetivo de selecciĆ³n de requisitos mediante re...
Resolviendo in problema multi-objetivo de selecciĆ³n de requisitos mediante re...
Ā 
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization ProblemElementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Ā 
Efficient Identification of Improving Moves in a Ball for Pseudo-Boolean Prob...
Efficient Identification of Improving Moves in a Ball for Pseudo-Boolean Prob...Efficient Identification of Improving Moves in a Ball for Pseudo-Boolean Prob...
Efficient Identification of Improving Moves in a Ball for Pseudo-Boolean Prob...
Ā 
Problem Understanding through Landscape Theory
Problem Understanding through Landscape TheoryProblem Understanding through Landscape Theory
Problem Understanding through Landscape Theory
Ā 
Searching for Liveness Property Violations in Concurrent Systems with ACO
Searching for Liveness Property Violations in Concurrent Systems with ACOSearching for Liveness Property Violations in Concurrent Systems with ACO
Searching for Liveness Property Violations in Concurrent Systems with ACO
Ā 
Finding Safety Errors with ACO
Finding Safety Errors with ACOFinding Safety Errors with ACO
Finding Safety Errors with ACO
Ā 
Elementary Landscape Decomposition of Combinatorial Optimization Problems
Elementary Landscape Decomposition of Combinatorial Optimization ProblemsElementary Landscape Decomposition of Combinatorial Optimization Problems
Elementary Landscape Decomposition of Combinatorial Optimization Problems
Ā 
Elementary Landscape Decomposition of Combinatorial Optimization Problems
Elementary Landscape Decomposition of Combinatorial Optimization ProblemsElementary Landscape Decomposition of Combinatorial Optimization Problems
Elementary Landscape Decomposition of Combinatorial Optimization Problems
Ā 
Elementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment ProblemElementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment Problem
Ā 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Ā 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
Ā 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Ā 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
Ā 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Ā 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
Ā 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Ā 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Ā 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
Ā 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
Ā 
Introducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) SolutionIntroducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Introducing Microsoftā€™s new Enterprise Work Management (EWM) Solution
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
Ā 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ā 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
Ā 

On the application of SAT solvers for Search Based Software Testing

  • 1. 1 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines On the application of SAT solvers for Search Based Software Testing Francisco Chicano Departamento de Lenguajes y Ciencias de la ComputaciĆ³n Universidad de MĆ”laga Spain
  • 2. 2 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines An optimization problem is a pair: P = (S,f) where: S is a set of solutions (solution or search space) f: S ā†’ R is an objective function to minimize or maximize If our goal is to minimize the function we search for: Global maximum Local maximum Global minimum Local minimum sā€™ āˆˆ S | f(sā€™) ā‰¤ f(s), āˆ€s āˆˆ S Optimization Problem Search Software Testing SBSE
  • 3. 3 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines In a MO problem there are several objectives (functions) we want to optimize Multi-Objective Optimization Problem Search Software Testing SBSE
  • 4. 4 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Optimization Techniques EXACT APPROXIMATED AD HOC HEURISTICS METAHEURISTICS Gradient Lagrange multipliers Based on Calculus Dynamic Programming Branch and Bound Enumerative SA VNS TS Trajectory EA ACO PSO Population Optimization Techniques Search Software Testing SBSE
  • 5. 5 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Pseudocode of a simple EA Three main steps: selection, reproduction, replacement Variation operators Ć ļƒ  Make the population to evolve Recombination: exchange of features Mutation: generation of new features P = generateInitialPopulation (); evaluate (P); while not stoppingCondition () do PĀ“ = selectParents (P); PĀ“ = applyVariationOpterators (PĀ“); evaluate(PĀ“); P = selectNewPopulation (P,PĀ“); end while return the best solution found Evolutionary Algorithm Search Software Testing SBSE
  • 6. 6 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Genetic Algorithms ā€¢ā€Æ Individuals ā€¢ā€Æ Recombination Ā§ļ‚§ā€Æ One point Ā§ļ‚§ā€Æ Two points Ā§ļ‚§ā€Æ Uniform ā€¢ā€Æ Mutation ā†’ bit flips 0111000110 Binary Chromosome 0111000110 1100011001 000110 0111 011001 1100 1001 011010 1010 100101 0111010010 1 0 Evolutionary Algorithm Search Software Testing SBSE
  • 7. 7 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines ā€¢ā€Æ What is software testing? ā€“ā€Æ It is the process of running a software product or a portion of it in a controlled environment with a given input followed by the collection and analysis of the output and/or other relevant information of the execution. ā€¢ā€Æ What is the goal of software testing? ā€“ā€Æ To find out errors in a portion or the complete software product and/or to assure with a high probability that the software is correct (according to the requirements). Software Testing: Definition and Goal Search Software Testing SBSE
  • 8. 8 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Software testing is important becauseā€¦ 60.000 M$ annually (0,6% GDP) in USA Software errors 60 % of project cost Software Testing: Impact Search Software Testing SBSE
  • 9. 9 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Classification of testing techniques (by goal) ā€“ā€Æ Unit testing: test one module of the software. ā€“ā€Æ Integration testing: test the interfaces between different modules in the software. ā€“ā€Æ System testing: test the complete system. ā€“ā€Æ Validation testing: test if the software system fulfills the requirements. ā€“ā€Æ Acceptance testing: the client test whether the system is what s/he wants. ā€“ā€Æ Regression testing: after a change in the software test whether a new error has been introduced. ā€“ā€Æ Stress testing: test the system under a high load ā€“ā€Æ Load testing: test the response of the system under a normal load of work. Software Testing: Classification Search Software Testing SBSE
  • 10. 10 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines 1.0, 2.3 Error! Test case design Test case run Check of results 2.7, 5.4 JUnit, EasyMock, XMLUnit, Jmeter, Selenium Automatic test case generation Software Testing: Automatization Search Techniques Search Based Software Testing Search Software Testing SBSE
  • 11. 11 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Search Based Software Engineering Search Based Software Engineering (SBSE) Search Based Software Testing Search Software Testing SBSE
  • 12. 12 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Our Research on SBSE Search Software Testing SBSE ā€¢ā€ÆSoftware Project Scheduling ā€¢ā€ÆWhite-box Software Testing ā€¢ā€ÆTesting of Concurrent Systems (based on Model Checking) ā€¢ā€ÆTest Sequences for Functional Testing ā€¢ā€ÆTest Suite Minimization in Regression Testing ā€¢ā€ÆSoftware Product Lines Testing ā€¢ā€ÆPrioritized Pairwise Combinatorial Interaction Testing ā€¢ā€ÆTesting Complexity
  • 13. 13 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Problem Formulation SAT Transf. Results
  • 14. 14 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Test Suite Minimization Given: Ƙļƒ˜ā€ÆA set of test cases T = {t1, t2, ..., tn} Ƙļƒ˜ā€ÆA set of program elements to be covered (e.g., branches) E= {e1, e2, ..., ek} Ƙļƒ˜ā€ÆA coverage matrix Find a subset of tests X āŠ† T maximizing coverage and minimizing the testing cost The single-objective version of this problem consists in ļ¬nding a subset of sts X āœ“ T with minimum cost covering all the program elements. In formal rms: minimize cost(X) = nX i=1 ti2X ci (2) ubject to: ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mij = 1. The multi-objective version of the TSMP does not impose the constraint of ll coverage, but it deļ¬nes the coverage as the second objective to optimize, ading to a bi-objective problem. In short, the bi-objective TSMP consists in nding a subset of tests X āœ“ T having minimum cost and maximum coverage. ormally: minimize cost(X) = nX i=1 ti2X ci (3) maximize cov(X) = |{ej 2 E|9ti 2 X with mij = 1}| (4) e1 e2 e3 ... ek t1 1 0 1 ā€¦ 1 t2 0 0 1 ā€¦ 0 ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ tn 1 1 0 ā€¦ 0 M= 3 Test Suite Minimization Problem When a piece of software is modiļ¬ed, the new software is tested using previous test cases in order to check if new errors were introduced. This is known as regression testing. One problem related to regression testing Test Suite Minimization Problem (TSMP). This problem is equivalent t Minimal Hitting Set Problem which is NP-hard [17]. Let T = {t1, t2, Ā· Ā· Ā· be a set of tests for a program where the cost of running test ti is ci an E = {e1, e2, Ā· Ā· Ā· , em} be a set of elements of the program that we want to with the tests. After running all the tests T we ļ¬nd that each test can several program elements. This information is stored in a matrix M = [m dimension n ā‡„ m that is deļ¬ned as: mij = ( 1 if element ej is covered by test ti 0 otherwise The single-objective version of this problem consists in ļ¬nding a subs tests X āœ“ T with minimum cost covering all the program elements. In fo terms: minimize cost(X) = nX i=1 ti2X ci subject to: 8ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mi Yoo & Harman Problem Formulation SAT Transf. Results
  • 15. 15 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines NP-hard Problems In many papers we can readā€¦ ā€œOur optimization problem is NP-hard, and for this reason we useā€¦ ā€¦ which do not ensure an optimal solution but they are able to find good solutions in a reasonable time.ā€ ā€¢ā€Æ Metaheuristic techniques ā€¢ā€Æ Heuristic algorithms ā€¢ā€Æ Stochastic algorithms As far as we know: no efficient (polynomial time) algorithm exists for solving NP-hard problems But we know inefficient algorithms (at least exponential time) Problem Formulation SAT Transf. Results
  • 16. 16 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines The SATisfiability Problem Can we find an assignment of boolean values (true and false) to the variables such that all the formulas are satisfied? The first NP-complete problem (Stephen Cook, 1971) If it can be solved efficiently (polynomial time) then P=NP The known algorithms solve this problem in exponential time (worst case) Nowadays, SAT solvers can solve instances with 500 000 boolean variables This means a search space of 2500 000 ā‰ˆ 10150514 State-of-the-art algorithms in SAT Problem Formulation SAT Transf. Results
  • 17. 17 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines The SATisfiability Problem My favourite problem SAT instance Use SAT solvers Optimal solution Main research question: Can we use the advances of SAT solvers to solve optimization algorithms up to optimality? Test Suite Minimization Translation to SAT Algorithms MiniSAT+ Experimental Results Problem Formulation SAT Transf. Results
  • 18. 18 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Outline Original TSM Instance PB Constraints SAT Instance F. Arito et al., SSBSE 2012 Problem Formulation SAT Transf. Results
  • 19. 19 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Pseudo-Boolean Constraints A Pseudo-Boolean (PB) constraint has the form: der to use SAT solvers to solve optimization problems, ate the constraints f(y) ļ£æ B to Boolean formulas. To f Pseudo-Boolean constraint plays a main role. A Pseudo t is an inequality on a linear combination of Boolean va nX i=1 aixi B 2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB co isļ¬ed under an assignment if the sum of the coe cient tisļ¬es the relational operator with respect to B. nstraints can be translated into SAT instances. The simpl the PB constraint to an equivalent Boolean formula w The main drawback of these approaches is that the num grows exponentially with respect to the variables. In 2 2 ... fm(y) ļ£æ Bm er to use SAT solvers to solve optimization problems, we sti te the constraints f(y) ļ£æ B to Boolean formulas. To this a Pseudo-Boolean constraint plays a main role. A Pseudo-Boolea is an inequality on a linear combination of Boolean variables: nX i=1 aixi B 2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB constraint sļ¬ed under an assignment if the sum of the coe cients ai for isļ¬es the relational operator with respect to B. nstraints can be translated into SAT instances. The simplest appr the PB constraint to an equivalent Boolean formula with th The main drawback of these approaches is that the number of where . fm(y) ļ£æ Bm In order to use SAT solvers to solve opti to translate the constraints f(y) ļ£æ B to Bo concept of Pseudo-Boolean constraint plays a m constraint is an inequality on a linear combina nX i=1 aixi B where 2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and x to be satisļ¬ed under an assignment if the sum xi = 1 satisļ¬es the relational operator with PB constraints can be translated into SAT in translate the PB constraint to an equivalent variables. The main drawback of these approac generated grows exponentially with respect t f2(y) ļ£æ B2 ... fm(y) ļ£æ Bm order to use SAT solvers to solve optimization problems, we slate the constraints f(y) ļ£æ B to Boolean formulas. To this of Pseudo-Boolean constraint plays a main role. A Pseudo-Boo int is an inequality on a linear combination of Boolean variable nX i=1 aixi B 2 {<, ļ£æ, =, 6=, >, }, ai, B 2 Z, and xi 2 {0, 1}. A PB constra atisļ¬ed under an assignment if the sum of the coe cients ai satisļ¬es the relational operator with respect to B. constraints can be translated into SAT instances. The simplest ap te the PB constraint to an equivalent Boolean formula with es. The main drawback of these approaches is that the number Can be translated to SAT instances (usually efficient) Are a higher level formalism to specify a decision problem Can be the input for MiniSAT+ Problem Formulation SAT Transf. Results
  • 20. 20 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Translating Optimization to Decision Problems Let us assume we want to minimize f(x) B f(x) ļ£æ B Check B B B f(x) ļ£æ B Check f(x) ļ£æ B Check f(x) ļ£æ B Check no no no yes Optimal solution found The same can be done with multi-objective problems, but we need more PB constraints s of generality that we want to ļ¬nd a solution xā‡¤ 2 X , f(xā‡¤ ) ļ£æ f(x) for all the solutions x 2 X. This opti- transformed in a series of decision problems in which lution y 2 X for which the constraint f(y) ļ£æ B holds, nt integer values. This series of decision problems can l (minimal) solution of the optimization problem. The ows. We start with a value of B low enough for the be. We solve the decision problem to check that it is ter a loop in which the value of B is increased and the n. The loop is repeated until the result is satisļ¬able. e value of B is the minimal value of f in the search the decision problem is an optimal solution of the blem has several objective functions f1, f2, . . . , fm to nstraint for each objective function: f1(y) ļ£æ B1 f2(y) ļ£æ B2 . ose without loss of generality that we want to ļ¬nd a solution xā‡¤ 2 X izes3 f, that is, f(xā‡¤ ) ļ£æ f(x) for all the solutions x 2 X. This opti- oblem can be transformed in a series of decision problems in which ve is to ļ¬nd a solution y 2 X for which the constraint f(y) ļ£æ B holds, Z takes diā†µerent integer values. This series of decision problems can ļ¬nd the optimal (minimal) solution of the optimization problem. The ould be as follows. We start with a value of B low enough for the o be unsatisļ¬abe. We solve the decision problem to check that it is e. Then, we enter a loop in which the value of B is increased and the s checked again. The loop is repeated until the result is satisļ¬able. oop ļ¬nishes, the value of B is the minimal value of f in the search the solution to the decision problem is an optimal solution of the n problem. ptimization problem has several objective functions f1, f2, . . . , fm to we need one constraint for each objective function: f1(y) ļ£æ B1 f2(y) ļ£æ B2 ... that minimizes3 f, that is, f(xā‡¤ ) ļ£æ f(x) for all the solutions x 2 X mization problem can be transformed in a series of decision problem the objective is to ļ¬nd a solution y 2 X for which the constraint f(y) where B 2 Z takes diā†µerent integer values. This series of decision pr be used to ļ¬nd the optimal (minimal) solution of the optimization pr procedure could be as follows. We start with a value of B low eno constraint to be unsatisļ¬abe. We solve the decision problem to chec unsatisļ¬able. Then, we enter a loop in which the value of B is increa constraint is checked again. The loop is repeated until the result is Once the loop ļ¬nishes, the value of B is the minimal value of f in space and the solution to the decision problem is an optimal solu optimization problem. If the optimization problem has several objective functions f1, f2 minimize, we need one constraint for each objective function: f1(y) ļ£æ B1 f2(y) ļ£æ B2 ... fm(y) ļ£æ Bm In order to use SAT solvers to solve optimization problems, w ā€¦ Problem Formulation SAT Transf. Results
  • 21. 21 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines PB Constraints for the TSM Problem e1 e2 e3 ... em t1 1 0 1 ā€¦ 1 t2 0 0 1 ā€¦ 0 ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ tn 1 1 0 ā€¦ 0 M= previous test cases in order to check if new errors were introduced. This is known as regression testing. One problem related to regression testing Test Suite Minimization Problem (TSMP). This problem is equivalent t Minimal Hitting Set Problem which is NP-hard [17]. Let T = {t1, t2, Ā· Ā· Ā· be a set of tests for a program where the cost of running test ti is ci an E = {e1, e2, Ā· Ā· Ā· , em} be a set of elements of the program that we want to with the tests. After running all the tests T we ļ¬nd that each test can several program elements. This information is stored in a matrix M = [m dimension n ā‡„ m that is deļ¬ned as: mij = ( 1 if element ej is covered by test ti 0 otherwise The single-objective version of this problem consists in ļ¬nding a subs tests X āœ“ T with minimum cost covering all the program elements. In fo terms: minimize cost(X) = nX i=1 ti2X ci subject to: 8ej 2 E, 9ti 2 X such that element ej is covered by test ti, that is, mi The multi-objective version of the TSMP does not impose the constra full coverage, but it deļ¬nes the coverage as the second objective to opti leading to a bi-objective problem. In short, the bi-objective TSMP consi ļ¬nding a subset of tests X āœ“ T having minimum cost and maximum cove Formally: n ase is not included. We also introduce m binary variables e ch program element to cover. If ej = 1 then the correspondin by one of the selected test cases and if ej = 0 the elem y a selected test case. lues of the ej variables are not independent of the ti variable j must be 1 if and only if there exists a ti variable for whic 1. The dependence between both sets of variables can be wr ing 2m PB constraints: ej ļ£æ nX i=1 mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ m. n see that if the sum in the middle is zero (no test is co j) then the variable ej = 0. However, if the sum is greater ow we need to introduce a constraint related to each objectiv o transform the optimization problem in a decision probl in Section 2.2. These constraints are: variables are not independent of the ti variables. A given and only if there exists a ti variable for which mij = 1 ence between both sets of variables can be written with nstraints: nX i=1 mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ m. (5) the sum in the middle is zero (no test is covering the ariable ej = 0. However, if the sum is greater than zero introduce a constraint related to each objective function the optimization problem in a decision problem, as we . These constraints are: nX i=1 citi ļ£æ B, (6) mX the following 2m PB constraints: ej ļ£æ nX i=1 mijti ļ£æ n Ā· ej 1 ļ£æ j ļ£æ We can see that if the sum in the middle is zero (no element ej) then the variable ej = 0. However, if the sum ej = 1. Now we need to introduce a constraint related to ea in order to transform the optimization problem in a dec described in Section 2.2. These constraints are: nX i=1 citi ļ£æ B, mX j=1 ej P, Cost Coverage Problem Formulation SAT Transf. Results
  • 22. 22 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Example e ough a small example how to model with PB con- SMP according to the methodology above described. E = {e1, e2, e3, e4} and M: e1 e2 e3 e4 t1 1 0 1 0 t2 1 1 0 0 t3 0 0 1 0 t4 1 0 0 0 t5 1 0 0 1 t6 0 1 1 0 -obj TSMP we need to instantiate Eqs. (5), (6) and ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1 (10) ļ£æ t2 + t6 ļ£æ 4e2 (11) ļ£æ t1 + t3 + t6 ļ£æ 4e3 (12) ļ£æ t5 ļ£æ 4e4 (13) t5 1 0 0 1 t6 0 1 1 0 If we want to solve the 2-obj TSMP we need to instantia (7). The result is: e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1 e2 ļ£æ t2 + t6 ļ£æ 4e2 e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3 e4 ļ£æ t5 ļ£æ 4e4 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B e1 + e2 + e3 + e4 P where P, B 2 N. If we are otherwise interested in the 1-obj version the form t1 + t2 + t4 + t5 1 t2 + t6 1 t1 + t3 + t6 1 t5 1 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B (7). The result is: e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 4e1 e2 ļ£æ t2 + t6 ļ£æ 4e2 e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3 e4 ļ£æ t5 ļ£æ 4e4 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B e1 + e2 + e3 + e4 P where P, B 2 N. If we are otherwise interested in the 1-obj version th t1 + t2 + t4 + t5 1 t2 + t6 1 t1 + t3 + t6 1 t5 1 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B e2 ļ£æ t2 + t6 ļ£æ 4e2 e3 ļ£æ t1 + t3 + t6 ļ£æ 4e3 e4 ļ£æ t5 ļ£æ 4e4 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B e1 + e2 + e3 + e4 P where P, B 2 N. If we are otherwise interested in the 1-obj version the for t1 + t2 + t4 + t5 1 t2 + t6 1 t1 + t3 + t6 1 t5 1 t1 + t2 + t3 + t4 + t5 + t6 ļ£æ B Bi-objective problem Single-objective problem (total coverage) f(x) ļ£æ B e1 ļ£æ t1 + t2 + t4 + t5 ļ£æ 6e1 e2 ļ£æ t2 + t6 ļ£æ 6e2 e3 ļ£æ t1 + t3 + t6 ļ£æ 6e3 e4 ļ£æ t5 ļ£æ 6e4 Problem Formulation SAT Transf. Results
  • 23. 23 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Algorithm for Solving the 2-obj TSM Cost Coverage Total coverage With coverage=|E| increase cost until success Decrease cost and find the maximum coverage again and again Problem Formulation SAT Transf. Results
  • 24. 24 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Instances from the Software-artifact Infrastructure Repository (SIR) TSM Instances The result is an instance with fewer test cases but having the same P These transformed instances were solved using Algorithm 2. Table size of the test suites with and without the reduction for each progr observe a really great reduction in the number of test cases when t approach is used. Table 1: Details of the instances used in the experiments Instance Original Size Reduced Size Elements to co printtokens 4130 40 printtokens2 4115 28 replace 5542 215 schedule 2650 4 schedule2 2710 13 tcas 1608 5 totinfo 1052 21 In Table 2 we present the Pareto optimal set and the Pareto fr t is an instance with fewer test cases but having the same Pareto front. nsformed instances were solved using Algorithm 2. Table 1 shows the e test suites with and without the reduction for each program. We can really great reduction in the number of test cases when the previous is used. Table 1: Details of the instances used in the experiments stance Original Size Reduced Size Elements to cover rinttokens 4130 40 195 rinttokens2 4115 28 192 eplace 5542 215 208 chedule 2650 4 126 chedule2 2710 13 119 cas 1608 5 54 otinfo 1052 21 117 ble 2 we present the Pareto optimal set and the Pareto front for the Tests http://sir.unl.edu/portal/index.php ! Cost of each test: 1 Problem Formulation SAT Transf. Results
  • 25. 25 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Pareto Front 80 82.5 85 87.5 90 92.5 95 97.5 100 0 1 2 3 4 5 6 7 8 9 coveragelevel number of test cases Pareto front printtokens printtokens2 replace schedule schedule2 tcas totinfo printtokens printtokens2 replace schedule schedule2 tcas totinfo The result is an instance with fewer test cases but having the same Pareto front. These transformed instances were solved using Algorithm 2. Table 1 shows the size of the test suites with and without the reduction for each program. We can observe a really great reduction in the number of test cases when the previous approach is used. Table 1: Details of the instances used in the experiments Instance Original Size Reduced Size Elements to cover printtokens 4130 40 195 printtokens2 4115 28 192 replace 5542 215 208 schedule 2650 4 126 schedule2 2710 13 119 tcas 1608 5 54 totinfo 1052 21 117 In Table 2 we present the Pareto optimal set and the Pareto front for the instances described above. The columns ā€œTestsā€ and ā€œElementsā€ correspond to the functions cost and cov of the 2-obj TSMP. The column ā€œCoverageā€ is the number of covered elements divided by the total number of elements. The optimal solution for the 1-obj TSMP can be found in the lines with 100% coverage, as explained in Section 3. It is not common to show the Pareto optimal set or the Pareto front in numbers in the multi-objective literature because only approximate Pareto fronts can be obtained for NP-hard problems. However, in this case we obtain the exact Pareto fronts and optimal sets, so we think that this The result is an instance with fewer test cases but having the same Pareto front. These transformed instances were solved using Algorithm 2. Table 1 shows the size of the test suites with and without the reduction for each program. We can observe a really great reduction in the number of test cases when the previous approach is used. Table 1: Details of the instances used in the experiments Instance Original Size Reduced Size Elements to cover printtokens 4130 40 195 printtokens2 4115 28 192 replace 5542 215 208 schedule 2650 4 126 schedule2 2710 13 119 tcas 1608 5 54 totinfo 1052 21 117 In Table 2 we present the Pareto optimal set and the Pareto front for the instances described above. The columns ā€œTestsā€ and ā€œElementsā€ correspond to the functions cost and cov of the 2-obj TSMP. The column ā€œCoverageā€ is the number of covered elements divided by the total number of elements. The optimal solution for the 1-obj TSMP can be found in the lines with 100% coverage, as explained in Section 3. It is not common to show the Pareto optimal set or the Pareto front in numbers in the multi-objective literature because only approximate Pareto fronts can be obtained for NP-hard problems. However, in this case we obtain the exact Pareto fronts and optimal sets, so we think that this 80 0 1 2 3 tcas Fig. 1: Pareto fron Table 3: Information about clauses-t gorithm 2, average coverage and num rithms for the instances from SIR. Instance Ratio Algorithm 2 Original (s) Reduced ( printtokens 4.61 3400.74 2.1 printtokens2 4.61 3370.44 1.4 replace 4.62 1469272.00 345.6 schedule 2.19 492.38 0.2 schedule2 4.61 195.55 0.2 tcas 4.61 73.44 0.3 totinfo 4.53 181823.50 0.9 independent runs. However, the requ printtokens, printtokens2 and re rest of the programs. However, we sh the result is an optimal solution, as Tests Time Problem Formulation SAT Transf. Results
  • 26. 26 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Pareto Front Table 2: Pareto optimal set and Front for the instances of SIR. Instance Elements Tests Coverage Solution printtokens 195 5 100% (t2222, t2375, t3438, t4100, t4101) 194 4 99.48% (t1908, t2375, t4099, t4101) 192 3 98.46% (t1658, t2363, t4072) 190 2 97.43% (t1658, t3669) 186 1 95.38% (t2597) printtokens2 192 4 100% (t2521, t2526, t4085, t4088) 190 3 98.95% (t457, t3717, t4098) 188 2 97.91% (t2190, t3282) 184 1 95.83% (t3717) replace 208 8 100% (t306, t410, t653, t1279, t1301, t3134, t4057, t4328) 207 7 99.51% (t309, t358, t653, t776, t1279, t1795, t3248) 206 6 99.03% (t275, t290, t1279, t1938, t2723, t2785) 205 5 98.55% (t426, t1279, t1898, t2875, t3324) 203 4 97.59% (t298, t653, t3324, t5054) 200 3 96.15% (t2723, t2901, t3324) 195 2 93.75% (t358, t5387) 187 1 89.90% (t358) schedule 126 3 100% (t1403, t1559, t1564) 124 2 98.41% (t1570, t1595) 122 1 96.82% (t1572) schedule2 119 4 100% (t2226, t2458, t2462, t2681) 118 3 99.15% (t101, t1406, t2516) 117 2 98.31% (t2461, t2710) 116 1 97.47% (t1584) tcas 54 4 100% (t5, t1191, t1229, t1608) 53 3 98.14% (t13, t25, t1581) 50 2 92.59% (t72, t1584) 44 1 81.48% (t217) totinfo 117 5 100% (t62, t118, t218, t1000, t1038) 115 4 98.29% (t62, t118, t913, t1016) 113 3 96.58% (t65, t216, t913) 111 2 94.87% (t65, t919) 110 1 94.01% (t179) Problem Formulation SAT Transf. Results
  • 27. 27 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Reduction in the Number of Test Cases Since we are considering cost 1 for the tests, we can apply an a priori reduction in the original test suite e1 e2 e3 ... em t1 1 0 0 ā€¦ 1 t2 1 0 1 ā€¦ 1 ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ ā€¦ tn 1 1 0 ā€¦ 0 Test t1 can be removedThe result is an instance with fewer test cases but having the same Pareto front. These transformed instances were solved using Algorithm 2. Table 1 shows the size of the test suites with and without the reduction for each program. We can observe a really great reduction in the number of test cases when the previous approach is used. Table 1: Details of the instances used in the experiments Instance Original Size Reduced Size Elements to cover printtokens 4130 40 195 printtokens2 4115 28 192 replace 5542 215 208 schedule 2650 4 126 schedule2 2710 13 119 tcas 1608 5 54 totinfo 1052 21 117 Problem Formulation SAT Transf. Results
  • 28. 28 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Results with the Reduction The optimal Pareto Front for the reduced test suite can be found from 200 to 180 000 times faster Table 3: Information about clauses-to-variab gorithm 2, average coverage and number of te rithms for the instances from SIR. Instance Ratio Algorithm 2 Original (s) Reduced (s) Avg. printtokens 4.61 3400.74 2.17 100 printtokens2 4.61 3370.44 1.43 100 replace 4.62 1469272.00 345.62 100 schedule 2.19 492.38 0.24 100 schedule2 4.61 195.55 0.27 100 tcas 4.61 73.44 0.33 100 totinfo 4.53 181823.50 0.96 100 Problem Formulation SAT Transf. Results
  • 29. 29 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Background Testing SAT Transform. Results R. Lopez-Herrejon et al., ICSM 2013
  • 30. 30 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Software Product Lines A product line is a set of related products developed from a shared set of assets ā€¢ā€Æ The products have similar characteristics ā€¢ā€Æ The products have unique characteristics Advantages ā€¢ā€Æ Support customization ā€¢ā€Æ Improves reuse ā€¢ā€Æ Reduce time to market Product Lines are Pervasive 19 BMW Car Configurator Ā© RELH Background Testing SAT Transform. Results
  • 31. 31 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Software Product Lines In Software Product Lines the product is Software They are modelled using Feature Models Background Testing SAT Transform. Results
  • 32. 32 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Feature Models Fig. 1. Graph Product Line Feature Model Mandatory features Optional features Exclusive-or relations Inclusive-or relations Cross-tree constraints Graph Product Line Feature Model Background Testing SAT Transform. Results
  • 33. 33 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of Software Product Lines Fig. 1. Graph Product Line Feature Model In a feature model, each feature (except the root) has one parent feature and can have a set of child features. Notice here that a child feature can only be included in a feature combination of a valid product if its parent is included as well. The root feature is always included. There are four kinds of feature relationships: i) Mandatory features are depicted with a ļ¬lled circle. A mandatory feature is selected whenever its respective parent feature is selected. For example, features Driver and GraphType, ii) Optional features are depicted with an empty circle. An optional feature may or may not be selected if its respective parent feature is selected. An example is feature Weight, iii) Exclusive-or relations are depicted as empty arcs crossing over a set of lines connecting a parent feature with its child features. They indicate that exactly one of the features in the exclusive-or group must be selected whenever the parent feature is selected. For example, if feature Search is selected, then either feature DFS or feature BFS must be selected, iv) Inclusive-or relations are depicted as ļ¬lled arcs crossing over a set of lines connecting a parent feature with its child features. They indicate that at least one of the features in the inclusive-or group must be selected if the parent is selected. If for instance, feature Algorithms is selected then at least one of the features Num, CC, SCC, Cycle, Shortest, Prim, and Kruskal must be selected. Besides the parent-child relations, features can also relate across different branches of the feature model with the so called Cross-Tree Constraints (CTC). Figure 1 shows some of the CTCs of our feature model2 . For instance, Cycle requires DFS means that whenever feature Cycle is an co pr an co by m va al w of of {0 xi co w bo C w pr ea de W co The GPL Feature Model is small: 73 distinct products But the number of products grows exponentially with the number of featuresā€¦ ā€¦ and testing each particular product is not viable Background Testing SAT Transform. Results
  • 34. 34 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Combinatorial Interaction Testing Assuming each features has been tested in isolation, most of the defects come from the interaction between features Combinatorial Interaction Testing consists in selecting the minimum number of products that covers all t-wise interactions (t-wise coverage). ZipMe Compress Extract Checksum Adapt GZIP ArchCheck CRC āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” āœ” 1 2 3 4 5 6 64 productsExample: 2-wise ICPL CASA Background Testing SAT Transform. Results
  • 35. 35 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Multi-Objective Formulation If we donā€™t have the resources to run all the tests, which one to choose? Multi-objective formulation: minimize the number of products maximize the coverage (t-wise interactions) The solution is not anymore a table of products, but a Pareto set by the number of variables dj,k,l that as: 1X =1 fX k=j+1 3X l=0 dj,k,l (7) rogram is composed of the goal (7) (f 1) constraints given by (2) to (6) he FM expressed with the inequalities e number of variables of the program ). The solution to this zero-one linear with the maximum coverage that can ucts. ALGORITHM e for obtaining the optimal Pareto set This algorithm takes as input the FM l Pareto set. It starts by adding to the always in the set: the empty solution one arbitrary solution (with coverage ons of the set of features). After that h successive zero-one linear programs creasing number of products starting l model is solved using a extended . This solver provides a test suite with This solution is stored in the optimal m stops when adding a new product to crease the coverage. The result is the EXPERIMENTS s how the evaluation was carried out sis. The experimental corpus of our y a benchmark of 118 feature models, ts ranges from 16 to 640 products, that om the SPL Conqueror [16] and the s. The objectives to optimize are the //minisat.se/MiniSat+.html want the algorithm to be as fast as possible. For comparison these experiments were run in a cluster of 16 machines with Intel Core2 Quad processors Q9400 at 2.66 GHz and 4 GB running Ubuntu 12.04.1 LTS managed by the HT Condor 7.8.4 manager. Each experiment was executed in one core. We computed the Pareto optimal front for each model. Figure 2 shows this front for our running example GPL, where the total coverage is obtained with 12 products, and for every test suite size the obtained coverage is also optimal. As our approach is able to compute the Pareto optimal front for every feature model in our corpus, it makes no sense to analyze the quality of the solutions. Instead, we consider more interesting to study the scalability of our approach. For that, we analyzed the execution time of the algorithm as a function of the number of products represented by the feature model as shown in Figure 3. In this ļ¬gure we can observe a tendency: the higher the number of products, the higher the execution time. Although it cannot be clearly appreciated in the ļ¬gure, the execution time does not grow linearly with the number of products, the growth is faster than linear. Fig. 2. Pareto optimal front for our running example (GPL). GPL 2-wise interactions Background Testing SAT Transform. Results
  • 36. 36 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Approach Original SPLT Instance PB Constraints SAT Instance Background Testing SAT Transform. Results
  • 37. 37 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Approach Modelling SPLT using PseudoBoolean constraints All the variables are boolean {0,1} The values of the signature are: ā€“ā€Æ 00 (both unselected) ā€“ā€Æ 10 (only first selected) ā€“ā€Æ 01 (only second selected) ā€“ā€Æ 11 (both selected) 1 Variables Variable Meaning xp,i Presence of feature i in product p cp,i,j,k Product p covers the pair (i, j) with signature k di,j,k The pair (i, j) with signature k is covered by some product k takes values 0, 1, 2 and 3. 2 Equations For each p: The equations related to the constraints of the model For all p, i and j: 2cp,i,j,3 ļ£æ xp,i + xp,j ļ£æ 1 + cp,i,j,3 (1 Background Testing SAT Transform. Results
  • 38. 38 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Approach Equations of the model ā€“ā€Æ For each product p ā€¢ā€Æ Constraints imposed by the Feature Model ā€“ā€Æ For each product p and pair of features i and j tions ions related to the constraints of the model i and j: 2cp,i,j,3 ļ£æ xp,i + xp,j ļ£æ 1 + cp,i,j,3 2cp,i,j,2 ļ£æ xp,i + (1 xp,j) ļ£æ 1 + cp,i,j,3 2cp,i,j,1 ļ£æ (1 xp,i) + xp,j ļ£æ 1 + cp,i,j,3 2cp,i,j,0 ļ£æ (1 xp,i) + (1 xp,j) ļ£æ 1 + cp,i,j,3 and k: Background Testing SAT Transform. Results
  • 39. 39 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Approach Equations of the model (cont.) ā€“ā€Æ For each pair of features i and j and signature k ā€¢ā€Æ n is the number of products ā€“ā€Æ Objective: maximize coverage 2cp,i,j,0 ļ£æ (1 xp,i) + (1 xp,j) ļ£æ 1 + cp,i,j,3 nd k: di,j,k ļ£æ X p cp,i,j,k ļ£æ ndi,j,k umber of products max : X i,j,k di,j,k k: di,j,k ļ£æ X p cp,i,j,k ļ£æ ndi,j,k mber of products max : X i,j,k di,j,k Background Testing SAT Transform. Results
  • 40. 40 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Approach ļ£æ f: ,k,0 (2) (3) (4) (5) product. when all d dj,k,l, k with herwise. he dj,k,l lities for Algorithm 1 Algorithm for obtaining the optimal Pareto set. optimal set {;}; cov[0] 0; cov[1] Cf 2 ; sol arbitraryValidSolution(fm); i 1; while cov[i] 6= cov[i 1] do optimal set optimal set [ {sol}; i i + 1; m prepareMathModel(fm,i); sol solveMathModel(m); cov[i] |sol|; end while number of products required to test the SPL and the achieved Background Testing SAT Transform. Results
  • 41. 41 / 42Polytechnique MontrĆ©al, July 10, 2014 Introduction Test Suite Minimization Software Product Lines Testing of SPLs: Results of the redundant constraints can incr adding more constraints could help th a solution. We plan to study the right b and augmenting constraints. Second, feature models to further study the sca ACKNOWLEDGEME Funded by Austrian Science Fund N15 and Lise Meitner Fellowship M Ministry of Economy and Competitive contract TIN2011-28194 and fellowsh REFERENCES [1] P. Zave, ā€œFaq sheet on http://www.research.att.com/ pamela/faq.h [2] K. Pohl, G. Bockle, and F. J. van der L Engineering: Foundations, Principles and Experiments on 118 feature models taken from SPLOT repository (http://www.splot-research.org) SPL Conqueror (http://wwwiti.cs.uni-magdeburg.de/~nsiegmun/SPLConqueror/) 16 to 640 products Intel Core2 Quad Q9400 2.66 GHz, 4 GB Background Testing SAT Transform. Results
  • 42. 42 / 42Polytechnique MontrĆ©al, July 10, 2014 Thanks for your attention !!! On the application of SAT solvers for Search Based Software Testing