Andrzej is a DZone MVB and is not an employee of DZone and has posted 24 posts at DZone. View Full User Profile

How to Waste Time on TDD

06.17.2012
| 5754 views |
  • submit to reddit

This blog post was originally written by Piotr Włodarek on his TheSingularity.pl blog. I liked it so much that I translated it to English, so that it can reach a broader audience.

 Some people argue that TDD slows down the development process. If you want to follow this opinion here's what you should do:

  1. Write tests after writing the production code.
  2. Waste no time thinking about designing, simply jump straight into the TDD loop and do 100% of the design work there. You'll have a chance to change your code and tests structure over and over again. 
  3. Learn how to write test scenarios completely on your own, don't bother watching any screencasts and don't read any books on the topic. 
  4. Make sure your tests load at least half a minute before they actually start testing anything. You can easily achieve that by loading the whole framework and working with your old crappy HDD. 
  5. Make sure all the features are tested through the GUI (by driving a web browser or desktop GUI window). 
  6. Make sure all your tests depend on the database. 
  7. Manually find the corresponding test file and the production code. 
  8. Navigate between desktops, windows, tabs only to find the tests starting script. 
  9. Try to write as few classes as possible to ensure every class has multiple unrelated responsibilities. These are guaranteed to be a testing nightmare. 
  10. Write beautiful step definitions in Cucumber even if your customer doesn't care about reading your specs (or perhaps you don't even have a customer yet).
Published at DZone with permission of Andrzej Krzywda, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Johan Sjöberg replied on Mon, 2012/06/18 - 5:24am

So if you follow the absolute worst programming practices there are (TDD or not), it will slow down the development process? That's .. quite insightful

David Lim replied on Thu, 2012/07/12 - 12:13am

Most of the points don't even relate to TDD... the title should've been "How to waste time by doing stupid things with your test classes". Writing test classes doesn't automatically mean they're doing TDD.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.