Test Driven Development Flashcards
Describe testing
Executing a program with the intention of finding errors in the code
State the steps in the traditional waterfall model
Analysis Design Implementation Testing Documentation Evaluation Maintenance
What are the problems with the waterfall model?
Testing happens late, if at all
Requirements decoupled from code during development
Hard work to test, so problems are not always detected
Describe the idea between TDD
Identify a small feature to be implemented
Write and run a unit test for it
Write smallest bit of code that will pass the test
Run test
Repeat
Describe the approach of TDD
Make small improvements frequently
Always have a working system
Incremental design
What does YAGNI stand for
You ain’t going to need it
What should unit tests be?
Focused, testing one thing at a time
Fast to run
Independent (of each other, the environment, run order)
Automatic
What features of JUnit make it suited to test driven development?
- Framework facilitating writing and running tests
- Method to check conditions (assertEquals, assertTrue, assertThrows etc)
- Annotations to declare methods as tests, setup, teardown
- Parameterized tests