

The Logic of Testing and the Testing of Logic - seanhandley
http://www.melbourne.co.uk/blog/2012/05/24/the-logic-of-testing-and-the-testing-of-logic/
Business logic is slippery and changing (if it isn’t, you’re not in a business that will ever make any money).
======
martinrue
The key here for me is the emphasis on ensuring that code that carries risk
(i.e. business logic) must be protected from regression – and that testing is
a good way to achieve that, rather than preaching for a particular approach
such as TDD/BDD/XDD.

In reality I see quite a few successful approaches of reaching the goal of
protecting code from regression and giving us the confidence to change it.

------
PaulHoule
Yep.

From the viewpoint of a maintenance programmer, every artifact (file, class,
method, function, test, etc.) is like a puppy you've adopted. It costs
something to make, it will cost much more to maintain, and if you don't really
need it, it does more harm than good.

Per the Pareto principle, 20% of the tests deliver 80% of the benefits.

Focus attention on: (i) tricky things (string parsing), (ii) security
sensitive things, and (iii) fragile things (add tests when you fix a bug)

------
sparknlaunch12
> _"So, skip all your boilerplate framework tests if you like – if you don’t
> feel like you need them, you probably don’t. But please, please lock down
> your business logic in tests. Maintain them. They’re a working
> representation of what’s actually important."_

Business logic should always be the dominating force. This is often forgotten
and the time you have 'real' users using the system it is too late to make
sweeping changes.

------
evincarofautumn
This article does a good job of separating the practical benefits of testing
from the religion of it. You should write tests because they help protect you
from silly mistakes, and automate things you would otherwise do by hand. Who
could say no to that?

------
sgerrand
Sadly, this blog post appears to me as an over extrapolated version of "write
tests for your code: you'll thank yourself later". I don't see what it adds to
the topic, apart from a confessional component.

~~~
seanhandley
Fair comment (though I don't see what it adds to the discussion).

------
jwallaceparker
> And now I see it, I don’t understand why anybody could assert that writing
> tests is a bad idea.

Great use of the word "assert" here - pun intended?

~~~
seanhandley
Oh my yes :-)

