You are on page 1of 62

Tcnicas, Estrategias y

Herramientas de Pruebas
del Software
Introduccin

Jos Miguel Rojas


Research Associate in Software Testing
Department of Computer Science
Parte de este contenido ha sido provisto por Dr. Gordon Fraser (The University of Sheffield)
CV
Ingeniera Informtica - Universidad Autnoma
Gabriel Ren Moreno (2001-2006)
Diplomado en Educacin Superior (2006)
Diplomado en Liderazgo (2006)
Doctorado en Desarrollo de Sistemas Software
Complejos - Universidad Politcnica de Madrid
(2009-2013)
Tesis Doctoral: Generacin Automtica de Casos
de Prueba en Programacin Orientada a Objetos
Sheffield
Where is
Sheffield?

5th largest city in the UK


The University

Computer Science
Made in Sheffield
Football
Made in Sheffield
Real Ale
Made in Sheffield
Yorkshire Pudding
Made in Sheffield
Hendersons Relish
Made in Sheffield
Ned Stark
Made in Sheffield
The Arctic Monkeys
In Sheffield
The Peak District
Disclaimer
Bugs!
The First Software Bug
(September 9, 1947)
It has been just so in all of
my inventions. The first step
is an intuition, and comes
with a burst, then difficulties
arisethis thing gives out
and [it is] then that 'Bugs'
as such little faults and
difficulties are calledshow
themselves and months of
intense watching, study and
labor are requisite. . .
Thomas Edison
an analyzing process must
equally have been performed in
order to furnish the Analytical
Engine with the necessary
operative data; and that herein
may also lie a possible source of
error. Granted that the actual
mechanism is unerring in its
processes, the cards may give it
wrong orders.
Ada, Countess Lovelace (notes on Babbages Analytical
Engine)
Software libre de
errores?
Promedio en la
Industria?

15 - 50 errores cada 1000 lneas de cdigo


Microsoft:
10-20 bugs/KLOC durante pruebas internas
0.5 bugs/KLOC al momento del release
Windows XP: 45MLOC
Al menos 22,500 bugs!
Android: 15 MLOC
Linux kernel 2.6.35: 13.5 MLOC
Distribucin Linux tpica: > 300 MLOC
Mac OS X 10.4: 80 MLOC
Si un error por KLOC es inaceptable:
1KLOC impresas en papel - 30-40 pginas
Un error cada 30-40 pginas
Baja calidad?
Ningn otro artefacto producido por el ser
humano se acerca a este nivel de calidad
Automviles hoy en da: ~10MLOC
En un futuro cercano: ~300MLOC
Incluso con los mejores programadores del
mundo, el automvil promedio de la
prxima generacin contendr ~150,000
bugs entre todos sus sistemas
Qu tipos de sistemas
son ms vulnerables?
Denver International Airport
Sistema de gestin automtica de equipaje
Patriot-Scud

Misiles antibalsticos Patriot


Sept. 26, 1983
Incidente del equinoccio de otoo

La gente no empieza una guerra nuclear


con solo cinco misiles.
Mars Climate Orbiter
...
IF (TVAL .LT. 0.2E-2) GOTO 40
DO 40 M = 1, 3
W0 = (M-1)*0.5
X = H*1.74533E-2*W0
DO 20 N0 = 1, 8
EPS = 5.0*10.0**(N0-7)
CALL BESJ(X, 0, B0, EPS, IER)
IF (IER .EQ. 0) GOTO 10
20 CONTINUE
DO 5 K = 1. 3
T(K) = W0
Z = 1.0/(X**2)*B1**2+3.0977E-4*B0**2
D(K) = 3.076E-2*2.0*(1.0/X*B0*B1+3.0977E-4*
*(B0**2-X*B0*B1))/Z
E(K) = H**2*93.2943*W0/SIN(W0)*Z
H = D(K)-E(K)
5 CONTINUE
10 CONTINUE
Y = H/W0-1
40 CONTINUE
...
Therac-25 Radiation Therapy Machine
Therac 25
London Ambulance Service (1992)
The Heartbleed Bug
The Curiosity Rover
Qu podemos hacer
para reducir el nmero
de bugs?
Dijkstras law

Testing can show the


presence but not their
absence.
Contenido del Curso
Introduccin

Mtodos para la Calidad del Software

Pruebas de Unidad (Unit Testing)

Generacin Automtica de Casos de Prueba

Pruebas Funcionales (Functional Testing)

Pruebas Estructurales (Structural Testing)

Ejecucin Simblica

Pruebas Basadas en Bsqueda (Search-based Testing)

Pruebas de Mutacin (Mutation Testing)

Miscelnea
Bibliografa
Planificacin
Sesin Tema Herramienta
Lunes 1 Introduccin

Mrtes 2 Calidad del Software

Jueves 4 Pruebas de Unidad JUnit

Sbado 6 Pruebas Funcionales Randoop

Lunes 8 Ejecucin Simblica PET

Mrtes 9 Pruebas basadas en Bsqueda EvoSuite

Jueves 11 Pruebas de Mutacin MuJava / Major

Sbado 13 Miscelnea y Evaluacin


Evaluacin

Participacin (10%)
Ejercicios en Clase (40%)
Evaluacin Final (50%)
64 <= Nota de Aprobacin <= 100
Evaluacin Final
Opcin 1: Examen
Opcin II: Presentaciones
Pruebas de Aplicaciones Web con Selenium
Pruebas de Aplicaciones Android con
Robotium
Pruebas y Procesos de Software
Casos de Estudio, etc.
Evaluacin Final
(j.rojas@sheffield.ac.uk)
Tema Quienes?
1 Pruebas de Aplicaciones Web con Ana Lima Loayza
Selenium Ysai Galarza Escalera
2 Pruebas de Aplicaciones Android Isis Roman
con Robotium Benito Vargas
3 Pruebas en Metodologas giles Alcides Leaos
Richard Moron
4 Anlisis esttico con FindBugs Leonardo Vargas

5 Model Checking con NuSMV ?

6 Pruebas usando Django John Vidal


Janina
7 Pruebas Android Roblectric Oscar Weymar Uscamaita
Daniela Osinaga
8 ? ?
Contacto

j.rojas@sheffield.ac.uk

You might also like