20
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 Valencia Spain Test Automation at the useR interface level

Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 2: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

• 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

Page 3: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 4: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

• 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?

Page 5: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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 ...

Page 6: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

6

Widget Tree

Page 7: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 8: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 9: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 10: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 11: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

Herramienta TESTARREADY

11

Establecer cómo se iniciala aplicación a probar

Page 12: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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…….

Page 13: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

13

GO!

Page 14: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

100% Automatico – no effort

• Crashes

• Bloqueos de programa

Page 15: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

15

Expresión Regular

• Diálogos de mensaje críticos

• Output sospechoso

Page 16: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

Expresion regular – muy poco effort

• Simplemente con expresiones regulares

• Por ejemplo:

.*NullPointerException

.*|[Ee]rror|[Pp]roblem

Page 17: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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

Page 18: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

¡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)

Page 19: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

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!

Page 20: Test Automation at the useR interface leveliwt2.org/wp-content/uploads/2015/05/Ponente-2-PROS-Universidad-P... · Bu tton T ext Menu Slider MI MI MI MI typ e: T MenuItem... title:

• Tanja E. J. Vos

• correo: [email protected]

• twitter/skype: tanja_vos

• web: http://staq.dsic.upv.es/

• teléfono: +34 690 917 971