SlideShare a Scribd company logo
1 of 24
Intelligent People. Uncommon Ideas.




Automated Testing vs Manual Testing

                               By Bhavin Turakhia
                                  CEO, Directi
  (shared under Creative Commons Attribution Share-alike License incorporated herein by reference)
                          (http://creativecommons.org/licenses/by-sa/3.0/)
Manual Tests

 • Coding Process with Manual Tests
     Write code
     Uploading the code to some place
     Build it
     Running the code manually (in many cases filling up forms etc
      step by step)
     Check Log files, Database, External Services, Values of variable
      names, Output on the screen etc
     If it does not work, repeat the above process




             Creative Commons Attribution Share-alike                    2
Automated Tests

 • Coding Process with Automated Unit Tests
       Write one or more test cases
       Auto-compile and run to see the tests fail
       Write code to pass the tests
       Auto-compile and run
       If tests fail -> make appropriate modifications
       If tests pass -> repeat for next method
 • Coding Process with Automated Functional Tests
       Finish writing code (with all unit tests passing)
       Write a Functional Test using any tool
       Auto-compile and run
       If tests fail -> make appropriate modifications
       If tests pass -> move ahead


               Creative Commons Attribution Share-alike     3
Automated Tests vs Manual Tests

 • Effort and Cost
        Lets assume 6 test cases
        Effort required to run all 6 manually => 10 min
        Effort required to write unit tests for all 6 cases => 10 min
        Effort required to run unit tests for all 6 cases => < 1 min
        Number of testing iterations => 5
        Total manual testing time => 50 min
        Total unit testing time => 10 min
                                            Manual Test
        Release   Manual Test   Auto Test   Cumulative

          1           10           10           10

          2           10           0            20

          3           10           0            30

          4           10           0            40

          5           10           0            50



                   Creative Commons Attribution Share-alike              4
Automated Tests vs Manual Tests

 • Effort and Cost
     Adding incremental Unit test cases is cheaper than adding
      incremental Manual Test Cases
        • Eg registerDomain
              Case 1: Register a .com domain with all correct fields
              Case 2: Register a .com domain with an invalid nameserver




               Creative Commons Attribution Share-alike                    5
Automated Tests vs Manual Tests

 • Manual Testing is boring
       Noone wants to keep filling the same forms
       There is nothing new to learn when one tests manually
       People tend to neglect running manual tests
       Noone maintains a list of the tests required to be run if they are
        manual tests
 • Automated Tests on the other hand are code
       They are fun and challenging to write
       One has to carefully think of design for reusability and coverage
       They require analytical and reasoning skills
       They represent contribution that is usable in the future




               Creative Commons Attribution Share-alike                      6
Automated Tests vs Manual Tests

 • Manual Testing is not reusable
     The effort required is the same each time
     One cannot reuse a Manual Test
 • Automated Tests are completely reusable
     IMPORTANT: One needs to setup a Continuous Integration
      Server, a common Code Repository and a organization structure
     Once written the Automated Tests form a part of the codebase
     They can be reused without any additional effort for the lifetime of
      the Project




             Creative Commons Attribution Share-alike                        7
Automated Tests vs Manual Tests

  • Manual Tests provide limited Visibility and have to be
          Repeated by all Stakeholders
           Only the developer testing the code can see the results
           Tests have to be repeated by each stakeholder
             • For eg Developer, Tech Lead, GM, Management
  • Automated Tests provide global visibility
           Developers, Tech Leads and Management can login and see Test
            Results
           No additional effort required by any of them to see the software
            works!!
           Manual        Manual       Manual                             Dev Manual Total Manual
          Testing by    Testing by   Testing by   Total Manual              Test        Test
Release      Dev       Team Leads      Mgmt          Testing   Auto Test Cumulative Cumulative
   1          10            5             3             18        10         10           18
   2          10            5             3             18        0          20           36
   3          10            5             3             18        0          30           54
   4          10            5             3             18        0          40           72
   5          10            5             3             18        0          50           90


                             Creative Commons Attribution Share-alike                              8
Automated Tests vs Manual Tests

 • Manual Testing ends up being an Integration Test
     In a typical manual test it is very difficult to test a single unit
     In most circumstances you end up checking the unit alongwith
      backend services
     Introduces fragility – if something else breaks the manual test
      breaks
 • Automated Tests can have varying scopes
     One can test a unit (class / method), a module, a system etc




              Creative Commons Attribution Share-alike                      9
Automated Tests vs Manual Tests

 • Manual Testing requires complex Manual Setup and Tear
   Down
     Can involve frequently running db queries
     Can involve making changes to backend servers
     Steps become more complex with multiple dependent test cases
 • Automated Tests can have varying scopes and require
   less complex setup and teardown
     Unit Tests have external dependencies mocked – so no setup /
      teardown required
     Setup and Tear down are automated in Functional Tests using
      framework support




             Creative Commons Attribution Share-alike                10
Automated Tests vs Manual Tests

 • Manual Testing has a high risk of missing out on
   something
     Each time a developer runs manual tests it is likely he will miss out
      on an important test case
     New developers may have no clue about the battery of tests to be
      run
 • Automated Tests have zero risk of missing out a pre-
   decided test
     Once a Test becomes a part of Continuous Integration – it will run
      without someone having to remember to run it




             Creative Commons Attribution Share-alike                         11
Automated Tests vs Manual Tests

 • Manual Tests do not drive design
     Manual tests are run post-facto and hence only drive bug-patching
 • Automated Tests and TDD / Test-First development drive
   design
     Writing a Unit test first clarifies the requirement and influences
      design
     Writing Unit Tests with Mock Objects etc forces clean design and
      segregation through abstraction / interfaces / polymorphism etc




             Creative Commons Attribution Share-alike                      12
Automated Tests vs Manual Tests

 • Manual Tests do not provide a safety-net
     Manual tests are run post-facto and hence only drive bug-patching
 • Automated Tests provide a safety-net for refactoring /
   additions
     Even New developers who have never touched the code can be
      confident about making changes




             Creative Commons Attribution Share-alike                     13
Automated Tests vs Manual Tests

 • Manual Tests have no training value
 • Automated Tests act as documentation
     Reading a set of Unit Tests clarifies the purpose of a codebase
     They provide a clear contract and define the requirement
     They provide visibility into different use cases and expected results
     A new developer can understand a piece of code much more by
      looking at Unit Tests than by looking at the code
     Unit Tests define the expected behavior of the code




             Creative Commons Attribution Share-alike                         14
Automated Tests vs Manual Tests

 • Manual Tests create crazy code clutter
     Most manual testing involves –
       • System.outs to check values of variable names
       • Useless log file entries in app server, db server etc
       • Cause code / log / console clutter
                if then(s), flag based logging, event based log entries etc
        • Slows down the application
 • Automated Tests reduce code clutter to zero
     Log file entries / System.outs are replaced by assertions in test
      code
     Even if specific console / log entries are needed they can reside in
      the test and not in the code
     Keep a live application / logs / console clutter-free and fast



                 Creative Commons Attribution Share-alike                      15
Summary

 1. Manual Tests take more Effort and Cost more than
      Automated Test to write and run
 2.   Manual Testing is boring
 3.   Automated Tests are reusable
 4.   Manual Tests provide limited Visibility and have to be
      Repeated by all Stakeholders
 5.   Automated Tests can have varying scopes and can test
      single units of code by Mocking the dependencies
 6.   Automated tests may require less complex setup and
      teardown




             Creative Commons Attribution Share-alike          16
Summary

 7. Automated Testing ensures you dont miss out on running
    a test
 8. Automated Testing can actually enforce and drive clean
    design decisions
 9. Automated Tests provide a Safety Net for refactoring
 10.Automated Tests have Training value
 11.Automated Tests do not create clutter in
    code/console/logs




           Creative Commons Attribution Share-alike          17
Why do people not write Automated
Tests
 • Initial learning curve
      Understanding Unit Testing Frameworks and Functional Testing
       Frameworks
      Understanding Continuous Integration and effective usage of it
      Understanding and learning Code Coverage Tools
      Figuring out how to organize the tests
      How to create Mock Objects?
      How to automate the running of the tests each time?
      Where to commit the tests?
 • Am I really going to be working on this same module
     again?
 •   Will my tests be re-used? If not what is the point?


              Creative Commons Attribution Share-alike                  18
Why do people not write Automated
Tests
 • Solution
     Spend time during First Release to freeze / design / implement -
       • A Code Repository structure that incorporates Unit Tests and
          Functional Tests
       •  A CI Server integrated with the release
       •  Unit Testing Framework (any xUnit framework)
       •  Functional Testing Tools (Sahi / Watir / Selenium / QTP etc)
       •  Code Coverage Tools (Clover)
       •  Testing guidelines and principles
     Designate Responsibility
       • Each developer MUST write Unit tests for multiple use cases per unit
       • Designate a specific Developer to write Functional Tests
       • The developer who writes the tests is also responsible for organizing
          them, committing them and linking them in CI



              Creative Commons Attribution Share-alike                           19
Why do people not write Automated
Tests
 • Don’t give up
     If you come across a hurdle, pair
     Make sure you complete your testing responsibility
 • Check Code Coverage
     Use code coverage tools while coding and post-coding to check
      parts of your code that are covered by tests




             Creative Commons Attribution Share-alike                 20
What to Test

 • Unit Tests
     Ideally do not cross class boundaries
     Definitely do not cross process-boundaries
     Write a unit test with multiple cases
 • Functional Tests
     UI Tests using specific tools (Watir / Selenium / QTP / White etc)
     Tests one layer below the UI (Using APIs)




             Creative Commons Attribution Share-alike                      21
Best Practices

 • You must use a unit testing frameworks (there’s one for
     every platform)
 •   You must have an auto-build process, a CI server, auto-
     testing upon commits etc
 •   Unit Tests are locally during the day, and upon commit by
     CI Server
 •   Over a period of time you may want to have your CI
     Server run tests selectively
 •   Tests must be committed alongwith code




             Creative Commons Attribution Share-alike            22
Best Practices

 • Organize the tests properly
 • If you do not commit Tests they are not reusable and the
   reduced effort advantage is lost




            Creative Commons Attribution Share-alike          23
Intelligent People. Uncommon Ideas.




    Visit our Websites
http://careers.directi.com | http://www.directi.com

More Related Content

What's hot

Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)Wael Mansour
 
Testing Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksTesting Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksŁukasz Morawski
 
Testing concept definition
Testing concept definitionTesting concept definition
Testing concept definitionVivek V
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answersGaruda Trainings
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual TestingAyah Soufan
 
Some Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingSome Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingKumari Warsha Goel
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answerskaranmca
 
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys Computer Trainings Online
 
Tutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumTutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumKevalkumar Shah
 
Interview questions
Interview questionsInterview questions
Interview questionssivareddyeda
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECHPravinsinh
 
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assuranceBenjamin Baumann
 
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
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For AgileNaresh Jain
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.Vinay Agnihotri
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteriabasma_iti_1984
 

What's hot (20)

Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)
 
Testing Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksTesting Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation Frameworks
 
Software Testing or Quality Assurance
Software Testing or Quality AssuranceSoftware Testing or Quality Assurance
Software Testing or Quality Assurance
 
Testing concept definition
Testing concept definitionTesting concept definition
Testing concept definition
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answers
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual Testing
 
Some Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingSome Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software Testing
 
Basics in software testing
Basics in software testingBasics in software testing
Basics in software testing
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answers
 
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys
Latest Manual Testing Interview Questions and Answers 2015 - H2kinfosys
 
Tutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumTutorial of web application load testing in selinium
Tutorial of web application load testing in selinium
 
Interview questions
Interview questionsInterview questions
Interview questions
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECH
 
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assurance
 
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
 
Manual testing
Manual testingManual testing
Manual testing
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For Agile
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
 

Viewers also liked

Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...Anju ML
 
The Debate: Manual vs Automated Testing
The Debate: Manual vs Automated TestingThe Debate: Manual vs Automated Testing
The Debate: Manual vs Automated TestingDeRisk IT Inc.
 
Software Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testingSoftware Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testingREHMAT ULLAH
 
Software Testing Process, Testing Automation and Software Testing Trends
Software Testing Process, Testing Automation and Software Testing TrendsSoftware Testing Process, Testing Automation and Software Testing Trends
Software Testing Process, Testing Automation and Software Testing TrendsKMS Technology
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test AutomationPekka Klärck
 
Automated Software Testing
Automated Software TestingAutomated Software Testing
Automated Software Testingarild2
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testingKanoah
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 

Viewers also liked (9)

Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...
 
The Debate: Manual vs Automated Testing
The Debate: Manual vs Automated TestingThe Debate: Manual vs Automated Testing
The Debate: Manual vs Automated Testing
 
Software Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testingSoftware Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testing
 
Software Testing Process, Testing Automation and Software Testing Trends
Software Testing Process, Testing Automation and Software Testing TrendsSoftware Testing Process, Testing Automation and Software Testing Trends
Software Testing Process, Testing Automation and Software Testing Trends
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
Automated Software Testing
Automated Software TestingAutomated Software Testing
Automated Software Testing
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 

Similar to Automated testing vs manual testing

Automated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+TestingAutomated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+Testinggueste1e4db
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
Software Testing, Everyone's responsibility
Software Testing, Everyone's responsibilitySoftware Testing, Everyone's responsibility
Software Testing, Everyone's responsibilityKurt Bliefernich
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
Agile Testing Pasadena JUG Aug2009
Agile Testing Pasadena JUG Aug2009Agile Testing Pasadena JUG Aug2009
Agile Testing Pasadena JUG Aug2009Grig Gheorghiu
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flexmichael.labriola
 
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
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Andrey Oleynik
 
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
 
How to scale your Test Automation
How to scale your Test AutomationHow to scale your Test Automation
How to scale your Test AutomationKlaus Salchner
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeAleksandar Bozinovski
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptxmianshafa
 

Similar to Automated testing vs manual testing (20)

Automated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+TestingAutomated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+Testing
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Software Testing, Everyone's responsibility
Software Testing, Everyone's responsibilitySoftware Testing, Everyone's responsibility
Software Testing, Everyone's responsibility
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Agile Testing Pasadena JUG Aug2009
Agile Testing Pasadena JUG Aug2009Agile Testing Pasadena JUG Aug2009
Agile Testing Pasadena JUG Aug2009
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
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
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)
 
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
 
How to scale your Test Automation
How to scale your Test AutomationHow to scale your Test Automation
How to scale your Test Automation
 
Software testing
Software testingSoftware testing
Software testing
 
CNUG TDD June 2014
CNUG TDD June 2014CNUG TDD June 2014
CNUG TDD June 2014
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable Code
 
Unit Tests with Microsoft Fakes
Unit Tests with Microsoft FakesUnit Tests with Microsoft Fakes
Unit Tests with Microsoft Fakes
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptx
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Automated testing vs manual testing

  • 1. Intelligent People. Uncommon Ideas. Automated Testing vs Manual Testing By Bhavin Turakhia CEO, Directi (shared under Creative Commons Attribution Share-alike License incorporated herein by reference) (http://creativecommons.org/licenses/by-sa/3.0/)
  • 2. Manual Tests • Coding Process with Manual Tests  Write code  Uploading the code to some place  Build it  Running the code manually (in many cases filling up forms etc step by step)  Check Log files, Database, External Services, Values of variable names, Output on the screen etc  If it does not work, repeat the above process Creative Commons Attribution Share-alike 2
  • 3. Automated Tests • Coding Process with Automated Unit Tests  Write one or more test cases  Auto-compile and run to see the tests fail  Write code to pass the tests  Auto-compile and run  If tests fail -> make appropriate modifications  If tests pass -> repeat for next method • Coding Process with Automated Functional Tests  Finish writing code (with all unit tests passing)  Write a Functional Test using any tool  Auto-compile and run  If tests fail -> make appropriate modifications  If tests pass -> move ahead Creative Commons Attribution Share-alike 3
  • 4. Automated Tests vs Manual Tests • Effort and Cost  Lets assume 6 test cases  Effort required to run all 6 manually => 10 min  Effort required to write unit tests for all 6 cases => 10 min  Effort required to run unit tests for all 6 cases => < 1 min  Number of testing iterations => 5  Total manual testing time => 50 min  Total unit testing time => 10 min Manual Test Release Manual Test Auto Test Cumulative 1 10 10 10 2 10 0 20 3 10 0 30 4 10 0 40 5 10 0 50 Creative Commons Attribution Share-alike 4
  • 5. Automated Tests vs Manual Tests • Effort and Cost  Adding incremental Unit test cases is cheaper than adding incremental Manual Test Cases • Eg registerDomain  Case 1: Register a .com domain with all correct fields  Case 2: Register a .com domain with an invalid nameserver Creative Commons Attribution Share-alike 5
  • 6. Automated Tests vs Manual Tests • Manual Testing is boring  Noone wants to keep filling the same forms  There is nothing new to learn when one tests manually  People tend to neglect running manual tests  Noone maintains a list of the tests required to be run if they are manual tests • Automated Tests on the other hand are code  They are fun and challenging to write  One has to carefully think of design for reusability and coverage  They require analytical and reasoning skills  They represent contribution that is usable in the future Creative Commons Attribution Share-alike 6
  • 7. Automated Tests vs Manual Tests • Manual Testing is not reusable  The effort required is the same each time  One cannot reuse a Manual Test • Automated Tests are completely reusable  IMPORTANT: One needs to setup a Continuous Integration Server, a common Code Repository and a organization structure  Once written the Automated Tests form a part of the codebase  They can be reused without any additional effort for the lifetime of the Project Creative Commons Attribution Share-alike 7
  • 8. Automated Tests vs Manual Tests • Manual Tests provide limited Visibility and have to be Repeated by all Stakeholders  Only the developer testing the code can see the results  Tests have to be repeated by each stakeholder • For eg Developer, Tech Lead, GM, Management • Automated Tests provide global visibility  Developers, Tech Leads and Management can login and see Test Results  No additional effort required by any of them to see the software works!! Manual Manual Manual Dev Manual Total Manual Testing by Testing by Testing by Total Manual Test Test Release Dev Team Leads Mgmt Testing Auto Test Cumulative Cumulative 1 10 5 3 18 10 10 18 2 10 5 3 18 0 20 36 3 10 5 3 18 0 30 54 4 10 5 3 18 0 40 72 5 10 5 3 18 0 50 90 Creative Commons Attribution Share-alike 8
  • 9. Automated Tests vs Manual Tests • Manual Testing ends up being an Integration Test  In a typical manual test it is very difficult to test a single unit  In most circumstances you end up checking the unit alongwith backend services  Introduces fragility – if something else breaks the manual test breaks • Automated Tests can have varying scopes  One can test a unit (class / method), a module, a system etc Creative Commons Attribution Share-alike 9
  • 10. Automated Tests vs Manual Tests • Manual Testing requires complex Manual Setup and Tear Down  Can involve frequently running db queries  Can involve making changes to backend servers  Steps become more complex with multiple dependent test cases • Automated Tests can have varying scopes and require less complex setup and teardown  Unit Tests have external dependencies mocked – so no setup / teardown required  Setup and Tear down are automated in Functional Tests using framework support Creative Commons Attribution Share-alike 10
  • 11. Automated Tests vs Manual Tests • Manual Testing has a high risk of missing out on something  Each time a developer runs manual tests it is likely he will miss out on an important test case  New developers may have no clue about the battery of tests to be run • Automated Tests have zero risk of missing out a pre- decided test  Once a Test becomes a part of Continuous Integration – it will run without someone having to remember to run it Creative Commons Attribution Share-alike 11
  • 12. Automated Tests vs Manual Tests • Manual Tests do not drive design  Manual tests are run post-facto and hence only drive bug-patching • Automated Tests and TDD / Test-First development drive design  Writing a Unit test first clarifies the requirement and influences design  Writing Unit Tests with Mock Objects etc forces clean design and segregation through abstraction / interfaces / polymorphism etc Creative Commons Attribution Share-alike 12
  • 13. Automated Tests vs Manual Tests • Manual Tests do not provide a safety-net  Manual tests are run post-facto and hence only drive bug-patching • Automated Tests provide a safety-net for refactoring / additions  Even New developers who have never touched the code can be confident about making changes Creative Commons Attribution Share-alike 13
  • 14. Automated Tests vs Manual Tests • Manual Tests have no training value • Automated Tests act as documentation  Reading a set of Unit Tests clarifies the purpose of a codebase  They provide a clear contract and define the requirement  They provide visibility into different use cases and expected results  A new developer can understand a piece of code much more by looking at Unit Tests than by looking at the code  Unit Tests define the expected behavior of the code Creative Commons Attribution Share-alike 14
  • 15. Automated Tests vs Manual Tests • Manual Tests create crazy code clutter  Most manual testing involves – • System.outs to check values of variable names • Useless log file entries in app server, db server etc • Cause code / log / console clutter  if then(s), flag based logging, event based log entries etc • Slows down the application • Automated Tests reduce code clutter to zero  Log file entries / System.outs are replaced by assertions in test code  Even if specific console / log entries are needed they can reside in the test and not in the code  Keep a live application / logs / console clutter-free and fast Creative Commons Attribution Share-alike 15
  • 16. Summary 1. Manual Tests take more Effort and Cost more than Automated Test to write and run 2. Manual Testing is boring 3. Automated Tests are reusable 4. Manual Tests provide limited Visibility and have to be Repeated by all Stakeholders 5. Automated Tests can have varying scopes and can test single units of code by Mocking the dependencies 6. Automated tests may require less complex setup and teardown Creative Commons Attribution Share-alike 16
  • 17. Summary 7. Automated Testing ensures you dont miss out on running a test 8. Automated Testing can actually enforce and drive clean design decisions 9. Automated Tests provide a Safety Net for refactoring 10.Automated Tests have Training value 11.Automated Tests do not create clutter in code/console/logs Creative Commons Attribution Share-alike 17
  • 18. Why do people not write Automated Tests • Initial learning curve  Understanding Unit Testing Frameworks and Functional Testing Frameworks  Understanding Continuous Integration and effective usage of it  Understanding and learning Code Coverage Tools  Figuring out how to organize the tests  How to create Mock Objects?  How to automate the running of the tests each time?  Where to commit the tests? • Am I really going to be working on this same module again? • Will my tests be re-used? If not what is the point? Creative Commons Attribution Share-alike 18
  • 19. Why do people not write Automated Tests • Solution  Spend time during First Release to freeze / design / implement - • A Code Repository structure that incorporates Unit Tests and Functional Tests • A CI Server integrated with the release • Unit Testing Framework (any xUnit framework) • Functional Testing Tools (Sahi / Watir / Selenium / QTP etc) • Code Coverage Tools (Clover) • Testing guidelines and principles  Designate Responsibility • Each developer MUST write Unit tests for multiple use cases per unit • Designate a specific Developer to write Functional Tests • The developer who writes the tests is also responsible for organizing them, committing them and linking them in CI Creative Commons Attribution Share-alike 19
  • 20. Why do people not write Automated Tests • Don’t give up  If you come across a hurdle, pair  Make sure you complete your testing responsibility • Check Code Coverage  Use code coverage tools while coding and post-coding to check parts of your code that are covered by tests Creative Commons Attribution Share-alike 20
  • 21. What to Test • Unit Tests  Ideally do not cross class boundaries  Definitely do not cross process-boundaries  Write a unit test with multiple cases • Functional Tests  UI Tests using specific tools (Watir / Selenium / QTP / White etc)  Tests one layer below the UI (Using APIs) Creative Commons Attribution Share-alike 21
  • 22. Best Practices • You must use a unit testing frameworks (there’s one for every platform) • You must have an auto-build process, a CI server, auto- testing upon commits etc • Unit Tests are locally during the day, and upon commit by CI Server • Over a period of time you may want to have your CI Server run tests selectively • Tests must be committed alongwith code Creative Commons Attribution Share-alike 22
  • 23. Best Practices • Organize the tests properly • If you do not commit Tests they are not reusable and the reduced effort advantage is lost Creative Commons Attribution Share-alike 23
  • 24. Intelligent People. Uncommon Ideas. Visit our Websites http://careers.directi.com | http://www.directi.com