SlideShare a Scribd company logo
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
2
2
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
3
3
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
Release Manual Test Auto Test
Manual Test
Cumulative
1 10 10 10
2 10 0 20
3 10 0 30
4 10 0 40
5 10 0 50
4
4
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
5
5
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
6
6
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
7
7
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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!!
Release
Manual
Testing by
Dev
Manual
Testing by
Team Leads
Manual
Testing by
Mgmt
Total Manual
Testing Auto Test
Dev Manual
Test
Cumulative
Total Manual
Test
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
8
8
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
9
9
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
10
10
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
11
11
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
12
12
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
13
13
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
14
14
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
15
15
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
16
16
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
17
17
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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?
18
18
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
19
19
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
20
20
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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)
21
21
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
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
22
22
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
Best Practices
• Organize the tests properly
• If you do not commit Tests they are not reusable and the
reduced effort advantage is lost
23
23
Creative Commons Attribution Share-alike
Creative Commons Attribution Share-alike
Intelligent People. Uncommon Ideas.
Visit our Websites
http://careers.directi.com | http://www.directi.com

More Related Content

Similar to Automated Testing vs Manual Testing.ppt (20)

PDF
Introduction to Automated Testing
Lars Thorup
 
PDF
Introduction to-automated-testing
BestBrains
 
PDF
Manual vs. Automated Testing.pdf
AnanthReddy38
 
PDF
Automated vs.pdf
AmirKhan811717
 
PPTX
Testing 101
Noam Barkai
 
PDF
5 Steps to Jump Start Your Test Automation
Sauce Labs
 
PDF
Manual vs Automation Testing_ Pros, Cons, and When to Choose Automation.pdf
khushnuma khan
 
PPTX
Leandro Melendez - Switching Performance Left & Right
Neotys_Partner
 
PPT
Automated testing overview
Alex Pop
 
PDF
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
PDF
Types of Software Testing: Ensuring Quality and Performance
zdtwenty4
 
PPT
Test planning and software's engineering
MansiganeshJawale
 
PDF
Types of Automation Testing: A Comprehensive Guide
Jace Reed
 
PDF
Discover the power of QA automation testing
Softweb Solutions
 
PDF
Agile Testing Pasadena JUG Aug2009
Grig Gheorghiu
 
PPTX
Unit Testing and TDD 2017
Xavi Hidalgo
 
PPTX
Real Testing Scenario Strategy - Bringing It All Together For Success
Adam Sandman
 
PDF
Testing Slides 1 (Testing Intro+Static Testing).pdf
MuhammadShoaibHussai2
 
PPTX
An Introduction to Unit Testing
Sahar Nofal
 
PPTX
Software testing
KarnatiChandramoules
 
Introduction to Automated Testing
Lars Thorup
 
Introduction to-automated-testing
BestBrains
 
Manual vs. Automated Testing.pdf
AnanthReddy38
 
Automated vs.pdf
AmirKhan811717
 
Testing 101
Noam Barkai
 
5 Steps to Jump Start Your Test Automation
Sauce Labs
 
Manual vs Automation Testing_ Pros, Cons, and When to Choose Automation.pdf
khushnuma khan
 
Leandro Melendez - Switching Performance Left & Right
Neotys_Partner
 
Automated testing overview
Alex Pop
 
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Types of Software Testing: Ensuring Quality and Performance
zdtwenty4
 
Test planning and software's engineering
MansiganeshJawale
 
Types of Automation Testing: A Comprehensive Guide
Jace Reed
 
Discover the power of QA automation testing
Softweb Solutions
 
Agile Testing Pasadena JUG Aug2009
Grig Gheorghiu
 
Unit Testing and TDD 2017
Xavi Hidalgo
 
Real Testing Scenario Strategy - Bringing It All Together For Success
Adam Sandman
 
Testing Slides 1 (Testing Intro+Static Testing).pdf
MuhammadShoaibHussai2
 
An Introduction to Unit Testing
Sahar Nofal
 
Software testing
KarnatiChandramoules
 

More from ZakriyaMalik2 (8)

PPT
Automated Testing v s Manual Testing.ppt
ZakriyaMalik2
 
PPTX
Group - 9 _ Github Actions.pptx
ZakriyaMalik2
 
PPTX
Software Configuration Management.pptx
ZakriyaMalik2
 
PPTX
Object Oriented Testing Strategy.pptx
ZakriyaMalik2
 
PPTX
Project PPT.pptx
ZakriyaMalik2
 
PDF
Operating System Lecture 4 on Different Topics
ZakriyaMalik2
 
PPTX
3._Relational_Algebra.pptx:Basics of relation algebra
ZakriyaMalik2
 
PDF
Database :Introduction to Database System
ZakriyaMalik2
 
Automated Testing v s Manual Testing.ppt
ZakriyaMalik2
 
Group - 9 _ Github Actions.pptx
ZakriyaMalik2
 
Software Configuration Management.pptx
ZakriyaMalik2
 
Object Oriented Testing Strategy.pptx
ZakriyaMalik2
 
Project PPT.pptx
ZakriyaMalik2
 
Operating System Lecture 4 on Different Topics
ZakriyaMalik2
 
3._Relational_Algebra.pptx:Basics of relation algebra
ZakriyaMalik2
 
Database :Introduction to Database System
ZakriyaMalik2
 
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Digital Circuits, important subject in CS
contactparinay1
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Ad

Automated Testing vs Manual Testing.ppt

  • 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 2 2 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 3 3 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 Release Manual Test Auto Test Manual Test Cumulative 1 10 10 10 2 10 0 20 3 10 0 30 4 10 0 40 5 10 0 50 4 4 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 5 5 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 6 6 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 7 7 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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!! Release Manual Testing by Dev Manual Testing by Team Leads Manual Testing by Mgmt Total Manual Testing Auto Test Dev Manual Test Cumulative Total Manual Test 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 8 8 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 9 9 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 10 10 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 11 11 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 12 12 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 13 13 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 14 14 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 15 15 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 16 16 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 17 17 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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? 18 18 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 19 19 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 20 20 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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) 21 21 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 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 22 22 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 23. Best Practices • Organize the tests properly • If you do not commit Tests they are not reusable and the reduced effort advantage is lost 23 23 Creative Commons Attribution Share-alike Creative Commons Attribution Share-alike
  • 24. Intelligent People. Uncommon Ideas. Visit our Websites http://careers.directi.com | http://www.directi.com