Download - Why Test Driven Development?
Test Driven DevelopmentWhy Should You Care about TDD
And Automated (Unit) Testing?
Naresh JainTwitter: @nashjain
Blog: http://blogs.agilefaqs.com
Licensed Under Creative Commons by Naresh Jain1
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the TestPass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Fail
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Fail
Pass
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Refactor
Fail
Pass
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Refactor
Fail
Pass
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Refactor
Fail
Pass
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Add a Test
Run the Test
Make a little change
Run the Test
Refactor
Fail
Pass
Fail
Pass
Test Driven Development
TDD Rhythm - Test, Code, Refactor
2
Why Learn TDD?
3
Manual (monkey) Checking by Developers and Tester
4
Stay away from (time hungry) debugger
5
Maintain Focus
6
Confidence
7
Reduce Wastage: Hand Overs
8
Helps youSlow down and Think
9
Communication
10
11
Ultimate Goals
12
Ultimate Goals
• Bring JOY back to programming
12
Ultimate Goals
• Bring JOY back to programming
• Understand Code Easily
12
Ultimate Goals
• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
12
Ultimate Goals
• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In
12
Ultimate Goals
• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In
• Reduce Maintenance Significantly
12
Living, up-to-date specification
13
Learning:Listen to your code
14
Testable Code by Design+
Safety Net
15
Communicate Design Decisions
16
Loosely-Coupled Design
17
Refactoring
18
Ultimate Goals
• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In
• Reduce Maintenance Significantly
19
Thank You!Naresh Jain
Licensed Under Creative Commons by Naresh Jain
20