4 ms·
In a similar vain to what the author is talking about by writing tests you probably end up creating a better api, especially if you write the tests first.
by icefox 17y ago
In a similar vain to what the author is talking about by writing tests you probably end up creating a better api, especially if you write the tests first.
- silentbicycle 17y agoWell, sure. Designing an API, informed by feedback from writing some tests as you go, and dogmatically insisting that it's best to always write tests first and let that be the primary driver of the design process are two different things, however. (Not implying that you're saying the latter.) I don't think a lot of people would argue that writing tests can be a good way to get feedback about a design. Some particularly vocal TDD advocates seem to be making it into an all-or-nothing issue, though.
- anApple 17y agoThat's called design by contract: http://en.wikipedia.org/wiki/Design_by_contract http://en.wikipedia.org/wiki/Design_by_contract