2 ms·
I use a mixture. If it's a Java method, I use test-after, by which I mean after the method is written, some times after the core of the class. Most of the tim
by russell 17y ago
I use a mixture. If it's a Java method, I use test-after, by which I mean after the method is written, some times after the core of the class. Most of the time I am not working from specs, so I find TDD interrupts the design/implementation flow. Often I dont know the complete signature until I have written it. If the method is complex, it often gets a couple of refactorings along the way.
The case where I consistently test before is a method doing database queries. I find it much less tedious to write and test pure SQL before any java.
- stcredzero 17y agoSQL has a lot of parallels to dynamic languages like Smalltalk. Both have strange loops. SQL tables have their meta-data stored in yet another SQL table. (System dictionary.) All Smalltalk objects have their behavior stored in another object, its class. The class of any class is Class. Class also has a class, named Metaclass. The class of Metaclass is itself.