From: Phlip Date: 2008-08-03T04:13:56+09:00 Subject: Re: unit testing advice James Britt wrote: > Isn't the idea of TDD and BDD that you discover what classes and method > are needed by writing the tests first? So there *should* be no model in > place prior to writing the test; the initial failure of the test is what > drive the creation of the model. When "greenfield" coding, one way to design is to force an unpredictable design to emerge via TDD. That's the high-end rationale for TDD. You can also sketch a design, then see if you can write the right tests to force it to emerge. When writing new code that addresses some existing library or module, you often do this: def test_learn_foo foo = assemble_foo result = foo.activate p result end Now you noodle around inside foo.activate - essentially learning what it can do. Then you pin down your research with assertions. It's all good. -- Phlip