SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Unit Testing Basics


                 Serhiy Oplakanets @ Mavenresearch, November 2010
                  Slides are not intended to make sense outside of the talk.

Thursday, November 18, 2010
A Discipline
                   •          Unit Testing is a discipline of Quality Assurance

                   •          Others Include:

                         •      Functional Testing

                         •      Integration Testing

                         •      Code Review

                         •      Continuous Integration

                         •      ...


Thursday, November 18, 2010
Unit Testing is


                   • validating that individual units of
                              application work properly




Thursday, November 18, 2010
Benefits
                   •          Finding bugs early

                   •          Less debugging

                   •          Changes to application are safer and easier

                   •          Examples of code usage

                   •          Documentation (to some extent)

                   •          Unit test is a tool to validate code design; in most
                              cases code that is hard to test is badly designed


Thursday, November 18, 2010
Good Unit Test
                   •          Test only one unit at a time

                   •          Do not depend on ordering of test run

                   •          Runs fast

                   •          Tests only one feature at a time

                   •          Easy to understand

                   •          Tests the public API of unit

                   •          Covers all usage cases


Thursday, November 18, 2010
Test Suite

                   • Multiple tests form Test Suite
                   • Your most important tool to check impact
                              of changes
                   • Helps estimate changes


Thursday, November 18, 2010
Good Unit Test Suite

                   • Is simple to run
                   • Runs fast (preferable in seconds)
                   • Is always Green
                   • Is non-interactive

Thursday, November 18, 2010
Limitations of Unit Testing
                   •          Not every bug can be found by unit tests

                   •          As we're testing only one module -- integration
                              issues are not covered

                   •          Multi-threaded issues can't be caught by one-
                              threaded test

                   •          Hardware failures, 3rd party component issues,
                              etc. All those can be covered only with a proper
                              Functional Test Suite



Thursday, November 18, 2010
Practical Session



Thursday, November 18, 2010
Resources
                   • http://en.wikipedia.org/wiki/Unit_testing :)
                   • http://blog.stevensanderson.com/
                              2009/08/24/writing-great-unit-tests-best-
                              and-worst-practises/
                   • http://googletesting.blogspot.com/2008/11/
                              clean-code-talks-unit-testing.html
                   • http://geosoft.no/development/
Thursday, November 18, 2010
Thank you.



Thursday, November 18, 2010

Weitere ähnliche Inhalte

Andere mochten auch

Thermo Powder Presentation - Catalytic Learning Day 2014
Thermo Powder Presentation - Catalytic Learning Day 2014Thermo Powder Presentation - Catalytic Learning Day 2014
Thermo Powder Presentation - Catalytic Learning Day 2014douglasgreig
 
How Content Strategy can get you a date - Defuse Dublin 2012
How Content Strategy can get you a date - Defuse Dublin 2012How Content Strategy can get you a date - Defuse Dublin 2012
How Content Strategy can get you a date - Defuse Dublin 2012Cory-Ann Joseph
 
090315 Wyoming Hospital Association Think!
090315 Wyoming Hospital Association Think!090315 Wyoming Hospital Association Think!
090315 Wyoming Hospital Association Think!Tim Richardson
 
Journalism today1 - slideshare
Journalism today1  -  slideshareJournalism today1  -  slideshare
Journalism today1 - slideshareJill Falk
 
Yahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from InternetYahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from Internetdrgath
 
29mei aceh
29mei aceh29mei aceh
29mei acehepaper
 
Edisi 31 Okt Nas
Edisi 31 Okt NasEdisi 31 Okt Nas
Edisi 31 Okt Nasepaper
 
Learning Exploration Team Academy Network
Learning Exploration Team Academy NetworkLearning Exploration Team Academy Network
Learning Exploration Team Academy NetworkJavier Ruiz
 
Edisi 1 Feb 10 Aceh
Edisi 1 Feb 10 AcehEdisi 1 Feb 10 Aceh
Edisi 1 Feb 10 Acehepaper
 
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線Muneyuki Ohkawa
 
Earn big dreams_small_savings_2013
Earn big dreams_small_savings_2013Earn big dreams_small_savings_2013
Earn big dreams_small_savings_2013Ben Mangan
 
28des N As
28des N As28des N As
28des N Asepaper
 
24 M Ar Aceh
24 M Ar  Aceh24 M Ar  Aceh
24 M Ar Acehepaper
 
Connecting with Nature wk 1 - Human nature relationships
Connecting with Nature wk 1 - Human nature relationshipsConnecting with Nature wk 1 - Human nature relationships
Connecting with Nature wk 1 - Human nature relationshipsGeoff Adams
 
Lect 8 env sustainability in oe 2013
Lect 8 env sustainability in oe 2013Lect 8 env sustainability in oe 2013
Lect 8 env sustainability in oe 2013Geoff Adams
 
Edisi 31 Okt Nas
Edisi 31 Okt NasEdisi 31 Okt Nas
Edisi 31 Okt Nasepaper
 
Edisi17 Seo Aceh
Edisi17 Seo AcehEdisi17 Seo Aceh
Edisi17 Seo Acehepaper
 
Edisi Medan04
Edisi Medan04Edisi Medan04
Edisi Medan04epaper
 
Edisi 4 April Nusantara
Edisi 4 April NusantaraEdisi 4 April Nusantara
Edisi 4 April Nusantaraepaper
 
Saurabh, the all rounder
Saurabh, the all rounderSaurabh, the all rounder
Saurabh, the all roundercruzex
 

Andere mochten auch (20)

Thermo Powder Presentation - Catalytic Learning Day 2014
Thermo Powder Presentation - Catalytic Learning Day 2014Thermo Powder Presentation - Catalytic Learning Day 2014
Thermo Powder Presentation - Catalytic Learning Day 2014
 
How Content Strategy can get you a date - Defuse Dublin 2012
How Content Strategy can get you a date - Defuse Dublin 2012How Content Strategy can get you a date - Defuse Dublin 2012
How Content Strategy can get you a date - Defuse Dublin 2012
 
090315 Wyoming Hospital Association Think!
090315 Wyoming Hospital Association Think!090315 Wyoming Hospital Association Think!
090315 Wyoming Hospital Association Think!
 
Journalism today1 - slideshare
Journalism today1  -  slideshareJournalism today1  -  slideshare
Journalism today1 - slideshare
 
Yahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from InternetYahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from Internet
 
29mei aceh
29mei aceh29mei aceh
29mei aceh
 
Edisi 31 Okt Nas
Edisi 31 Okt NasEdisi 31 Okt Nas
Edisi 31 Okt Nas
 
Learning Exploration Team Academy Network
Learning Exploration Team Academy NetworkLearning Exploration Team Academy Network
Learning Exploration Team Academy Network
 
Edisi 1 Feb 10 Aceh
Edisi 1 Feb 10 AcehEdisi 1 Feb 10 Aceh
Edisi 1 Feb 10 Aceh
 
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線
IBM Notes 9.0 Social EditionとIBM Connections 4.5を貫く一本の線
 
Earn big dreams_small_savings_2013
Earn big dreams_small_savings_2013Earn big dreams_small_savings_2013
Earn big dreams_small_savings_2013
 
28des N As
28des N As28des N As
28des N As
 
24 M Ar Aceh
24 M Ar  Aceh24 M Ar  Aceh
24 M Ar Aceh
 
Connecting with Nature wk 1 - Human nature relationships
Connecting with Nature wk 1 - Human nature relationshipsConnecting with Nature wk 1 - Human nature relationships
Connecting with Nature wk 1 - Human nature relationships
 
Lect 8 env sustainability in oe 2013
Lect 8 env sustainability in oe 2013Lect 8 env sustainability in oe 2013
Lect 8 env sustainability in oe 2013
 
Edisi 31 Okt Nas
Edisi 31 Okt NasEdisi 31 Okt Nas
Edisi 31 Okt Nas
 
Edisi17 Seo Aceh
Edisi17 Seo AcehEdisi17 Seo Aceh
Edisi17 Seo Aceh
 
Edisi Medan04
Edisi Medan04Edisi Medan04
Edisi Medan04
 
Edisi 4 April Nusantara
Edisi 4 April NusantaraEdisi 4 April Nusantara
Edisi 4 April Nusantara
 
Saurabh, the all rounder
Saurabh, the all rounderSaurabh, the all rounder
Saurabh, the all rounder
 

Ähnlich wie Unit Testing Basics

Introduction To Continuous Integration
Introduction To Continuous IntegrationIntroduction To Continuous Integration
Introduction To Continuous IntegrationChristopher Read
 
PHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An IntroductionPHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An Introductionalexmace
 
Unit testing
Unit testingUnit testing
Unit testingBrian Hu
 
2010.10.30 steven sustaining tdd agile tour shenzhen
2010.10.30 steven sustaining tdd   agile tour shenzhen2010.10.30 steven sustaining tdd   agile tour shenzhen
2010.10.30 steven sustaining tdd agile tour shenzhenOdd-e
 
Introduction to unit testing
Introduction to unit testingIntroduction to unit testing
Introduction to unit testingGil Zilberfeld
 
Unit test using NUnit in Visual Studio
Unit test using NUnit in Visual StudioUnit test using NUnit in Visual Studio
Unit test using NUnit in Visual StudioLuca Bonini
 
Testing for Android: When, Where, and How to Successfully Use Test Automation
Testing for Android: When, Where, and How to Successfully Use Test AutomationTesting for Android: When, Where, and How to Successfully Use Test Automation
Testing for Android: When, Where, and How to Successfully Use Test AutomationTrent Peterson
 
Agile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayAgile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayJordi Pradel
 
Plone Testing Tools And Techniques
Plone Testing Tools And TechniquesPlone Testing Tools And Techniques
Plone Testing Tools And TechniquesJordan Baker
 
Engaging IV&V Testing Services for Agile Projects
Engaging IV&V Testing Services for Agile ProjectsEngaging IV&V Testing Services for Agile Projects
Engaging IV&V Testing Services for Agile ProjectsRavi Kumar
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?LB Denker
 
Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Arie van Deursen
 
Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application TestingYnon Perek
 

Ähnlich wie Unit Testing Basics (20)

Introduction To Continuous Integration
Introduction To Continuous IntegrationIntroduction To Continuous Integration
Introduction To Continuous Integration
 
PHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An IntroductionPHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An Introduction
 
Unit testing
Unit testingUnit testing
Unit testing
 
2010.10.30 steven sustaining tdd agile tour shenzhen
2010.10.30 steven sustaining tdd   agile tour shenzhen2010.10.30 steven sustaining tdd   agile tour shenzhen
2010.10.30 steven sustaining tdd agile tour shenzhen
 
TestNGvsJUnit
TestNGvsJUnitTestNGvsJUnit
TestNGvsJUnit
 
Introduction to unit testing
Introduction to unit testingIntroduction to unit testing
Introduction to unit testing
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Unit test using NUnit in Visual Studio
Unit test using NUnit in Visual StudioUnit test using NUnit in Visual Studio
Unit test using NUnit in Visual Studio
 
Testing for Android: When, Where, and How to Successfully Use Test Automation
Testing for Android: When, Where, and How to Successfully Use Test AutomationTesting for Android: When, Where, and How to Successfully Use Test Automation
Testing for Android: When, Where, and How to Successfully Use Test Automation
 
Agile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayAgile Software Testing the Agilogy Way
Agile Software Testing the Agilogy Way
 
Plone Testing Tools And Techniques
Plone Testing Tools And TechniquesPlone Testing Tools And Techniques
Plone Testing Tools And Techniques
 
Engaging IV&V Testing Services for Agile Projects
Engaging IV&V Testing Services for Agile ProjectsEngaging IV&V Testing Services for Agile Projects
Engaging IV&V Testing Services for Agile Projects
 
Mark meninger-feb-2010
Mark meninger-feb-2010Mark meninger-feb-2010
Mark meninger-feb-2010
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 
Testing
TestingTesting
Testing
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
 
Android testing
Android testingAndroid testing
Android testing
 
Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012
 
Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application Testing
 
Manual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testingManual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testing
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

Unit Testing Basics

  • 1. Unit Testing Basics Serhiy Oplakanets @ Mavenresearch, November 2010 Slides are not intended to make sense outside of the talk. Thursday, November 18, 2010
  • 2. A Discipline • Unit Testing is a discipline of Quality Assurance • Others Include: • Functional Testing • Integration Testing • Code Review • Continuous Integration • ... Thursday, November 18, 2010
  • 3. Unit Testing is • validating that individual units of application work properly Thursday, November 18, 2010
  • 4. Benefits • Finding bugs early • Less debugging • Changes to application are safer and easier • Examples of code usage • Documentation (to some extent) • Unit test is a tool to validate code design; in most cases code that is hard to test is badly designed Thursday, November 18, 2010
  • 5. Good Unit Test • Test only one unit at a time • Do not depend on ordering of test run • Runs fast • Tests only one feature at a time • Easy to understand • Tests the public API of unit • Covers all usage cases Thursday, November 18, 2010
  • 6. Test Suite • Multiple tests form Test Suite • Your most important tool to check impact of changes • Helps estimate changes Thursday, November 18, 2010
  • 7. Good Unit Test Suite • Is simple to run • Runs fast (preferable in seconds) • Is always Green • Is non-interactive Thursday, November 18, 2010
  • 8. Limitations of Unit Testing • Not every bug can be found by unit tests • As we're testing only one module -- integration issues are not covered • Multi-threaded issues can't be caught by one- threaded test • Hardware failures, 3rd party component issues, etc. All those can be covered only with a proper Functional Test Suite Thursday, November 18, 2010
  • 10. Resources • http://en.wikipedia.org/wiki/Unit_testing :) • http://blog.stevensanderson.com/ 2009/08/24/writing-great-unit-tests-best- and-worst-practises/ • http://googletesting.blogspot.com/2008/11/ clean-code-talks-unit-testing.html • http://geosoft.no/development/ Thursday, November 18, 2010