Date post: | 20-Jul-2015 |
Category: |
Software |
Upload: | mirko-kiefer |
View: | 233 times |
Download: | 1 times |
Why use TDD?• Less fear of change
• Increase productivity and focus
• Better communication in teams
• Improved software design
• Less bugs
Test in layers
• Start with the public interface (API / user interface)
• Mock the next (non-implemented) layer underneath
• Repeat with implementing the next layer
• Example:user interface -> server API -> request handlers -> database
Refactor
• Remove duplication
• If obvious, write “correct” implementation
• Write next failing test
Code coverage
• Don’t be fanatic
• Code covered does not mean its tested
• You know which code is critical
Keep it simple
• Do you really need tools for mocking and dependency injection?
• Tools introduce complexity and can slow you down
• Embrace concepts, not tools