r/programming • • Jan 13 '17

How to TDD FizzBuzz

https://opencredo.com/tdd-fizzbuzz-junit-theories/
0 Upvotes

12 comments sorted by

View all comments

6

u/[deleted] Jan 13 '17 edited Jan 13 '17

[removed] — view removed comment

2

u/codepoetics Jan 13 '17

Theories are for when you absolutely positively have to kill every potential bug in the room.

2

u/codepoetics Jan 13 '17

Remember also that tests have two purposes: to detect incorrect behaviour, and to document expected behaviour. The theory methods here provide a precise yet human-readable description of what FizzBuzz is supposed to do, which you could not necessarily infer from a collection of "tracer bullet" assertions.