Software Testing Anti-patterns
&gt; Writing tests before the implementation code implies that you are certain about your final API, which may or may not be the case.<p>How does this myth continue to persist?<p>Writing the test first has nothing to do with knowing the final API. When I write tests first I am <i>looking</i> for an API. The tests help guide me towards a nice API.<p>I personally find TDD in this manner works best when taking a <i>bottom-up</i> approach with your units. I start with the lowest-level, simple operations. I then build in layers on top of the prior layers. Eventually you end up with a high-level API that starts to feel right and is already verified by the lower-level unit tests.<p>Although this style of development has become less prevalent in my work with Haskell as I can rely on the type system to guarantee assertions I used to have to test for. This tends to make a <i>top-down</i> approach more amenable where I can start with a higher-level API and fill-in the lower-level details as I go.