Tanja E. J. Vos
(Urko Rueda, Francisco Almenar, Mirella Oreto, Anna Esparcia)
Software Testing and Quality Group (StaQ)Research center for Software Production Methods (PROS)
Universidad Politecnica de ValenciaSpain
Test Automation at the useR interface level
• TESTAR
– Una herramienta para el testeo automatizado a nivel de interfaz de usuario
• NO ES Capture/Replay– Captura la interacción del usuario con la IU y almacena un script que puede ser reproducido
durante el testeo de regresión– Cambios en la IU (en tiempo de desarrollo y de ejecución)– Ruptura de tests de regresión automatizados– Gran problema de mantenimiento
• NO ES testeo Visual– Basado en reconocimiento de imágenes– Fácil de entender, habilidades de programación no requeridas– Resuelve la mayoría de los problemas de mantenimiento– Introduce problemas adicionales
• Rendimiento de procesamiento de imágenes• Falsos positivos y falsos negativos
– La ambigüedad asociada con los localizadores de imágenes– Imprecisión de reconocimiento de imágenes alimentada en los oráculos
Resultado de I+D de la UPV centro PROS
Resultados de I+D de la UPV centro PROS
• Testing basado en Modelos -- TESTAR – Basado en inferencia automática de modelos en árbol de la IU
– Secuencias de test derivadas automáticamente desde el modelo
– Las secuencias ejecutadas pueden ser reproducidas
– Si la IU cambia también lo hace el modelo/tests -> se elimina el problema de mantenimiento de los tests
– Necesario: habilidades de programación para definir oráculos potentes
• Más investigación si esto supone realmente un problema …
• ¿Queremos que los testeadores tengan habilidades de programación?
type: TButton
...rect: [15, 25, 65, 55]
hasFocus: trueenabled: falsetitle: "Button"
Window
Button Text SliderMenu
MI MI MI MI
type: TMenuItem
...title: "File"
ABC
type: TButton
...rect: [15, 25, 65, 55]
hasFocus: trueenabled: falsetitle: "Button"
Window
Button Text SliderMenu
MI MI MI MI
type: TMenuItem
...title: "File"
ABC
• La IU es donde se concentra toda la funcionalidad
– Testeo de Integración / Sistema
• La mayoría de aplicaciones tienen IUs
– Ordenadores, tabletas, smartphones, ….
• Fallos que aparecen a nivel de IU son importantes
– Estos son los que encuentra tu cliente -> testea desde su perspectiva!
• Sin necesidad de código fuente
– Pero si lo tenemos, tanto mejor ;-)
¿Por qué es útil?
5
START
SUT
SCAN GUI +
OBTAIN
WIDGET TREE
more
actions?
Domain Experts
DERIVE SET
OF USER
ACTIONS
EXECUTE
ACTION
calculate
fitness of test
sequence
No
Yes
Action
Definitions
Oracle
Definition
STOP
SUT
SUT
optional
instrumentation
Replayable Erroneous Sequences
ORACLEFAULT?
Yes
No
more sequences?
SELECT
ACTION
Cómo
funciona ...
6
Widget Tree
Basicamente: TODOS
Applicaciones que respetan la API de accessibilidad del sistema operativo en que se ejecuta el spftwar
¿Que tipo de software?
GUI state, Faults Runtime data Test Suites
ABSTRACTION LAYER
Tes
tE
xecu
tion
Tes
tE
valu
ati
on
Tes
t
Ex
ec
utio
n
Tes
t
Ev
alu
ati
on
Tes
t
Ex
ecu
tion
Tes
t
Ev
alu
ati
on
Tes
t
Ex
ecu
tion
Tes
t
Ev
alu
ati
on
What do you need??
Test Suite Generator
Abstract Representation (WIDGET TREE)
Abstract Oracles
Cheap Oracles
Free Oracles
How to set it up for a specific SUT
8
1) Planning Phase:a) Implementation of Test Environment: Recognize all the UI elements
b) Anticipate and identify potential fault patterns: what errors do we want to find:
• Detect crashes is for free and automatically
• Suspicious output or messages is easy (regular expression)
• Functionality as defined in the specifications (need oracle programming)
Test the SUT
Implement
Plan
How to set it up for a specific SUT
9
2) Implementation Phase:a) Oracle Implementation
• Implement the detection of the errors defined in the previous step.
b) Action Definition Implementation
c) Implementation of stopping criteria
Test the SUT
Implement
Plan
How to set it up for a specific SUT
10
3) Testing Phase: run the test to find errors in the SUT
Test the SUT
Implement
Plan
Herramienta TESTARREADY
11
Establecer cómo se iniciala aplicación a probar
Herramienta TESTARSET
12
Filtro:
1) Acciones no deseadas, p.e. cierre de la aplicación
2) Procesos no deseados, p.e. Paneles de ayuda en Acrobat, etc…….
13
GO!
100% Automatico – no effort
• Crashes
• Bloqueos de programa
15
Expresión Regular
• Diálogos de mensaje críticos
• Output sospechoso
Expresion regular – muy poco effort
• Simplemente con expresiones regulares
• Por ejemplo:
.*NullPointerException
.*|[Ee]rror|[Pp]roblem
Más sofisticación necesita trabajo
• Acciones– Detección de acciones
– Selección de acciones
– A veces, un proceso de prueba y error
• Selección aleatoria = como un niño, pero mucho más rápido
• Imprimiendo, copiando ficheros / moviendo / borrando
• Lanza otros Procesos
• Gestión de permisos, cuentas de usuario dedicadas, acciones denegadas
• Oráculos que necesitan programación
¡Ya lo hemos usado con éxito!
• Para varias aplicaciones de Microsoft Office
• Para probar TESTONA (Testeo Basado en Árboles Combinatorios) en Berner&Mattner (Alemania)
• Para PINEA/Clavei (Alicante) y su Enterprise Resource Planning (ERP) systems for SMEs (versión de escritorio)
• Aplicación web en PHP (back-end de Modelio Modeller) de SOFTEAM (Francia)
It can automatically
generate tests that find
interesting errors!
TESTAR
in working environment
ACADEMIA
DEPLOY
ASSIST
ADOPT
What if company has
no knowledge of TESTAR and we deal
with mature software?
TESTAR
for mature software product
ACADEMIA
ASSIST
DEPLOY
It can automatically
generate tests that find
interesting errors!
ADOPT
Can the company do it by its own?
DEVELOP
ACADEMIA
Training material
TESTAR
for mature software productACADEMIA
DEPLOY
TRAIN
ADOPT
ACADEMIC
IMPROVE
Tool &Training material
Internal Innovation
transfer within company that was part of
development
External Innovation
Transfer based on close
academia-industry
collaboration
External Innovation
Transfer where academia role is
reduced to training the technology
DE
CR
EA
SIN
G IN
VO
LV
EM
EN
T O
F T
EC
HN
OL
OG
Y D
EV
EL
OP
ER
S
B&M
CLAVEi
SOFTEAM
B&M
CLAVEi
SOFTEAM
It can automatically
generate tests that find
interesting errors and
the learning curve is
acceptable!
• Tanja E. J. Vos
• correo: [email protected]
• twitter/skype: tanja_vos
• web: http://staq.dsic.upv.es/
• teléfono: +34 690 917 971