Musings on test driven development and unit tests

So, recommended reading of something by the maker of rails.  This one is on testing.  Test Driven Development versus Unit Testing versus System Testing.

http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html

Then he lists this one:

http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html

Holy smokes … I had just naturally assumed when people in production environments run; they use something like genetic programming to generate every possible outcome or to use loops.  Nope to maybe if they are crazy.  This guy asserts that not only are unit tests as buggy or illogical as the code you just wrote, but they also introduce extra coupling which leads developers in groups to just disable the flags on them everytime.

I delved down into the third article listed by and found several gems:

An even more professional approach is to leave the assertions in the code when you ship, and to automatically file a bug report on behalf of the end user and perhaps to try to re-start the application every time an assertion fails. At that same startup I mentioned above I had a boss who insisted that we not do this. I pointed out to him that an assertion failure meant that something in the program was very wrong and that it was likely that the program would produce the wrong result. Even the tiniest error in the kind of software we were building could cost a client $5 million in rework. He said it was more important that the company avoid the appearance of having done something wrong than that we stop before producing an incorrect result. I left the company. Maybe you are one of his clients today.

☞ Turn unit tests into assertions. Use them to feed your fault-tolerance architecture on high-availability systems. This solves the problem of maintaining a lot of extra software modules that assess execution and check for correct behavior; that’s one half of a unit test. The other half is the driver that executes the code: count on your stress tests, integration tests, and system tests to do tha

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s