SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
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
...                   ...

Contenu connexe

Tendances

Continuous Integration at T3CON08
Continuous Integration at T3CON08Continuous Integration at T3CON08
Continuous Integration at T3CON08Sebastian 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 Integrationdrluckyspin
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deploymentMartijn 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 itFarooq 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 AppsRainforest 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 ChengExcella
 
Simple Continous Integration
Simple Continous IntegrationSimple Continous Integration
Simple Continous IntegrationRicky 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 TeamRainforest QA
 
Test Strategies in Microservices
Test Strategies in MicroservicesTest Strategies in Microservices
Test Strategies in MicroservicesMesut Ö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 PerspectiveMalinda Kapuruge
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDavide Benvegnù
 
Continuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestContinuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestShawn Jones
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationVijaya 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 GitAlexander Vanwynsberghe
 
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 DevelopmentShawn Jones
 

Tendances (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
 

En vedette

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 TestingLars Thorup
 
Advanced Javascript Unit Testing
Advanced Javascript Unit TestingAdvanced Javascript Unit Testing
Advanced Javascript Unit TestingLars Thorup
 
Super fast end-to-end-tests
Super fast end-to-end-testsSuper fast end-to-end-tests
Super fast end-to-end-testsLars Thorup
 
SQL or NoSQL - how to choose
SQL or NoSQL - how to chooseSQL or NoSQL - how to choose
SQL or NoSQL - how to chooseLars Thorup
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy codeLars Thorup
 

En vedette (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
 

Similaire à Introduction to-automated-testing

Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseClareMcLennan
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and AutomationMahesh 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 AyersSPC Adriatics
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping QualityMichael 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 youAmbientia
 
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
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed 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 ProjectGlobalLogic 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 JavaScriptRob Scaduto
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentnikhil 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 AutomationSauce 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-5hemasubbu08
 
Software Testing Basic Concepts
Software Testing Basic ConceptsSoftware Testing Basic Concepts
Software Testing Basic Conceptswesovi
 
Agile, DevOps & Test
Agile, DevOps & TestAgile, DevOps & Test
Agile, DevOps & TestQualitest
 

Similaire à 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
 

Plus de BestBrains

Psykologien i agile teams
Psykologien i agile teamsPsykologien i agile teams
Psykologien i agile teamsBestBrains
 
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 2BestBrains
 
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-09BestBrains
 
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 ThaningBestBrains
 
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 2016BestBrains
 
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 antipatternsBestBrains
 
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 teamsBestBrains
 
Tddbdd workshop
Tddbdd workshopTddbdd workshop
Tddbdd workshopBestBrains
 
Craftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møderCraftsmanship 2016 -BestBrains Café-møder
Craftsmanship 2016 -BestBrains Café-møderBestBrains
 
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 handoutBestBrains
 
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 2015BestBrains
 
Den agile transformation november 2015
Den agile transformation november 2015Den agile transformation november 2015
Den agile transformation november 2015BestBrains
 
Sandheden om agile udviklingsteams
Sandheden om agile udviklingsteamsSandheden om agile udviklingsteams
Sandheden om agile udviklingsteamsBestBrains
 
Intro til agile 31 aug 2015
Intro til agile 31 aug 2015Intro til agile 31 aug 2015
Intro til agile 31 aug 2015BestBrains
 
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 2015BestBrains
 
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 2015BestBrains
 
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_omstillingBestBrains
 

Plus de 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
 

Dernier

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Dernier (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

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