Test Driven Development Flashcards Preview

CS2001 > Test Driven Development > Flashcards

Flashcards in Test Driven Development Deck (8)
Loading flashcards...
1
Q

Describe testing

A

Executing a program with the intention of finding errors in the code

2
Q

State the steps in the traditional waterfall model

A
Analysis
Design
Implementation
Testing 
Documentation
Evaluation
Maintenance
3
Q

What are the problems with the waterfall model?

A

Testing happens late, if at all
Requirements decoupled from code during development
Hard work to test, so problems are not always detected

4
Q

Describe the idea between TDD

A

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

5
Q

Describe the approach of TDD

A

Make small improvements frequently
Always have a working system
Incremental design

6
Q

What does YAGNI stand for

A

You ain’t going to need it

7
Q

What should unit tests be?

A

Focused, testing one thing at a time
Fast to run
Independent (of each other, the environment, run order)
Automatic

8
Q

What features of JUnit make it suited to test driven development?

A
  • Framework facilitating writing and running tests
  • Method to check conditions (assertEquals, assertTrue, assertThrows etc)
  • Annotations to declare methods as tests, setup, teardown
  • Parameterized tests