8. Vocabulary
• Unit test
• Code you write to test your code
• Coverage
• Measure of how much code is tested
• Mock
• Replacement for something else
• Dependency Injection (DI)
• Builder design pattern
• Object and dependencies are created for you
• Continuous Integration (CI)
• Responds to check-ins, builds code, and generates code metrics (coverage, unit test pass fail, etc.)
9. Why Unit Test?
• Which would you rather do?
Write Code
Manual Testing
&
Fix Bugs
10. That’s cute… but really…
• Catches regression bugs at the developers desk
• Documents how code works
• Catalog of the business rules
11. What makes a good unit test?
• Repeatable
• Fast
• Test by layers
• Good Coverage
13. When do you run your test?
•All tests all the time!
After pull / sync
Before commits
During CI builds
Before you merge
After you merge
14. Excuses
• It takes too long to write
• It takes too long to run
• It’s not my job
• I don’t understand how the code is supposed to behave so I can’t
test it