SlideShare a Scribd company logo
Introduction to Automated Testing

    by Lars Thorup, ZeaLake
         May 26th 2011
Who is Lars Thorup?




• Software developer

• Coach: Teaching TDD and
  automated testing

• Advisor: Assesses software
  projects and companies

• Founder and CEO of
  BestBrains and ZeaLake
Why are we here today?

• How do we do automated testing?
   – Write test programs
   – Run the tests automatically

• Why should we write tests?
   –   Enjoy more efficient and predictable course of development
   –   Find and fix bugs fast
   –   Prevent bugs from reappearing
   –   Improve the design of our software
Different kinds of automated tests

• Unit tests
   – Tests individual pieces of code and the interaction between code blocks

• System tests
   – Tests the entire system against the requirements

• Performance tests
   – Tests non functional requirements
Unit tests or system tests?

• Unit tests are efficient
   –   Fast to run (a few seconds)
   –   Robust and predictable
   –   Easy to write
   –   Is written together with the code it is testing

• System tests are thorough
   – Tests all layers together
   – Most efficient way to create a set of tests for existing code
Can we automate performance tests?

• Performance tests are brittle
   – Tip: create performance trend curves instead
So, how do we actually do this?

• IsNumeric
  – C#
  – Ruby

• TransferFunds
  – C++
How do we run the tests automatically?

• From our programming environment (IDE)
   – Command line: make test
   – Right click | Run Tests

• On every commit
   – Setup a build server
       • Hudson / Jenkins
       • TeamCity
   – Let the build server run all tests
   – Get build notifications
   – Keep the build green
       • Fixing a broken build has priority over any other development task
How can tests help improve our design?

• The software design needs to evolve over time
• A refactoring modifies the design without changing behavior
• Tests ensure that behavior is not accidentally changed

• Without tests, refactoring is scary
   – and with no refactoring, the design decays over time

• With tests, we have the courage to refactor
   – so we continually keep our design healthy
What is good design?

• One element of good design is loose dependencies
   – Use interfaces (for static languages)
   – Inject dependencies

• Avoid this



• Do this instead
Are we wasting valuable developer time writing tests?

• No
• The time spent writing tests is not taken from the time spent
  coding
   – It is taken from the time otherwise spent on manual testing and debugging
• The cost of a bug keeps increasing until we fix it

• Find bugs fast
   – Avoid losing customer confidence
   – Free QA to do exploratory testing
     so they find the hard-to-find bugs
   – Spend less time trying to figure out
     what is causing the bug and how to fix it

• Avoid spending time testing again
How do we get started?

• When we have a lot of existing code without tests
   – Create a set of system tests to get a safety net

• When we are writing new code
   – Write unit tests in conjunction with the new code

• Set up a standard test environment for our specific application
   – Test data
       • Automate the creation of standard testdata in a local database
   – External dependencies
       • Write stubs to use in the tests
What does a real-world project look like?

• wizerize.com
    – Web application: C# and JavaScript
    – 3 years of production
    – 2-4 developers
•   40% test code, 60% production code (in lines of code)
•   71% code coverage of unit tests
•   614 unit tests – run in 1 minute
•   54 system tests – run in 20 minutes
•   No functional errors seen by end users in production (yet)
Where can I read more?

• http://googletesting.blogspot.com/
• http://testdrivendeveloper.com/
• http://codesheriff.blogspot.com/
Which tools do we use?

Environment           Tool
C#                    NUnit
JavaScript            qUnit
HTML-based UI         WatiN, Selenium
C++                   CppUnit, googletest
Python                unittest
Ruby                  Test::Unit
C                     check, cunit
Java                  JUnit
...                   ...

More Related Content

What's hot

Continuous Integration at T3CON08
Continuous Integration at T3CON08Continuous Integration at T3CON08
Continuous Integration at T3CON08
Sebastian Kurfürst
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testingDuy Tan Geek
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
drluckyspin
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deployment
Martijn van der Kamp
 
Why your company loves to welcome change but sucks at accommodating it
Why your company loves to welcome change but sucks at accommodating itWhy your company loves to welcome change but sucks at accommodating it
Why your company loves to welcome change but sucks at accommodating it
Farooq Ali
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web Apps
Rainforest QA
 
Agile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard ChengAgile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard Cheng
Excella
 
NYC MeetUp 10.9
NYC MeetUp 10.9NYC MeetUp 10.9
NYC MeetUp 10.9
Solano Labs
 
Simple Continous Integration
Simple Continous IntegrationSimple Continous Integration
Simple Continous Integration
Ricky Martaputra
 
Using Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamUsing Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development Team
Rainforest QA
 
Test Strategies in Microservices
Test Strategies in MicroservicesTest Strategies in Microservices
Test Strategies in Microservices
Mesut Özen
 
Test Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveTest Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s Perspective
Malinda Kapuruge
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps world
Davide Benvegnù
 
Continuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestContinuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonest
Shawn Jones
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
Vijaya K
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and Git
Alexander Vanwynsberghe
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
Wyn B. Van Devanter
 
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
Trójmiejska Grupa Testerska
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
Shawn Jones
 

What's hot (20)

Continuous Integration at T3CON08
Continuous Integration at T3CON08Continuous Integration at T3CON08
Continuous Integration at T3CON08
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testing
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Agile test practices
Agile test practicesAgile test practices
Agile test practices
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deployment
 
Why your company loves to welcome change but sucks at accommodating it
Why your company loves to welcome change but sucks at accommodating itWhy your company loves to welcome change but sucks at accommodating it
Why your company loves to welcome change but sucks at accommodating it
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web Apps
 
Agile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard ChengAgile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard Cheng
 
NYC MeetUp 10.9
NYC MeetUp 10.9NYC MeetUp 10.9
NYC MeetUp 10.9
 
Simple Continous Integration
Simple Continous IntegrationSimple Continous Integration
Simple Continous Integration
 
Using Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamUsing Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development Team
 
Test Strategies in Microservices
Test Strategies in MicroservicesTest Strategies in Microservices
Test Strategies in Microservices
 
Test Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveTest Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s Perspective
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps world
 
Continuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestContinuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonest
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and Git
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 

Viewers also liked

Advanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit TestingAdvanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit Testing
Lars Thorup
 
Advanced Javascript Unit Testing
Advanced Javascript Unit TestingAdvanced Javascript Unit Testing
Advanced Javascript Unit Testing
Lars Thorup
 
Super fast end-to-end-tests
Super fast end-to-end-testsSuper fast end-to-end-tests
Super fast end-to-end-tests
Lars Thorup
 
SQL or NoSQL - how to choose
SQL or NoSQL - how to chooseSQL or NoSQL - how to choose
SQL or NoSQL - how to choose
Lars Thorup
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
Lars Thorup
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
TestObject - Mobile Testing
 

Viewers also liked (6)

Advanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit TestingAdvanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit Testing
 
Advanced Javascript Unit Testing
Advanced Javascript Unit TestingAdvanced Javascript Unit Testing
Advanced Javascript Unit Testing
 
Super fast end-to-end-tests
Super fast end-to-end-testsSuper fast end-to-end-tests
Super fast end-to-end-tests
 
SQL or NoSQL - how to choose
SQL or NoSQL - how to chooseSQL or NoSQL - how to choose
SQL or NoSQL - how to choose
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
 

Similar to Introduction to-automated-testing

Topic production code
Topic production codeTopic production code
Topic production code
Kavi Kumar
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
ClareMcLennan
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
Mahesh Salaria
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
Michael Roufa
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Jacinto Limjap
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for you
Ambientia
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)
Peter Kofler
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
Mihai-Cristian Fratila
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
Mohammed Moishin
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java Project
GlobalLogic Ukraine
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
Rob Scaduto
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
nikhil sreeni
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
Sauce Labs
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
hemasubbu08
 
Software Testing Basic Concepts
Software Testing Basic ConceptsSoftware Testing Basic Concepts
Software Testing Basic Concepts
wesovi
 
Agile, DevOps & Test
Agile, DevOps & TestAgile, DevOps & Test
Agile, DevOps & Test
Qualitest
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
Stanislav Tiurikov
 
Software testing
Software testingSoftware testing
Software testing
KarnatiChandramoules
 

Similar to Introduction to-automated-testing (20)

Topic production code
Topic production codeTopic production code
Topic production code
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for you
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java Project
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
Software Testing Basic Concepts
Software Testing Basic ConceptsSoftware Testing Basic Concepts
Software Testing Basic Concepts
 
Agile, DevOps & Test
Agile, DevOps & TestAgile, DevOps & Test
Agile, DevOps & Test
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Software testing
Software testingSoftware testing
Software testing
 

More from BestBrains

Psykologien i agile teams
Psykologien i agile teamsPsykologien i agile teams
Psykologien i agile teams
BestBrains
 
Bliv en haj til nedbrydning okt 2016
Bliv en haj til nedbrydning okt 2016 Bliv en haj til nedbrydning okt 2016
Bliv en haj til nedbrydning okt 2016
BestBrains
 
Vsm best brains presentation_ september 2016_v4 2
Vsm best brains presentation_ september 2016_v4 2Vsm best brains presentation_ september 2016_v4 2
Vsm best brains presentation_ september 2016_v4 2
BestBrains
 
Lars thorup-react-and-redux-2016-09
Lars thorup-react-and-redux-2016-09Lars thorup-react-and-redux-2016-09
Lars thorup-react-and-redux-2016-09
BestBrains
 
BestBrains café-møde: Kanban med Lego ved Jesper Thaning
BestBrains café-møde: Kanban med Lego ved Jesper ThaningBestBrains café-møde: Kanban med Lego ved Jesper Thaning
BestBrains café-møde: Kanban med Lego ved Jesper Thaning
BestBrains
 
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
BestBrains
 
BestBrains café-møde d. 14. april: Retrospektiv antipatterns
BestBrains café-møde d. 14. april: Retrospektiv antipatternsBestBrains café-møde d. 14. april: Retrospektiv antipatterns
BestBrains café-møde d. 14. april: Retrospektiv antipatterns
BestBrains
 
Gør urværket synligt for dine teams
Gør urværket synligt for dine teamsGør urværket synligt for dine teams
Gør urværket synligt for dine teams
BestBrains
 
Tddbdd workshop
Tddbdd workshopTddbdd workshop
Tddbdd workshop
BestBrains
 
Craftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møderCraftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møder
BestBrains
 
Best brains kanban med lego januar 2016 handout
Best brains kanban med lego januar 2016 handoutBest brains kanban med lego januar 2016 handout
Best brains kanban med lego januar 2016 handout
BestBrains
 
Bliv en ørn til estimering nov 2015
Bliv en ørn til estimering nov 2015Bliv en ørn til estimering nov 2015
Bliv en ørn til estimering nov 2015
BestBrains
 
Den agile transformation november 2015
Den agile transformation november 2015Den agile transformation november 2015
Den agile transformation november 2015
BestBrains
 
Sandheden om agile udviklingsteams
Sandheden om agile udviklingsteamsSandheden om agile udviklingsteams
Sandheden om agile udviklingsteams
BestBrains
 
Intro til agile 31 aug 2015
Intro til agile 31 aug 2015Intro til agile 31 aug 2015
Intro til agile 31 aug 2015
BestBrains
 
Lær 3 agile metoder på en aften, august 2015
Lær 3 agile metoder på en aften, august 2015Lær 3 agile metoder på en aften, august 2015
Lær 3 agile metoder på en aften, august 2015
BestBrains
 
Bliv en haj til nedbrydning, aug 2015.
Bliv en haj til nedbrydning, aug 2015.Bliv en haj til nedbrydning, aug 2015.
Bliv en haj til nedbrydning, aug 2015.
BestBrains
 
Haj til nedbrydning juni 2015
Haj til nedbrydning juni 2015Haj til nedbrydning juni 2015
Haj til nedbrydning juni 2015
BestBrains
 
Motivation - fedt, farligt & flygtigt.
Motivation - fedt, farligt & flygtigt.Motivation - fedt, farligt & flygtigt.
Motivation - fedt, farligt & flygtigt.
BestBrains
 
Switch -den_agile_omstilling
Switch  -den_agile_omstillingSwitch  -den_agile_omstilling
Switch -den_agile_omstilling
BestBrains
 

More from BestBrains (20)

Psykologien i agile teams
Psykologien i agile teamsPsykologien i agile teams
Psykologien i agile teams
 
Bliv en haj til nedbrydning okt 2016
Bliv en haj til nedbrydning okt 2016 Bliv en haj til nedbrydning okt 2016
Bliv en haj til nedbrydning okt 2016
 
Vsm best brains presentation_ september 2016_v4 2
Vsm best brains presentation_ september 2016_v4 2Vsm best brains presentation_ september 2016_v4 2
Vsm best brains presentation_ september 2016_v4 2
 
Lars thorup-react-and-redux-2016-09
Lars thorup-react-and-redux-2016-09Lars thorup-react-and-redux-2016-09
Lars thorup-react-and-redux-2016-09
 
BestBrains café-møde: Kanban med Lego ved Jesper Thaning
BestBrains café-møde: Kanban med Lego ved Jesper ThaningBestBrains café-møde: Kanban med Lego ved Jesper Thaning
BestBrains café-møde: Kanban med Lego ved Jesper Thaning
 
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
Projektleder i agilt setup, cafemøde hos BestBrains, april 2016
 
BestBrains café-møde d. 14. april: Retrospektiv antipatterns
BestBrains café-møde d. 14. april: Retrospektiv antipatternsBestBrains café-møde d. 14. april: Retrospektiv antipatterns
BestBrains café-møde d. 14. april: Retrospektiv antipatterns
 
Gør urværket synligt for dine teams
Gør urværket synligt for dine teamsGør urværket synligt for dine teams
Gør urværket synligt for dine teams
 
Tddbdd workshop
Tddbdd workshopTddbdd workshop
Tddbdd workshop
 
Craftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møderCraftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møder
 
Best brains kanban med lego januar 2016 handout
Best brains kanban med lego januar 2016 handoutBest brains kanban med lego januar 2016 handout
Best brains kanban med lego januar 2016 handout
 
Bliv en ørn til estimering nov 2015
Bliv en ørn til estimering nov 2015Bliv en ørn til estimering nov 2015
Bliv en ørn til estimering nov 2015
 
Den agile transformation november 2015
Den agile transformation november 2015Den agile transformation november 2015
Den agile transformation november 2015
 
Sandheden om agile udviklingsteams
Sandheden om agile udviklingsteamsSandheden om agile udviklingsteams
Sandheden om agile udviklingsteams
 
Intro til agile 31 aug 2015
Intro til agile 31 aug 2015Intro til agile 31 aug 2015
Intro til agile 31 aug 2015
 
Lær 3 agile metoder på en aften, august 2015
Lær 3 agile metoder på en aften, august 2015Lær 3 agile metoder på en aften, august 2015
Lær 3 agile metoder på en aften, august 2015
 
Bliv en haj til nedbrydning, aug 2015.
Bliv en haj til nedbrydning, aug 2015.Bliv en haj til nedbrydning, aug 2015.
Bliv en haj til nedbrydning, aug 2015.
 
Haj til nedbrydning juni 2015
Haj til nedbrydning juni 2015Haj til nedbrydning juni 2015
Haj til nedbrydning juni 2015
 
Motivation - fedt, farligt & flygtigt.
Motivation - fedt, farligt & flygtigt.Motivation - fedt, farligt & flygtigt.
Motivation - fedt, farligt & flygtigt.
 
Switch -den_agile_omstilling
Switch  -den_agile_omstillingSwitch  -den_agile_omstilling
Switch -den_agile_omstilling
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Introduction to-automated-testing

  • 1. Introduction to Automated Testing by Lars Thorup, ZeaLake May 26th 2011
  • 2. Who is Lars Thorup? • Software developer • Coach: Teaching TDD and automated testing • Advisor: Assesses software projects and companies • Founder and CEO of BestBrains and ZeaLake
  • 3. Why are we here today? • How do we do automated testing? – Write test programs – Run the tests automatically • Why should we write tests? – Enjoy more efficient and predictable course of development – Find and fix bugs fast – Prevent bugs from reappearing – Improve the design of our software
  • 4. Different kinds of automated tests • Unit tests – Tests individual pieces of code and the interaction between code blocks • System tests – Tests the entire system against the requirements • Performance tests – Tests non functional requirements
  • 5. Unit tests or system tests? • Unit tests are efficient – Fast to run (a few seconds) – Robust and predictable – Easy to write – Is written together with the code it is testing • System tests are thorough – Tests all layers together – Most efficient way to create a set of tests for existing code
  • 6. Can we automate performance tests? • Performance tests are brittle – Tip: create performance trend curves instead
  • 7. So, how do we actually do this? • IsNumeric – C# – Ruby • TransferFunds – C++
  • 8. How do we run the tests automatically? • From our programming environment (IDE) – Command line: make test – Right click | Run Tests • On every commit – Setup a build server • Hudson / Jenkins • TeamCity – Let the build server run all tests – Get build notifications – Keep the build green • Fixing a broken build has priority over any other development task
  • 9. How can tests help improve our design? • The software design needs to evolve over time • A refactoring modifies the design without changing behavior • Tests ensure that behavior is not accidentally changed • Without tests, refactoring is scary – and with no refactoring, the design decays over time • With tests, we have the courage to refactor – so we continually keep our design healthy
  • 10. What is good design? • One element of good design is loose dependencies – Use interfaces (for static languages) – Inject dependencies • Avoid this • Do this instead
  • 11. Are we wasting valuable developer time writing tests? • No • The time spent writing tests is not taken from the time spent coding – It is taken from the time otherwise spent on manual testing and debugging • The cost of a bug keeps increasing until we fix it • Find bugs fast – Avoid losing customer confidence – Free QA to do exploratory testing so they find the hard-to-find bugs – Spend less time trying to figure out what is causing the bug and how to fix it • Avoid spending time testing again
  • 12. How do we get started? • When we have a lot of existing code without tests – Create a set of system tests to get a safety net • When we are writing new code – Write unit tests in conjunction with the new code • Set up a standard test environment for our specific application – Test data • Automate the creation of standard testdata in a local database – External dependencies • Write stubs to use in the tests
  • 13. What does a real-world project look like? • wizerize.com – Web application: C# and JavaScript – 3 years of production – 2-4 developers • 40% test code, 60% production code (in lines of code) • 71% code coverage of unit tests • 614 unit tests – run in 1 minute • 54 system tests – run in 20 minutes • No functional errors seen by end users in production (yet)
  • 14. Where can I read more? • http://googletesting.blogspot.com/ • http://testdrivendeveloper.com/ • http://codesheriff.blogspot.com/
  • 15. Which tools do we use? Environment Tool C# NUnit JavaScript qUnit HTML-based UI WatiN, Selenium C++ CppUnit, googletest Python unittest Ruby Test::Unit C check, cunit Java JUnit ... ...