TEST DRIVEN DEVELOPMENT
TDD
five pillars of software engineering
- architecture e.g OO
- Convention and standards
- version control
- coordination e.g ag
- Test driven development
tests provide?
- documentation of code
- catch future errors
- long term time saving
Disclaimer!
tests are just a tool TDD is the process.
professionals?
what do doctors/surgeons do?
what do engineers do?
process is?
- difference between surgery and cutting people open
- difference between engineering and tinkering
- difference between software engineering and programming
what is tdd
- decide what you want to build
- decide what the code will do
- write a test that will pass if the code is that thing
- run the test see if it will fail
- write the code
- Run the code see if it will pass
what does it provide
- document the design before building it
- Proof that code implements the design
- Encourages the design of testable code
- Bullet Three
Tdd Good Practices
- Never code first
- the risk of writing complex untestable code
- always write precise tests that only check for the expected results
Testable code is
- Modular
- Decoupled (independent)
- limited scope (not doing too much in one place)
result is?
- Better code in less time
caveat
- you will do this for a while before you get better
- intelligence is an asset (be smart about how you test)
TEST DRIVEN DEVELOPMENT
By ian munene
TEST DRIVEN DEVELOPMENT
- 429