Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« RTM ready tests | Main | Software Apprenticeship »
Thursday
Dec312009

Brown, Green, Refactor

Having seen enough crappy unit tests to last me a lifetime, I think there should be a parallel to the old “red-green-refactor” (from TDD) –

it’s evil twin brother should be “Brown-Green-Refactor” wherin you’d do a crappy test first, then make it pass (it could pass for the wrong reasons.. like threads, randoms, dates..), then refactor – the code, not the test.

in red-green-refactor you’d write a good test and remember to also refactor the test when refactoring your code, if needed.

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>