5 ms·
The best design tends to be emergent; http://c2.com/cgi/wiki?WhatIsAnAdvancer http://c2.com/cgi/wiki?WhatIsAnAdvancer Writing the tests first forces you to thi
by lmm 14y ago
The best design tends to be emergent; http://c2.com/cgi/wiki?WhatIsAnAdvancer http://c2.com/cgi/wiki?WhatIsAnAdvancer
Writing the tests first forces you to think about how a given interface will actually be used, which tends to lead to better code, because you're writing an interface that makes sense for the client rather than for the called code. In turn that means better encapsulation. It's probably possible to do this in the abstract, but if you're writing the test code anyway it doesn't cost you anything.