SlideShare una empresa de Scribd logo
1 de 15
Developer Testing
- Love it or hate it?

SAST Stockholm Q4
Alexander Tarnowski
Om den annoterade versionen
Denna version av presentationen skiljer sig från
originalet genom att en del kommentarer lagts
till i efterhand för att göra den mer läsvänlig. De
ser ut som följande:
Kommentar

Alexander Tarnowski

2
Jag förväntar
mig bra
kvalitet och att
det är klart
Lite är skrivet om testning
i samband med utveckling

Olika
förväntningar

Sluta testa på dålig
kod
Testning är plåster på såret

Utveckling

Test

Det finns en klyfta mellan
det som utvecklas och det
som testas

Alexander Tarnowski

Bristfällig testning av
utvecklaren leder till att
testningen måste
fokusera på checking
Temperature:

-A%¤?.

Litet värde:
grundläggande checking

Mera värde: använder vi
rätt komponent?

Än mer värde: är
mjukvaran
användarvänlig?

Mest värde: borde vi göra
detta över huvud taget?

Alexander Tarnowski

4
1. Lära utvecklaren om testning:
– För att testa bättre
– Veta hur saker kommer att testas

2. Lära ut programmeringsprinciper
som leder till ökad testbarhet

Alexander Tarnowski
Teori & Terminologi
•
•
•
•

Grundläggande begrepp
Testnivåer och testtyper
Ord som slutar med ”test”
Agil testning

Alexander Tarnowski
Brian Maricks testkvadranter visar mycket. Mest
intressant idag är testningens tvåfaldiga syfte:
verifiera och skapa trygghet.

Alexander Tarnowski

7
Testbarhet
Utvecklarens perspektiv
på testbarhet ör lite
annorlunda.

KÖRBARHET!
Observerbarhet

Isolerbarhet
Testbarhet

Kontrollerbarhet
Driftsättbarhet
Ortogonalitet(?)

Alexander Tarnowski
Kontrakt

Om man vid utveckling tänker på vilket kontrakt
en given komponent/klass/funktion uppfyller
blir koden mer testbar. Detta gör att utvecklaren
kan backa lite och betrakta sin egen kod som en
svart låda, som uppfyller vissa villkor.

Alexander Tarnowski
Indata och beteende

Indirekt input
Temporal
koppling
Sidoeffekter

Domänstorlek
Alexander Tarnowski

x ∈ {1…10}
Enhetstestning
Hur många
assertions
per test?

Fake?
Stub?

Vad är ett
enhetstest
???

Constraint-based
assertions/
Matchers?

Parametriserade
tester

Duplicering
Alexander Tarnowski

Namngivning
Arv?
Mock?

Arrange, Act, Assert
Testdriven utveckling

Designteknik

Top-down

Tillstånd

Beteende

Bottom-up

Alexander Tarnowski
Vad utvecklartestning inte är
Verifiering av att teamet gör rätt sak
Testsessioner utförda av utvecklare
Användbarhets-, last- eller säkerhetstestning

Alexander Tarnowski
Sammanfattningsvis

Kunskap om test och testbarhet

Koll på hantverket och verktygen

Genom att stärka utvecklaren inom testtekniker och testteori, samt stärka inom
programmering som leder till ökad testbarhet, hoppas jag att kvaliteten på det som
utvecklas höjs och att testningen börjar bortom checking.

Alexander Tarnowski
alexander.tarnowski@crisp.se
alexander_tar
Blog blog.crisp.se/author/alexandertarnowski
www www.techbookreader.com

Alexander Tarnowski

Feedback på såväl
detaljer som
grundantaganden
uppskattas
enormt!

Más contenido relacionado

Más de Alexander Tarlinder

Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with SpockAlexander Tarlinder
 
Dealing with combinatorial explosions and boring tests
Dealing with combinatorial explosions and boring testsDealing with combinatorial explosions and boring tests
Dealing with combinatorial explosions and boring testsAlexander Tarlinder
 
Agile Testing – Is it for me and how are others doing it?
Agile Testing – Is it for me and how are others doing it?Agile Testing – Is it for me and how are others doing it?
Agile Testing – Is it for me and how are others doing it?Alexander Tarlinder
 
Testability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testableTestability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testableAlexander Tarlinder
 
Being good at waiting - Using Selenium to test Ajax-intensive pages
Being good at waiting - Using Selenium to test Ajax-intensive pages Being good at waiting - Using Selenium to test Ajax-intensive pages
Being good at waiting - Using Selenium to test Ajax-intensive pages Alexander Tarlinder
 

Más de Alexander Tarlinder (6)

Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with Spock
 
Dealing with combinatorial explosions and boring tests
Dealing with combinatorial explosions and boring testsDealing with combinatorial explosions and boring tests
Dealing with combinatorial explosions and boring tests
 
Testability for Developers
Testability for DevelopersTestability for Developers
Testability for Developers
 
Agile Testing – Is it for me and how are others doing it?
Agile Testing – Is it for me and how are others doing it?Agile Testing – Is it for me and how are others doing it?
Agile Testing – Is it for me and how are others doing it?
 
Testability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testableTestability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testable
 
Being good at waiting - Using Selenium to test Ajax-intensive pages
Being good at waiting - Using Selenium to test Ajax-intensive pages Being good at waiting - Using Selenium to test Ajax-intensive pages
Being good at waiting - Using Selenium to test Ajax-intensive pages
 

Developer testing - Love it or hate it (in Swedish)