Introduction to Test Driven Development [TDD]

  • 158 views
Uploaded on

This preso introduces the concept of TDD and explains the techniques involved in implementing

This preso introduces the concept of TDD and explains the techniques involved in implementing

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
158
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. TEST DRIVEN DEVELOPMENT [TDD] An Introduction Ashish K Agarwal Vijay S Dey
  • 2. Takeaways  Understand the TDD philosophy  Oriented towards TDD practice  Aware of techniques for TDD  Write use case driven unit tests
  • 3. Contents  Why TDD  Three laws of TDD  Professional attitude towards TDD  Conventions for well written tests  Tools for TDD  Common TDD mistakes
  • 4. Why TDD?  It helps clarify business requirements  Allows to identify bug ahead of time  Develops the system incrementally  Gains confidence in our own code  Helps maintain the code
  • 5. Three laws of TDD
  • 6. Professional attitude towards TDD  Think about the tests first  Break the problem into smaller units  Treat the test code on par with production code  Have tests as documentation of the actual code  “Be Nice” to fellow developers
  • 7. Conventions for well written tests  Name of test – should indicate the business intent so when the test fails, dev knows why it matters E.g. testHappyPath() ShouldAlertUserWhenInputIsEmpty()
  • 8. Conventions (cont’d)  Skeleton of test – Setup -> Execute -> Verify E.g.
  • 9. Conventions (cont’d)
  • 10. Conventions (cont’d)
  • 11. Tools for TDD  Junit framework  Mockito  Test code coverage – e.g. Clover
  • 12. Hands on Calculator Service
  • 13. Takeaways  Understand the TDD philosophy  Oriented towards TDD practice  Aware of techniques for TDD  Write use case driven unit tests