test driven development at 10,000 feet
DESCRIPTION
An introduction to Test Driven Development for those not familiar with it.TRANSCRIPT
TEST DRIVEN DEVELOPMENT
Let’s begin →Let’s begin →
At 10,000 feet
WHY TDD?
• We need a way to find defects earlier on in the development cycle..
TDD REDUCES DEBUG TIME
TESTS = CODE EXAMPLES
NO TDD = NO VELOCITY• The more complex our code becomes, the longer it takes to make
changes or add new features.C
ompl
exity
Time Easy to change
Hard to change
TDD PROTECTS US FROM OURSELVES
• Automated tests remind us when we inadvertently screw up part of the code. No matter how significant.
TDD EMPOWERS YOU
THE THREE RULES OF TDD
RULE # 1
• You are not allowed to write any production code unless it is to make failing unit tests pass.
RULE #2
• You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
RULE #3
• You are not allowed to write any more production code than is sufficient to pass the one failing test.
TDD IN PRACTICE
SAY WHAT?
Let’s see some code
The Bowling Game
1
60
4
5
4 5
14
6 5
29 49
0 1
11761
7 6
77 97
2 6
133
• Test code is just as important as production code and should be shown the same level of respect and professionalism.
THANK YOU!Any Questions?