tio myter om testautomation - software...

38
Hello world

Upload: others

Post on 28-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Hello world

Page 2: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Testautomation

När, var, hur?

Jörgen Damberg, Claremont, SAST Örebro 2014-06-03

Page 3: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Vad vill ni prata/höra om?

Page 4: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

10 CLS

20 Print Testing, boring routine work?

30 REM Short

40 PRINT Test automation introduction

50 PRINT Test automation concepts

60 PRINT Do/Dont

70 PRINT Tools

80 INPUT$

90 GOTO Mingle

100 SLEEP 60*60

110 GOTO Home

Page 5: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Testningens uppgift

• Tänka på allt som ingen annan tänkt på • Finna ut var olika människor förstått eller tolkat samma sak

olika

• Upptäcka alla förutsättningar som ingen annan upptäckt • Specialfall i data eller användning • Användningsområden • Tidsberoenden • Tekniska beroenden • osv

• Påtala glömda aktiviteter • Hitta var någon råkat gjort fel

verkliga

Page 6: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

[au-tu-ma-ti´sé-ra∂]

Page 7: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Current trends beneficial for test automation

• TDD/BDD

• Shorter iterations

• Focus on business value

• Focus on working code

• Refactoring

• Centraliced architektures – quick change cycle

• Dynamic teams

• Insights in maintenance costs

• A lot of reuse of old code in new ways

• More use of standard components

• Better automation tools

• Cheaper automation tools

• Parallell development and maintenance

• More mature testing insights in many organizations

Test automation

Page 8: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Current trends making test automation more cumbersome

Test automation

• Shorter life cycles for development technologies • More frequent changes to systems • The W model is flattened • Products under test getting more and more complex • Maaaaany devices

Page 9: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Testning

Testing Checking/

verification Validation

Page 10: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Test automation

Mini course in automated testing

Page 11: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Why automate the testing?

• Faster execution => quicker/more frequent feedback

• More exact checks – very repetetive

• Not being dependent on specific persons with specific competences, and getting rid of the lead times from that dependency

• Re-use of effort

• Quality metrics

• More combinations tested

• Freeing time for manual testing where the humans excel

Page 12: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Continuous quality control

Risk reduction

Time

Ris

k

Page 13: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Automated testing – When? Support programmers Critique product

Business facing

Technology facing

Automated

Automated

Manual

Automated/Manual

Functional AT

Unit tests Edge cases Fast ~80% of the tests

Showcasing Exploratory

Performance tests Security tests

Page 14: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Varje nivå har sina pros&cons Pros Cons

UT Robust Cope with change Quick Thorough

Doesn’t test that the system works Easily simplified

IT Quite quick Could get thorough Easy to implement negative testing Robust

More care to the environment Data management is an issue

ST Test the whole system Make sure the business value remains

Slow Many dependencies Hard to get good coverage

SIT Quick (In the best of worlds)

Slow (In the worst of worlds) Lots of dependencies Hard to get coverage Dependencies to things outside of team control

Page 15: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Automation type Business process coverage Code coverage Execution time

GUI 70% 5% Hours

API 25% 25% Minutes

Unit testing 5% 70% Seconds

Page 16: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Testtyper

Tester som säkrar utvecklingsteamets

heder inför beställaren (kod, DB-

struktur osv)

Tester som säkrar IT-organisationens heder

inför verksamheten (MW-konfiguration,

produktionsplanering osv)

• Sprinttester

• Enhetstester

• Scenariobaserade flödestester

• Smoke tests

Körs ofta Kodnära Whitebox.

Körs mindre ofta Förtroendeskapande Blackbox

Page 17: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Mycket kod Mycket

underhåll

Komplexa gränssnitt

Komplex interaktion

Mycket ledtid

Stor kostnad

Page 18: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Ett testautomatiseringsscript motsvarar den mest detaljerade testspec du någonsin tagit fram, och som alltid måste vara exakt

uppdaterad för att funka. Förmodligen dessutom av specialister

Ställer stora krav på testkodsarkitektur för att bli

förvaltningsbart

Page 19: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Checking and verification against an oracle

In order to have an oracle for at test case you’ll need: – Correct sequence of events, on the right object

– Appropriate environment (i.e. parameter configuration, integrations)

– Right versions of components

– Correct input data

– Right order of test executed

– Assumed meta-data in the system

– Assumed background data in the system

– Correct user rights for the user account

– …and so forth

Page 20: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short
Page 21: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short
Page 22: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short
Page 23: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Verktygstyper - systemtest

Verktygsvalet beror på val av approach och gränssnitt

• WS/API/MQ och andra systemgränssnitt

• ICC-verktyg

• Protokollnivå (headless browser)

• GUI-verktyg

– Bildigenkänning

– Objekthanterande

Page 24: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Vilka tester lämpar sig för automation?

Test automation

• Tråkiga tester • Datadrivna tester • Smoke tests (vertikal integration) • Vital, men perifer, funktionalitet

(affärsregler) • Tidödande tester • Testförberedelser

Page 25: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Utmaningar med automatisering • Lätt att råka tappa kontrollen över vad testfallen gör

• Det ÄR en mjukvarulösning med intima beroenden till en annan mjukvarulösning

• Kräver disciplin

• Kommunikationsglapp blir tydliga vid en automatisering

• Ta hand om någon annans bebis

• Scripten är i förvaltning från första körningen.

• Blir lätt nerprioriterat när det hettar till, och tappar då snabbt värde

• Ingen serendipitet

Page 26: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Fördelar med automatisering

Fördelar med automatisering: • Ökad förvaltningbarhet av systemet • Snabbare incidenthantering • Testtid över till mer högvärda tester • Fler kombinationer testade, mer regelbundet • Snabbare återkoppling • Noggranna kontroller • Slippa personberoende och ledtider • Testa oftare

Page 27: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Skill set för testautomatiserare

• Kommunikation

• Struktur

• Kreativitet

Page 28: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Är det verkligen testexekveringen

som man ägnar mest tid till?

Page 29: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Effektiv testning

• Koll på förutsättningarna för test

• Koll på utvecklarmaskiner, kodgrenar och byggen

• Automatisera det som gör mest nytta

– Informations-spårbarhet

– Kommunikation

– Testdatahantering

– Testfallsframställning (Pairwise testing)

– Testmiljöhantering

– Testexekvering

Page 30: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

More things to automate

• Automation of combinatory testing: Pairwice

• Automation of test data management (subsetting, anonymization of data, syncing data between systems, configuration management)

• Automation of release management/deployment

Page 31: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Detta är verktygs-bilden (gratisverktyg)

• Pairwice: ACTS, Pict, Allpairs

• GUI-baserade systemtester: Sikuli

• Objekt-baserade systemtester: AutoIT, Selenium, Sahi, Watir/Watin

• BDD: Specflow/Cucumber

• API-baserade systemtester: SoapUI

• Webb-utilities: Link-crawlers (Xenu), W3C-checkers, Firebug, Yslow, Chrome Dev.tools.

• Miljöhantering: PowerShell, AutoIT

Page 32: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Några olika testautomationskoncept

• Model based testing (MBT)

• Specification by example (SBE/BDD)

• Testapor

• Scenariobaserad end-2-end testing

• Automatiserade ”regressionstester”

• Datadriven testning

• Keyword driven test automation

Page 33: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Alternativ till automation

Test automation

Hårt arbete

Optimera utvecklingsprocessen

”Test on tap”

Acceptans av risk och teknisk skuld

Acceptans av ledtider

Redigt tillförlitliga rollback-rutiner

Page 34: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Frågor, sharing, synpunkter och kommentarer

Page 35: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short
Page 36: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Deploy process TDD

ATDD

BDD

UT

ST SIT

CI/CD

Introduction

Test data management

Environments Choosing the right tool

Challenges

Alternatives

Success factors

Pitfalls

Specification-by-example

MBT

Appropriateness and ROI

PageObject Model

Pairwice testing

History

Tips and trix

Etc

Page 37: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Googleable stuff

Page Object Model/Data Factories

Keyword driven testing

Stuff to try out

Opensourcetesting.org

HP/IBM/MicroFocus/MS web sites

JAutomate, Project White, Specflow

Attend a course

Further reading?

Page 38: Tio myter om testautomation - Software testingsast.se/q-moten/2014/orebro/q2/Damberg_Testautomation.pdf · 2014-06-23 · 10 CLS 20 Print Testing, boring routine work? 30 REM Short

Tack!

[email protected] @kejsardamberg