Slides for my talk on TDD, the usual mistakes that developers make when practising TDD, the wider issues in TDD and suggestions how to make TDD work better
4. What TDD isn’t
•TDD tests are not Unit Tests
•TDD tests are not User Acceptance Tests
5. What does TDD have to offer?
• Small pieces of code
• Short feedback loop
• Helps create design specification
• Reduces time to do bug fixes and add new features
• Reduces debugger-driven development
• Makes the code more adaptable
17. Make TDD work for you
Use the right tool for the job
18. TDD with Model-View-Controller(MVC)
public Controller UserController()
{
//...other code ommitted
public IHttpViewResult GetAllUsers()
{
return new UserView(userService.GetAllUsers());
}
}
19. Make TDD work for you
• Code-to-test radio => 1:2
• Find the right coverage ratio
• Test should take less time to write than actual code
• Keep clear separation between unit & integration
tests
• Find the best approach to code first (30:70?