SlideShare a Scribd company logo
1 of 28
Hur får du ut mest effekt av dina
automatiserade tester?
Ekvilibrium
Kvalite
Kostnad
Behov Insats
Ekvilibrium
Ekvilibrium
Ekvilibrium betyder "jämvikt" eller "balans"
Vilken grad av automatiserade tester
Låg kvalite = Dyrt
Hög kvalite = Dyrt
Varför automatisera testerna?
• Testar snabbare (spara tid)
• Testar mer (bättre kvalitet)
• Testar oftare(bättre kvalitet)
• Testar med mindre resurser (spara
pengar)
Automatiserade Regressionstester
• Kvalitetskontroll (quality gate)
• Trygghet för utveckling!
• Tryggar en ”grundkvalité”
• Trygghet för vidareutveckling, buggfixar,
m.m.
• Trygghet för ”förvaltning”
Hur ska man automatisera?
Automationsnivå Kodtäckning
70%
40%
5% 70%
40%
5% Timmar
Minuter
SekunderEnhetstest
API
GUI
Affärprocesstäckning Exekveringstid
Enhetstest - JUnit
@Test
public void testConcatenate() {
MyUnit myUnit = new MyUnit();
String result = myUnit.concatenate("one", "two");
assertEquals("onetwo", result);
}
API-test - Restassured
given().
params("Country", "Sweden", "City", "Stockholm").
when().
post("/temperature").
then().
body(hasXPath("/temperature/City[text()='20']"));
GUItest - Selenium
driver = new FirefoxDriver();
wait = new WebDriverWait(driver, 30);
driver.get("http://www.google.com/");
@Test
public void firstPageContainsProlore() {
driver.findElement(By.name("q")).sendKeys("Proloren");
driver.findElement(By.name("btnG")).click();
wait.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver webDriver) {
return webDriver.findElement(By.id("resultStats")) != null;
}
});
assertTrue(driver.findElement(By.tagName("body")).getText().contains("prolore.se"));
}
Användargränssnitt (förr)
Användargränssnitt (idag)
Orealistiska förväntningar
“Vi behöver ingen manuell testing nu när vi har
skapat massa automatiserade tester”
“Vi ska automatisera allt”
Vad ska man automatisera?
De som ger mest tillbaka i relation till
nedlagd tid.
Vad ska man automatisera?
Värdera GUI driven testautomatisering med
avseende på:
Förändringsbenägenhet (-)
Förmodat antal körningar (+)
Antal indatavarianter (+)
Återutnyttjandegrad (+)
Riskeliminering (+)
Hur lång tid det tar att köra manuellt (+-)
Vad ska man automatisera?
Värdera API driven testautomatisering med
avseende på:
Trivial funktion (-)
Utvecklas just nu (+)
Antal indatavarianter (+)
Förmodat antal körningar (+)
Vad ska man inte automatisera?
GUI API
Tester som kräver intelligens och känsla X X
Applikationer som ännu inte är stabila (för tidigt i livscykeln) X
Applikationer som verktyget har svårt att stödja X
Testfall som inte har gått bra manuellt X
Projekt som inte kan leverera den information och stöd som
behövs till testautomatiseraren
X
Orakel – Hur vet vi vad som är rätt?
Orakel
• Krav, Specifikationer, Andra produkter
• Heuristiskt-orakel, ger ett ungefärligt eller
exakt resultat.
• Statistiskt-orakel, bedömer resultatet
utifrån statistiska beräkningar.
• Konsistens-orakel, jämför resultatet för
flera identiska körningar.
Heuristiskt-orakel
Tracer Bullet
API-test - Tidigt
given().
params("Country", "Sweden", "City", "Stockholm").
when().
post("/temperature").
then().
body(hasXPath("/temperature/City[text()='20']"));
API-test - Senare
given().
params("Country", "Sweden", "City", "Stockholm").
when().
post("/temperature").
then().
body(hasXPath("/temperature/City[text()=YahooWeatherTemp]"));
Delat ansvar
Implementation
Unit
System
Integration
Acceptans
Utveckling
Test
Framgångsfaktorer
• Implementeras parallellt med utveckling
• Teamet är med hela tiden
• Definieras i förväg
• Körs hela tiden
• Är en ”leverabel”
Defektdetektering
Testmetod Låga
resultat
Medel
resultat
Höga
resultat
Formell kodreview 30% 60% 70%
Statisk och dynamisk analys 20% 40% 60%
Enhetstestning 10% 25% 50%
API testning 20% 35% 55%
Scenario tester (Komplett system) 25% 45% 60%
Scenario tester (“Live data”) 35% 50% 65%
Sammanlagd effekt
Källa: Code Complete, McConnell
99%99%93%
Frågor
Viktor Laszlo
viktor.laszlo@prolore.se
Tack!

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Hur får du ut max av automatiserade tester?

Editor's Notes

  1. Nyckeln handlar om att tiden från ide till driftsättning kommer vara extremt kort.