SlideShare a Scribd company logo
D e p a r t m e n t
O f
I n f o r m a t i c s
EvoSuite: Generación Automática de Casos de Prueba
José Miguel Rojas
UCM, Madrid, EspañaSome slides borrowed from Prof. G. Fraser
CV
• Ingeniería Informática

Universidad Autónoma Gabriel René Moreno, Bolivia (2001–2006)
• Doctorado en Software y Sistemas

Universidad Politécnica de Madrid, España (2009–2013)
• Tesis Doctoral: Generación Automática de Casos de Prueba en
Programación Orientada a Objetos
• Investigador Post-doctoral (Research Associate)

The University of Sheffield, Reino Unido (2014–2017)
• Profesor Asistente (Lecturer)

University of Leicester, Reino Unido (2017–presente)
Disclaimer
Bugs
Ariane 5, primer vuelo, 1996
Therac-25, 1985-87
¿Software libre de errores?
Métodos para la Calidad del Software
Organizacionales
Constructivos
Analíticos
Gestión de Proyectos Ing. Software Constructiva
RevisionesAutomáticos
Walkthrough InspecciónAnálisis DinámicosAnálisis Estáticos Verificación
Formal Pruebas
Verificación y
Validación
Métodos para la Calidad del Software
Organizacionales
Constructivos
Analíticos
Gestión de Proyectos Ing. Software Constructiva
RevisionesAutomáticos
Walkthrough InspecciónAnálisis DinámicosAnálisis Estáticos Verificación
Formal Pruebas
Verificación y
Validación
Pruebas de Software
“La selección de entradas para un
sistema con la intención de provocar
fallos en dicho sistema, revelando de
tal forma la presencia de errores”
”Las pruebas de software solo pueden
demostrar la presencia de errores, no
su ausencia.” (E. Dijkstra)
Requerimientos
Especificación
Diseño
Arquitectural
Diseño de
Módulos
Implementación
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Software
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Unidad
1.Ejecutar programa, usando
datos de prueba (input)
2.Verificar salida del programa
(output), usando oráculo de
pruebas (test oracle)
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Unidad
ProgramaEntrada Salida
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Unidad
ProgramaEntrada Salida
Salida
Esperada
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Unidad
ProgramaEntrada Salida
Salida
Esperada
Pruebas de
Unidad
Pruebas de
Integración
Pruebas de
Sistema
Pruebas de
Aceptación
Pruebas de Unidad
ProgramaEntrada Salida
Salida
Esperada
Statement testing
Branch testing
Basic

condition testing
MC/DC testing
Compound

condition testing
Path testing
Loop boundary

testing
Branch and

condition testing
LCSAJ testing
Boundary

interior testing
CriteriosPrácticosCriteriosTeóricos
subsume
Criterios
de Pruebas
Statement testing
Branch testing
Basic

condition testing
MC/DC testing
Compound

condition testing
Path testing
Loop boundary

testing
Branch and

condition testing
LCSAJ testing
Boundary

interior testing
CriteriosPrácticosCriteriosTeóricos
subsume
Criterios
de Pruebas
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
A
B
C
D E
GF
H I
L
M
0
25
50
75
100
Coverage
87
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
0
25
50
75
100
Coverage
87
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
0
25
50
75
100
Coverage
87
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
“abc”
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
0
25
50
75
100
Coverage
87
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
“abc”
✔
{ char *eptr = encoded;
char *dptr = decoded;
int ok = 0;
char c;
c = *eptr;
if (c == '+') {
*dptr = ' ';
}
while (*eptr) {
True
*dptr = '0';
return ok;
}
False
True
int digit_high = Hex_Values[*(++eptr)];
int digit_low = Hex_Values[*(++eptr)];
if (digit_high == -1 || digit_low == -1) {
True
ok = 1;
}
True
else {
*dptr = 16 * digit_high + digit_low;
}
False
++dptr;
++eptr;
}
False
False
elseif (c == '%') {
else
*dptr = *eptr;
}
int cgi_decode(char *encoded, char *decoded)
A
C
B
D E
F G
H I
L
M
0
25
50
75
100
Coverage
87
0
25
50
75
100
Coverage
100
A
B
C
D E
GF
H I
L
M
“+%0d+%4j”
✔
✔✔
✔
✔ ✔
✔
“abc”
✔
Branch Coverage (Recubrimiento de Ramas de Programa?)
• Criterio de adecuación: Cada rama (branch) del programa debe ser
ejecutada al menos una vez

• Recubrimiento: # ramas ejecutadas

	 	 # ramas

• Subsume el criterio de instrucciones de código

Visitar todas las ramas implica visitar todos los nodos

• El criterio más aplicado en práctica

• Criterio estructural

• Alternativa: mutation scores
Stress Testing
State Machine Testing
L. C. Briand,Y. Labiche, and M. Shousha,“Stress testing real-time systems with genetic
algorithms”. GECCO 2005.
K. Derderian, R. Hierons, M. Harman, and Q. Guo,“Automated unique input output
sequence generation for conformance testing of FSMs”.The Computer Journal, 2006.
Combinatorial Interaction Testing
M.B. Cohen, M.B. Dwyer and J. Shi,“Interaction testing of highly-configurable systems in
the presence of constraints”, ISSTA 2007.
Search-based Testing (SBST)
Stress Testing
State Machine Testing
L. C. Briand,Y. Labiche, and M. Shousha,“Stress testing real-time systems with genetic
algorithms”. GECCO 2005.
K. Derderian, R. Hierons, M. Harman, and Q. Guo,“Automated unique input output
sequence generation for conformance testing of FSMs”.The Computer Journal, 2006.
Combinatorial Interaction Testing
M.B. Cohen, M.B. Dwyer and J. Shi,“Interaction testing of highly-configurable systems in
the presence of constraints”, ISSTA 2007.
Search-based Testing (SBST)
Generación Basada en Búsqueda
Entrada
Búsqueda Aleatoria
C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed
Random Test Generation”, ICSE 2007.
Generación Basada en Búsqueda
Entrada
Búsqueda Aleatoria
C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed
Random Test Generation”, ICSE 2007.
Generación Basada en Búsqueda
Entrada
Búsqueda Aleatoria
C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed
Random Test Generation”, ICSE 2007.
Generación Basada en Búsqueda
Entrada
Fitness
Búsqueda Guiada
por “Fitness”
G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013.
Generación Basada en Búsqueda
Entrada
Fitness
Búsqueda Guiada
por “Fitness”
G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013.
Generación Basada en Búsqueda
Entrada
Fitness
G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013.
Búsqueda Guiada
por “Fitness”
Algoritmo Genético
Algoritmo Genético
Mutation
Crossover
Selection
Insertion
Fitness Evaluation
End?
Algoritmo Genético
Mutation
Crossover
Selection
Insertion
Fitness Evaluation
End?
Test cases
Execution
Monitoring
Caso de Uso Básico
Código Fuente
Caso de Uso Básico
Código Fuente Casos de Prueba
Caso de Uso Básico
Código Fuente Casos de Prueba
Caso de Uso Básico
Código Fuente Casos de Prueba
Generación Automática
@Test
public void test()
{
}
int x = 2;
int y = 2;
int result = x + y;
assertEquals(4, result);
@Test
public void test()
{
}
DateTime var3 = var1.toDateTime(var2);
DateTime var4 = var3.minus(var0);
TimeOfDay var2 = new TimeOfDay();
YearMonthDay var1 = newYearMonthDay(var0);
int var0 = 10
DateTime var5 = var4.plusSeconds(var0);
Generación de “Test Suites”
DateTime var3 = var1.toDateTime(var2);
DateTime var4 = var3.minus(var0);
TimeOfDay var2 = new TimeOfDay();
YearMonthDay var1 = newYearMonthDay(var0);
int var0 = 10
DateTime var5 = var4.plusSeconds(var0);
Generación de “Test Suites”
Generación de “Test Suites”
Generación de “Test Suites”
Cruzamiento (Crossover)
Mutación
Mutación
Mutación
Fitness
public int gcd(int x, int y) {
int tmp;
while (y != 0) {
tmp = x % y;
x = y;
y = tmp;
}
return x;
}
Fitness
public int gcd(int x, int y) {
int tmp;
while (y != 0) {
tmp = x % y;
x = y;
y = tmp;
}
return x;
}
Código Abierto
http://www.evosuite.org/
https://github.com/evosuite/evosuite
• Paquete Jar – Uso en línea de comandos
• Plug-ins IntelliJ y Eclipse – Uso durante el desarrollo
• Plug-in Maven – Uso automatizado
• Plug-in Jenkins – Uso en integración continua
Uso en Línea de Comandos
• Opciones principales

-projectCP

-class

-criterion
• Propiedades
• Search budget (s)

-Dsearch_budget=60
• Generación de aserciones

-Dassertions=false

-Dassertion_strategy=all
• Minimización (length and values)

-Dminimize=false
• Inlining

-Dinline=false
DEMO
Ventajas?
ICST’18
Code Coverage (EMSE 2017)
Fault Detection (ASE’15)
Desventajas?
ICST’18
@Test(timeout = 4000)
public void test01() throws Throwable {
LinkedList<String> linkedList0 = new LinkedList<String>();
LinkedList<Object> linkedList1 = 

new LinkedList<Object>((Collection<?>) linkedList0);
FixedOrderComparator fixedOrderComparator0 = 

new FixedOrderComparator((List) linkedList1);
linkedList1.add((Object) linkedList1);
// Undeclared exception!
try {
fixedOrderComparator0.compare(linkedList1, linkedList0);
fail("Expecting exception: StackOverflowError");
} catch(StackOverflowError e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test
public void test002() throws Throwable {
if (debug) { System.out.format("%n%s%n","RegressionTest2.test002"); }
java.lang.Object[] obj_array1 = new java.lang.Object[] { (short)10 };
collections.comparators.FixedOrderComparator fixedOrderComparator2 = 

new collections.comparators.FixedOrderComparator(obj_array1);
java.util.Comparator comparator3 = fixedOrderComparator2.reversed();
java.util.Comparator comparator4 = comparator3.reversed();
java.lang.Object[] obj_array6 = new java.lang.Object[] { (short)10 };
collections.comparators.FixedOrderComparator fixedOrderComparator7 = 

new collections.comparators.FixedOrderComparator(obj_array6);
java.util.Comparator comparator8 =

comparator4.thenComparing((java.util.Comparator)fixedOrderComparator7);
boolean b10 = fixedOrderComparator7.add((java.lang.Object)10L);
int i11 = fixedOrderComparator7.getUnknownObjectBehavior();
boolean b12 = fixedOrderComparator7.isLocked();
fixedOrderComparator7.setUnknownObjectBehavior( 0 );
...
...
}
/**
* Chromosome :
1)----->org.apache.commons.lang3.math.NumberUtils[]
2)----->min[[30823,57]],
3)----->toString[]
Covered Branches:[1, 113, 114, 115, 109, 111]
*/
@Test public void TestCase1() throws Throwable {
NumberUtils clsUTNumberUtils=null;
clsUTNumberUtils=new NumberUtils();
short[] clsUTNumberUtilsP2P1=new short[]{30823,57};
short clsUTNumberUtilsP2R=0;
clsUTNumberUtilsP2R=NumberUtils.min(clsUTNumberUtilsP2P1);
assertTrue(Arrays.equals(new short[]{30823,57},clsUTNumberUtilsP2P1));
assertEquals(57,clsUTNumberUtilsP2R);
String clsUTNumberUtilsP3R=null;
clsUTNumberUtilsP3R=clsUTNumberUtils.toString();
String clsUTNumberUtilsP3RP0P1=new
String("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWEVETnqz
BRdlRCMk");
Double clsUTNumberUtilsP3RP0P2P1O0=-11.825526454314883D;
Object clsUTNumberUtilsP3RP0P2P1=clsUTNumberUtilsP3RP0P2P1O0;
String clsUTNumberUtilsP3RP0P2P2O0=new String(">?]$#qxd_ (;jiah+un");
Object clsUTNumberUtilsP3RP0P2P2=clsUTNumberUtilsP3RP0P2P2O0;
Short clsUTNumberUtilsP3RP0P2P3O0=1689;
Object clsUTNumberUtilsP3RP0P2P3=clsUTNumberUtilsP3RP0P2P3O0;
Object[] clsUTNumberUtilsP3RP0P2=new Object[]
{clsUTNumberUtilsP3RP0P2P1,clsUTNumberUtilsP3RP0P2P2,clsUTNumberUtilsP3RP0P2P3};
String clsUTNumberUtilsP3RP0R=null;
clsUTNumberUtilsP3RP0R=String.format(clsUTNumberUtilsP3RP0P1,(Object[])clsUTNumberUtilsP3RP0P2);
assertEquals("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWE
VETnqzBRdlRCMk",clsUTNumberUtilsP3RP0P1.toString());
assertEquals("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWE
VETnqzBRdlRCMk",clsUTNumberUtilsP3RP0R);
}
JTeXpert
Test Readability
“[Developers] read tests […] 77% of the total time
they spend in them”

Moritz Beller, Georgios Gousios, Annibale Panichella, and Andy Zaidman, “When,
How, and Why Developers (Do Not) Test in Their IDEs”. FSE 2015.
Generación de Casos de Prueba con
Nombres Descriptivos
joint work with Ermira Daka and Gordon Fraser
presented at ISSTA’17
Generación de Casos de Prueba con
Nombres Descriptivos
joint work with Ermira Daka and Gordon Fraser
presented at ISSTA’17
@Test(timeout = 4000)
public void test1() throws Throwable {
LinkedList<String> linkedList0 = new LinkedList<String>();
LinkedList<Object> linkedList1 = 

new LinkedList<Object>((Collection<?>) linkedList0);
FixedOrderComparator fixedOrderComparator0 = 

new FixedOrderComparator((List) linkedList1);
linkedList1.add((Object) linkedList1);
// Undeclared exception!
try {
fixedOrderComparator0.compare(linkedList1, linkedList0);
fail("Expecting exception: StackOverflowError");
} catch(StackOverflowError e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test1() throws Throwable {
LinkedList<String> linkedList0 = new LinkedList<String>();
LinkedList<Object> linkedList1 = 

new LinkedList<Object>((Collection<?>) linkedList0);
FixedOrderComparator fixedOrderComparator0 = 

new FixedOrderComparator((List) linkedList1);
linkedList1.add((Object) linkedList1);
// Undeclared exception!
try {
fixedOrderComparator0.compare(linkedList1, linkedList0);
fail("Expecting exception: StackOverflowError");
} catch(StackOverflowError e) {
//
// no message in exception (getMessage() returned null)
//
}
}
Coverage-Based Naming
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Method Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Method Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
testCreateShoppingCart
testAddPrice
testGetTotal
Method Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Exception Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Exception Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
testAddPriceThrowsIAE
Exception Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Output Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Output Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
testGetTotalReturnsZero
testGetTotalReturnsPositive
testGetTotalReturnsNegative
Output Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Input Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
Input Coverage
public class ShoppingCart {
private int total = 0;
private final static int MAX = 1000;
public boolean addPrice(int cost)
throws IllegalArgumentException {
if (cost <= 0)
throw new IllegalArgumentException(“Negative cost");
if (cost < MAX) {
total += cost;
return true;
} else {
return false;
}
}
public int getTotal() {
return total;
}
}
Coverage-Based Naming
testAddPriceWithZero
testAddPriceWithPositive
testAddPriceWithNegative
Input Coverage
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
3. Traducir objetivos a nombres
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
3. Traducir objetivos a nombres
4. Resolver conflictos: Unicidad entire
pares de casts de prueba
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
Test4Test3
Test1 Test2
Síntesis de Nombres de Casos de Prueba
1. Identificar objetivos cubiertos
únicamente por cada caso de prueba
2. Ordenar objetivos cubiertos

Exception > Method > Output > Input
3. Traducir objetivos a nombres
4. Resolver conflictos: Unicidad entire
pares de casts de prueba
5. Sufijos numéricos
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
M: createsShoppingCart

M: addPrice
O: addPriceReturningFalse
I: addPriceWithPositive
M: createsShoppingCart

M: getTotal

O: getTotalReturningZero
M: createsShoppingCart
M: addPrice

O: addPriceReturningTrue
I: addPriceWithPositive
M: createsShoppingCart
M: addPrice

E: addPriceThrowsIAE
I: addPriceWithZero
DEMO
Evaluación Empírica
Evaluación Empírica
RQ1: Do developers agree with synthesised test names?
Evaluación Empírica
RQ1: Do developers agree with synthesised test names?
RQ2: Can developers match tests with synthesised test names?
Evaluación Empírica
RQ1: Do developers agree with synthesised test names?
RQ3: Can synthesised test names help developers to match tests to
code under test?
RQ2: Can developers match tests with synthesised test names?
Evaluación Empírica
Evaluación Empírica
Estudio en línea
Evaluación Empírica
47 participantesEstudio en línea
Evaluación Empírica
47 participantes
10

clases Java
Estudio en línea
Evaluación Empírica
47 participantes
10

clases Java
Estudio en línea
2 expertos

como control
Evaluación Empírica
47 participantes
10

clases Java
Sin tiempo límite
Estudio en línea
2 expertos

como control
Test Names
ValueAxis
0%
10%
20%
30%
40%
50%
60%
Manually-written Synthesised
agree
impartial
disagree
Test Names
ValueAxis
0%
10%
20%
30%
40%
50%
60%
Manually-written Synthesised
agree
impartial
disagree
“Do you agree with the name of the following test?”
Test Names
ValueAxis
0%
10%
20%
30%
40%
50%
60%
Manually-written Synthesised
agree
impartial
disagree
Developers agreed similarly—and disagreed less—
with synthesized test names than with manually given
names.
“Do you agree with the name of the following test?”
Test Names
Test Names and Test Code
ValueAxis
0
10
20
30
40
50
Manually-written Synthesised
correct
don't know
incorrect
“For this test, select the most descriptive name from the list.”
Test Names and Test Code
Developers were slightly more accurate and faster at
matching tests with synthesized names.
ValueAxis
0
10
20
30
40
50
Manually-written Synthesised
correct
don't know
incorrect
“For this test, select the most descriptive name from the list.”
Test Names and Test Code
Test Names and Code under Test
ValueAxis
0
10
20
30
40
50
Manually-written Synthesised
correct
don't know
incorrect
“There is a bug in line X, which test would you choose?”
Test Names and Code under Test
Developers were more accurate at identifying
relevant tests for given pieces of code using
synthesized test names.
ValueAxis
0
10
20
30
40
50
Manually-written Synthesised
correct
don't know
incorrect
“There is a bug in line X, which test would you choose?”
Test Names and Code under Test
• Usar EvoSuite en la línea de comandos:

http://www.evosuite.org/documentation/tutorial-part-1/
• Usar EvoSuite con Maven:

http://www.evosuite.org/documentation/tutorial-part-2/
• Experimentos con EvoSuite:

http://www.evosuite.org/documentation/tutorial-part-3/
• Extender EvoSuite:

http://www.evosuite.org/documentation/tutorial-part-4/
Tutoriales
Trabajo Relacionado
Software Engineering Gamification, e.g., Code Defenders
Trabajo Relacionado
Pruebas automáticas de sistemas autónomos

(e.g. self-driving car)
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
App under test
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
App under test Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
App under test Test Generator Accessibility Tests
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
App under test Test Generator Accessibility Tests
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
AccessibilityApp Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Dev
AppAccessibility TestsApp Under Test Accessibility Test Generator
Trabajo Relacionado
Pruebas no funcionales para apps móviles, e.g., Accessibilidad
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
App under test Test Generator Accessibility Tests Developers/
App Store
Accessibility
Fixes/Labels
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Developer
App StoreAccessibility Tests
Accessibility Fixes
accessible
with support
not accessible
Accessibility Labels
Button
Button
App Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
AccessibilityApp Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
AccessibilityApp Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Dev
AppAccessibility TestsApp Under Test Accessibility Test Generator
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Dev
AppAccessibility TestsApp Under Test Accessibility Test Generator
evosuite.org
j.rojas@leicester.ac.uk

More Related Content

What's hot

C programs
C programsC programs
C programs
Minu S
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 
Network lab manual
Network lab manualNetwork lab manual
Network lab manual
Prabhu D
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
Swarup Kumar Boro
 
C basics
C basicsC basics
C basics
MSc CST
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
Rajeev Sharan
 

What's hot (20)

C
CC
C
 
C Programming
C ProgrammingC Programming
C Programming
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
C programs
C programsC programs
C programs
 
Hargun
HargunHargun
Hargun
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
 
C programms
C programmsC programms
C programms
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
 
Network lab manual
Network lab manualNetwork lab manual
Network lab manual
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
C basics
C basicsC basics
C basics
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
C programming
C programmingC programming
C programming
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 

Similar to Search-based Unit Test Generation with EvoSuite

Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
DOSONKA Group
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
Azhar Javed
 
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdfSolve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
snewfashion
 

Similar to Search-based Unit Test Generation with EvoSuite (20)

Lab Question
Lab QuestionLab Question
Lab Question
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
 
C programs
C programsC programs
C programs
 
sodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdfsodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdf
 
Slide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfSlide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdf
 
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015
 
pointers 1
pointers 1pointers 1
pointers 1
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Safe int
Safe intSafe int
Safe int
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
CPP Language Basics - Reference
CPP Language Basics - ReferenceCPP Language Basics - Reference
CPP Language Basics - Reference
 
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdfSolve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
 
Lab # 2
Lab # 2Lab # 2
Lab # 2
 
Include
IncludeInclude
Include
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
Vcs14
Vcs14Vcs14
Vcs14
 

More from Facultad de Informática UCM

More from Facultad de Informática UCM (20)

¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?
 
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
 
DRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersDRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation Computers
 
uElectronics ongoing activities at ESA
uElectronics ongoing activities at ESAuElectronics ongoing activities at ESA
uElectronics ongoing activities at ESA
 
Tendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmTendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura Arm
 
Formalizing Mathematics in Lean
Formalizing Mathematics in LeanFormalizing Mathematics in Lean
Formalizing Mathematics in Lean
 
Introduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingIntroduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented Computing
 
Computer Design Concepts for Machine Learning
Computer Design Concepts for Machine LearningComputer Design Concepts for Machine Learning
Computer Design Concepts for Machine Learning
 
Inteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroInteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuro
 
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 Design Automation Approaches for Real-Time Edge Computing for Science Applic... Design Automation Approaches for Real-Time Edge Computing for Science Applic...
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
 
Fault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error Correction
 
Cómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intentoCómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intento
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPC
 
Type and proof structures for concurrency
Type and proof structures for concurrencyType and proof structures for concurrency
Type and proof structures for concurrency
 
Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...
 
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
 
Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?
 
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
 
Challenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windChallenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore wind
 

Recently uploaded

ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data AnalysisIT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and ClusteringKIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

Search-based Unit Test Generation with EvoSuite

  • 1. D e p a r t m e n t O f I n f o r m a t i c s EvoSuite: Generación Automática de Casos de Prueba José Miguel Rojas UCM, Madrid, EspañaSome slides borrowed from Prof. G. Fraser
  • 2. CV • Ingeniería Informática
 Universidad Autónoma Gabriel René Moreno, Bolivia (2001–2006) • Doctorado en Software y Sistemas
 Universidad Politécnica de Madrid, España (2009–2013) • Tesis Doctoral: Generación Automática de Casos de Prueba en Programación Orientada a Objetos • Investigador Post-doctoral (Research Associate)
 The University of Sheffield, Reino Unido (2014–2017) • Profesor Asistente (Lecturer)
 University of Leicester, Reino Unido (2017–presente)
  • 4.
  • 5.
  • 7.
  • 8. Ariane 5, primer vuelo, 1996
  • 11. Métodos para la Calidad del Software Organizacionales Constructivos Analíticos Gestión de Proyectos Ing. Software Constructiva RevisionesAutomáticos Walkthrough InspecciónAnálisis DinámicosAnálisis Estáticos Verificación Formal Pruebas Verificación y Validación
  • 12. Métodos para la Calidad del Software Organizacionales Constructivos Analíticos Gestión de Proyectos Ing. Software Constructiva RevisionesAutomáticos Walkthrough InspecciónAnálisis DinámicosAnálisis Estáticos Verificación Formal Pruebas Verificación y Validación
  • 13. Pruebas de Software “La selección de entradas para un sistema con la intención de provocar fallos en dicho sistema, revelando de tal forma la presencia de errores” ”Las pruebas de software solo pueden demostrar la presencia de errores, no su ausencia.” (E. Dijkstra)
  • 14. Requerimientos Especificación Diseño Arquitectural Diseño de Módulos Implementación Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Software
  • 15. Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Unidad 1.Ejecutar programa, usando datos de prueba (input) 2.Verificar salida del programa (output), usando oráculo de pruebas (test oracle)
  • 16. Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Unidad ProgramaEntrada Salida
  • 17. Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Unidad ProgramaEntrada Salida Salida Esperada
  • 18. Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Unidad ProgramaEntrada Salida Salida Esperada
  • 19. Pruebas de Unidad Pruebas de Integración Pruebas de Sistema Pruebas de Aceptación Pruebas de Unidad ProgramaEntrada Salida Salida Esperada
  • 20. Statement testing Branch testing Basic
 condition testing MC/DC testing Compound
 condition testing Path testing Loop boundary
 testing Branch and
 condition testing LCSAJ testing Boundary
 interior testing CriteriosPrácticosCriteriosTeóricos subsume Criterios de Pruebas
  • 21. Statement testing Branch testing Basic
 condition testing MC/DC testing Compound
 condition testing Path testing Loop boundary
 testing Branch and
 condition testing LCSAJ testing Boundary
 interior testing CriteriosPrácticosCriteriosTeóricos subsume Criterios de Pruebas
  • 22. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j”
  • 23. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔
  • 24. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔
  • 25. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔
  • 26. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔
  • 27. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔
  • 28. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔
  • 29. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔
  • 30. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M A B C D E GF H I L M 0 25 50 75 100 Coverage 87 “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔
  • 31. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M 0 25 50 75 100 Coverage 87 A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔
  • 32. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M 0 25 50 75 100 Coverage 87 A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔ “abc”
  • 33. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M 0 25 50 75 100 Coverage 87 A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔ “abc” ✔
  • 34. { char *eptr = encoded; char *dptr = decoded; int ok = 0; char c; c = *eptr; if (c == '+') { *dptr = ' '; } while (*eptr) { True *dptr = '0'; return ok; } False True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 || digit_low == -1) { True ok = 1; } True else { *dptr = 16 * digit_high + digit_low; } False ++dptr; ++eptr; } False False elseif (c == '%') { else *dptr = *eptr; } int cgi_decode(char *encoded, char *decoded) A C B D E F G H I L M 0 25 50 75 100 Coverage 87 0 25 50 75 100 Coverage 100 A B C D E GF H I L M “+%0d+%4j” ✔ ✔✔ ✔ ✔ ✔ ✔ “abc” ✔
  • 35. Branch Coverage (Recubrimiento de Ramas de Programa?) • Criterio de adecuación: Cada rama (branch) del programa debe ser ejecutada al menos una vez • Recubrimiento: # ramas ejecutadas
 # ramas • Subsume el criterio de instrucciones de código
 Visitar todas las ramas implica visitar todos los nodos • El criterio más aplicado en práctica • Criterio estructural • Alternativa: mutation scores
  • 36. Stress Testing State Machine Testing L. C. Briand,Y. Labiche, and M. Shousha,“Stress testing real-time systems with genetic algorithms”. GECCO 2005. K. Derderian, R. Hierons, M. Harman, and Q. Guo,“Automated unique input output sequence generation for conformance testing of FSMs”.The Computer Journal, 2006. Combinatorial Interaction Testing M.B. Cohen, M.B. Dwyer and J. Shi,“Interaction testing of highly-configurable systems in the presence of constraints”, ISSTA 2007. Search-based Testing (SBST)
  • 37. Stress Testing State Machine Testing L. C. Briand,Y. Labiche, and M. Shousha,“Stress testing real-time systems with genetic algorithms”. GECCO 2005. K. Derderian, R. Hierons, M. Harman, and Q. Guo,“Automated unique input output sequence generation for conformance testing of FSMs”.The Computer Journal, 2006. Combinatorial Interaction Testing M.B. Cohen, M.B. Dwyer and J. Shi,“Interaction testing of highly-configurable systems in the presence of constraints”, ISSTA 2007. Search-based Testing (SBST)
  • 38. Generación Basada en Búsqueda Entrada Búsqueda Aleatoria C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed Random Test Generation”, ICSE 2007.
  • 39. Generación Basada en Búsqueda Entrada Búsqueda Aleatoria C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed Random Test Generation”, ICSE 2007.
  • 40. Generación Basada en Búsqueda Entrada Búsqueda Aleatoria C. Pacheco, S. K. Lahiri, M. D. Ernst and T. Ball,“Feedback-Directed Random Test Generation”, ICSE 2007.
  • 41. Generación Basada en Búsqueda Entrada Fitness Búsqueda Guiada por “Fitness” G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013.
  • 42. Generación Basada en Búsqueda Entrada Fitness Búsqueda Guiada por “Fitness” G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013.
  • 43. Generación Basada en Búsqueda Entrada Fitness G. Fraser and A.Arcuri,“Whole Test Suite Generation”,TSE 2013. Búsqueda Guiada por “Fitness”
  • 47. Caso de Uso Básico Código Fuente
  • 48. Caso de Uso Básico Código Fuente Casos de Prueba
  • 49. Caso de Uso Básico Código Fuente Casos de Prueba
  • 50. Caso de Uso Básico Código Fuente Casos de Prueba Generación Automática
  • 51. @Test public void test() { } int x = 2; int y = 2; int result = x + y; assertEquals(4, result);
  • 52. @Test public void test() { } DateTime var3 = var1.toDateTime(var2); DateTime var4 = var3.minus(var0); TimeOfDay var2 = new TimeOfDay(); YearMonthDay var1 = newYearMonthDay(var0); int var0 = 10 DateTime var5 = var4.plusSeconds(var0);
  • 53. Generación de “Test Suites” DateTime var3 = var1.toDateTime(var2); DateTime var4 = var3.minus(var0); TimeOfDay var2 = new TimeOfDay(); YearMonthDay var1 = newYearMonthDay(var0); int var0 = 10 DateTime var5 = var4.plusSeconds(var0);
  • 61. Fitness public int gcd(int x, int y) { int tmp; while (y != 0) { tmp = x % y; x = y; y = tmp; } return x; }
  • 62. Fitness public int gcd(int x, int y) { int tmp; while (y != 0) { tmp = x % y; x = y; y = tmp; } return x; }
  • 63. Código Abierto http://www.evosuite.org/ https://github.com/evosuite/evosuite • Paquete Jar – Uso en línea de comandos • Plug-ins IntelliJ y Eclipse – Uso durante el desarrollo • Plug-in Maven – Uso automatizado • Plug-in Jenkins – Uso en integración continua
  • 64. Uso en Línea de Comandos • Opciones principales
 -projectCP
 -class
 -criterion • Propiedades • Search budget (s)
 -Dsearch_budget=60 • Generación de aserciones
 -Dassertions=false
 -Dassertion_strategy=all • Minimización (length and values)
 -Dminimize=false • Inlining
 -Dinline=false
  • 65. DEMO
  • 67. Code Coverage (EMSE 2017) Fault Detection (ASE’15)
  • 69. @Test(timeout = 4000) public void test01() throws Throwable { LinkedList<String> linkedList0 = new LinkedList<String>(); LinkedList<Object> linkedList1 = 
 new LinkedList<Object>((Collection<?>) linkedList0); FixedOrderComparator fixedOrderComparator0 = 
 new FixedOrderComparator((List) linkedList1); linkedList1.add((Object) linkedList1); // Undeclared exception! try { fixedOrderComparator0.compare(linkedList1, linkedList0); fail("Expecting exception: StackOverflowError"); } catch(StackOverflowError e) { // // no message in exception (getMessage() returned null) // } }
  • 70. @Test public void test002() throws Throwable { if (debug) { System.out.format("%n%s%n","RegressionTest2.test002"); } java.lang.Object[] obj_array1 = new java.lang.Object[] { (short)10 }; collections.comparators.FixedOrderComparator fixedOrderComparator2 = 
 new collections.comparators.FixedOrderComparator(obj_array1); java.util.Comparator comparator3 = fixedOrderComparator2.reversed(); java.util.Comparator comparator4 = comparator3.reversed(); java.lang.Object[] obj_array6 = new java.lang.Object[] { (short)10 }; collections.comparators.FixedOrderComparator fixedOrderComparator7 = 
 new collections.comparators.FixedOrderComparator(obj_array6); java.util.Comparator comparator8 =
 comparator4.thenComparing((java.util.Comparator)fixedOrderComparator7); boolean b10 = fixedOrderComparator7.add((java.lang.Object)10L); int i11 = fixedOrderComparator7.getUnknownObjectBehavior(); boolean b12 = fixedOrderComparator7.isLocked(); fixedOrderComparator7.setUnknownObjectBehavior( 0 ); ... ... }
  • 71. /** * Chromosome : 1)----->org.apache.commons.lang3.math.NumberUtils[] 2)----->min[[30823,57]], 3)----->toString[] Covered Branches:[1, 113, 114, 115, 109, 111] */ @Test public void TestCase1() throws Throwable { NumberUtils clsUTNumberUtils=null; clsUTNumberUtils=new NumberUtils(); short[] clsUTNumberUtilsP2P1=new short[]{30823,57}; short clsUTNumberUtilsP2R=0; clsUTNumberUtilsP2R=NumberUtils.min(clsUTNumberUtilsP2P1); assertTrue(Arrays.equals(new short[]{30823,57},clsUTNumberUtilsP2P1)); assertEquals(57,clsUTNumberUtilsP2R); String clsUTNumberUtilsP3R=null; clsUTNumberUtilsP3R=clsUTNumberUtils.toString(); String clsUTNumberUtilsP3RP0P1=new String("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWEVETnqz BRdlRCMk"); Double clsUTNumberUtilsP3RP0P2P1O0=-11.825526454314883D; Object clsUTNumberUtilsP3RP0P2P1=clsUTNumberUtilsP3RP0P2P1O0; String clsUTNumberUtilsP3RP0P2P2O0=new String(">?]$#qxd_ (;jiah+un"); Object clsUTNumberUtilsP3RP0P2P2=clsUTNumberUtilsP3RP0P2P2O0; Short clsUTNumberUtilsP3RP0P2P3O0=1689; Object clsUTNumberUtilsP3RP0P2P3=clsUTNumberUtilsP3RP0P2P3O0; Object[] clsUTNumberUtilsP3RP0P2=new Object[] {clsUTNumberUtilsP3RP0P2P1,clsUTNumberUtilsP3RP0P2P2,clsUTNumberUtilsP3RP0P2P3}; String clsUTNumberUtilsP3RP0R=null; clsUTNumberUtilsP3RP0R=String.format(clsUTNumberUtilsP3RP0P1,(Object[])clsUTNumberUtilsP3RP0P2); assertEquals("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWE VETnqzBRdlRCMk",clsUTNumberUtilsP3RP0P1.toString()); assertEquals("YfJOufsFnsYRrFHBpCyLgDWEmhiRPOGISMsFFCYjMOSisquxKCuSHIOrrEBbqqwfBtBmhuiUWUSsKUAfloLlYPBYmyihySJwWE VETnqzBRdlRCMk",clsUTNumberUtilsP3RP0R); } JTeXpert
  • 72.
  • 73. Test Readability “[Developers] read tests […] 77% of the total time they spend in them”
 Moritz Beller, Georgios Gousios, Annibale Panichella, and Andy Zaidman, “When, How, and Why Developers (Do Not) Test in Their IDEs”. FSE 2015.
  • 74. Generación de Casos de Prueba con Nombres Descriptivos joint work with Ermira Daka and Gordon Fraser presented at ISSTA’17
  • 75. Generación de Casos de Prueba con Nombres Descriptivos joint work with Ermira Daka and Gordon Fraser presented at ISSTA’17
  • 76. @Test(timeout = 4000) public void test1() throws Throwable { LinkedList<String> linkedList0 = new LinkedList<String>(); LinkedList<Object> linkedList1 = 
 new LinkedList<Object>((Collection<?>) linkedList0); FixedOrderComparator fixedOrderComparator0 = 
 new FixedOrderComparator((List) linkedList1); linkedList1.add((Object) linkedList1); // Undeclared exception! try { fixedOrderComparator0.compare(linkedList1, linkedList0); fail("Expecting exception: StackOverflowError"); } catch(StackOverflowError e) { // // no message in exception (getMessage() returned null) // } }
  • 77. @Test(timeout = 4000) public void test1() throws Throwable { LinkedList<String> linkedList0 = new LinkedList<String>(); LinkedList<Object> linkedList1 = 
 new LinkedList<Object>((Collection<?>) linkedList0); FixedOrderComparator fixedOrderComparator0 = 
 new FixedOrderComparator((List) linkedList1); linkedList1.add((Object) linkedList1); // Undeclared exception! try { fixedOrderComparator0.compare(linkedList1, linkedList0); fail("Expecting exception: StackOverflowError"); } catch(StackOverflowError e) { // // no message in exception (getMessage() returned null) // } }
  • 79. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming
  • 80. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Method Coverage
  • 81. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Method Coverage
  • 82. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming testCreateShoppingCart testAddPrice testGetTotal Method Coverage
  • 83. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Exception Coverage
  • 84. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Exception Coverage
  • 85. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming testAddPriceThrowsIAE Exception Coverage
  • 86. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Output Coverage
  • 87. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Output Coverage
  • 88. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming testGetTotalReturnsZero testGetTotalReturnsPositive testGetTotalReturnsNegative Output Coverage
  • 89. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Input Coverage
  • 90. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming Input Coverage
  • 91. public class ShoppingCart { private int total = 0; private final static int MAX = 1000; public boolean addPrice(int cost) throws IllegalArgumentException { if (cost <= 0) throw new IllegalArgumentException(“Negative cost"); if (cost < MAX) { total += cost; return true; } else { return false; } } public int getTotal() { return total; } } Coverage-Based Naming testAddPriceWithZero testAddPriceWithPositive testAddPriceWithNegative Input Coverage
  • 92. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba
  • 93. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero
  • 94. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero
  • 95. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive
  • 96. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 97. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 98. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 99. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 100. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 101. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 102. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 103. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 104. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input 3. Traducir objetivos a nombres M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 105. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input 3. Traducir objetivos a nombres 4. Resolver conflictos: Unicidad entire pares de casts de prueba M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 106. Test4Test3 Test1 Test2 Síntesis de Nombres de Casos de Prueba 1. Identificar objetivos cubiertos únicamente por cada caso de prueba 2. Ordenar objetivos cubiertos
 Exception > Method > Output > Input 3. Traducir objetivos a nombres 4. Resolver conflictos: Unicidad entire pares de casts de prueba 5. Sufijos numéricos M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero M: createsShoppingCart
 M: addPrice O: addPriceReturningFalse I: addPriceWithPositive M: createsShoppingCart
 M: getTotal
 O: getTotalReturningZero M: createsShoppingCart M: addPrice
 O: addPriceReturningTrue I: addPriceWithPositive M: createsShoppingCart M: addPrice
 E: addPriceThrowsIAE I: addPriceWithZero
  • 107. DEMO
  • 109. Evaluación Empírica RQ1: Do developers agree with synthesised test names?
  • 110. Evaluación Empírica RQ1: Do developers agree with synthesised test names? RQ2: Can developers match tests with synthesised test names?
  • 111. Evaluación Empírica RQ1: Do developers agree with synthesised test names? RQ3: Can synthesised test names help developers to match tests to code under test? RQ2: Can developers match tests with synthesised test names?
  • 116. Evaluación Empírica 47 participantes 10
 clases Java Estudio en línea 2 expertos
 como control
  • 117. Evaluación Empírica 47 participantes 10
 clases Java Sin tiempo límite Estudio en línea 2 expertos
 como control
  • 121. ValueAxis 0% 10% 20% 30% 40% 50% 60% Manually-written Synthesised agree impartial disagree Developers agreed similarly—and disagreed less— with synthesized test names than with manually given names. “Do you agree with the name of the following test?” Test Names
  • 122. Test Names and Test Code
  • 123. ValueAxis 0 10 20 30 40 50 Manually-written Synthesised correct don't know incorrect “For this test, select the most descriptive name from the list.” Test Names and Test Code
  • 124. Developers were slightly more accurate and faster at matching tests with synthesized names. ValueAxis 0 10 20 30 40 50 Manually-written Synthesised correct don't know incorrect “For this test, select the most descriptive name from the list.” Test Names and Test Code
  • 125. Test Names and Code under Test
  • 126. ValueAxis 0 10 20 30 40 50 Manually-written Synthesised correct don't know incorrect “There is a bug in line X, which test would you choose?” Test Names and Code under Test
  • 127. Developers were more accurate at identifying relevant tests for given pieces of code using synthesized test names. ValueAxis 0 10 20 30 40 50 Manually-written Synthesised correct don't know incorrect “There is a bug in line X, which test would you choose?” Test Names and Code under Test
  • 128. • Usar EvoSuite en la línea de comandos:
 http://www.evosuite.org/documentation/tutorial-part-1/ • Usar EvoSuite con Maven:
 http://www.evosuite.org/documentation/tutorial-part-2/ • Experimentos con EvoSuite:
 http://www.evosuite.org/documentation/tutorial-part-3/ • Extender EvoSuite:
 http://www.evosuite.org/documentation/tutorial-part-4/ Tutoriales
  • 129. Trabajo Relacionado Software Engineering Gamification, e.g., Code Defenders
  • 130. Trabajo Relacionado Pruebas automáticas de sistemas autónomos
 (e.g. self-driving car)
  • 131. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad
  • 132. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad App under test
  • 133. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator App under test Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator
  • 134. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator App under test Test Generator Accessibility Tests Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator
  • 135. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator App under test Test Generator Accessibility Tests Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google AccessibilityApp Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Dev AppAccessibility TestsApp Under Test Accessibility Test Generator
  • 136. Trabajo Relacionado Pruebas no funcionales para apps móviles, e.g., Accessibilidad Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator App under test Test Generator Accessibility Tests Developers/ App Store Accessibility Fixes/Labels Carrier 12:00 PM Page Title http://www.domain.com Google Developer App StoreAccessibility Tests Accessibility Fixes accessible with support not accessible Accessibility Labels Button Button App Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google AccessibilityApp Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google AccessibilityApp Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Dev AppAccessibility TestsApp Under Test Accessibility Test Generator Carrier 12:00 PM Page Title http://www.domain.com Google Dev AppAccessibility TestsApp Under Test Accessibility Test Generator