top | item 7018067

Why We Don't Write Tests

14 points| genericsteele | 12 years ago |whatdoitest.com

16 comments

order

drharris|12 years ago

He forgot two of the most important reasons people don't test:

1) We inherited this monolithic spaghetti mess of a legacy system with a class hierarchy that does not lend itself to testing without a major rewrite of the codebase.

2) Online tutorials expertly teach you how to test methods like add(x, y) and things associated with the 5-minute blog tutorial they also have, but fail miserably at teaching you how to test code that actually might exist in the real world.

genericsteele|12 years ago

Yeah I did.

1) Inheriting someone else's bad code and habits is a huge reason to throw testing out the window. It's really frustrating and always comes with a "We'll write tests in the future."

2) This goes in line with another thing I've been finding. It's super easy to show why you should test, but It's much harder to actually show how to test in the real world. These tutorials show the simplest way to write a test, and it hurts those trying to learn.

waterlion|12 years ago

I read the headline and skimmed the article. I only realised at the end, when he's trying to sell you something, that the 'we' is inclusive-marketing-speak.

Before that I thought that it was 'we (my organisation) don't write tests, and here's a defence of why', followed by a list of excuses (in which I thought 'I wouldn't touch this guy with a bargepole'). I only realised he wasn't making excuses for himself after reading the homepage.

tl;dr misleading title and confessional writing style YMMV

a3voices|12 years ago

In my opinion, tests should be an after-thought until your product is seeing success and heavy use.

genericsteele|12 years ago

A year ago, I would have agreed with you. There's nothing stopping you from building a successful product without writing tests. Since I built the habit of writing tests, though, It definitely makes a difference, especially if you're working with a team or contractors.

Tests are a super helpful way to say "See, this works. Make sure it keeps working, everyone."

RougeFemme|12 years ago

You're not afraid that some actual/potential users might be scared off from your product due to defects they encounter while using/trying the product?

waterlion|12 years ago

What happens when your customers' data is lost or corrupted because of a bug you could have caught?