Oct 2, 2009

I Will Write the Tests Later

I've read A New Look at Test-Driven Development, a 7 page article by Dave Astels. He explains that what matters is to think of specifications (@list.size.should_equal 1) instead of tests (assert_equal @list.size, 1). He wrote RSpec for this and calls it Behavior Driven Development (BDD).
I need to try this out in WebYaST (this, or Shoulda).

1 comment:

Robert said...

The specification is what you are testing, the tests might be how you are testing.

Look up Brad J Cox and Andrew J Novobilski, Object-Oriented Programming an Evolutionary Approach, chapter 5 - Specification and Testing.

Behaviour can be described from the output side of the system: prod/poke it here and this happens i.e. it describes the interface. You could have several implementations of the interface and choose the best one.