Minority Opinions

Not everyone can be mainstream, after all.

Test-Driven Goals

leave a comment »

At one point, I was asked to give a talk about goals.  I don’t set personal goals very often, and until this blog, hadn’t deliberately followed through on many, so it took me a bit to find something to honestly say.  That’s when I realized that unit tests, like the ones I had been writing for both personal and work projects, are themselves a kind of goal.

Write them down or they’re meaningless.

Sure, you can run some informal functional tests on your software, but unless it’s written down, it’s easy to forget what you’ve done.  It’s easy to miss something during the next run.  What you write could be a series of steps to run through by hand, or an automated test suite; the former makes it easier to notice something odd, but the latter can run many more tests without getting tired.

Likewise, personal goals tend to be more effective when they’re written down and reviewed regularly; otherwise, they can quickly be forgotten and left by the wayside.

They help you know when you’re done.

I have occasionally thought about some corner case I might need to fix, written a quick test, and discovered that it already worked.  There have also been times when I thought a feature would take longer to implement than it really did.  When the unit tests all pass, I know there’s nothing more I need to program.  (If I can think of something, it needs a new test.)

This blog could perhaps take more of my time, but I know that one post per week is sufficient.  My spouse has a goal to keep at least a certain amount in savings; anything beyond that is fine to spend on annual vacations.  Other goals have a definite end point; find a better job or buy a car, for example.

They can prevent backsliding.

Automated unit tests are great at letting you know when a change breaks something tangentially related.  Some slight corner case that a user would have noticed, but escaped your attention when dealing with the area of interest.

While I was sick enough that I couldn’t cycle to work, I worried about sliding into a completely sedentary lifestyle.  Someone more goal-oriented might have set a certain number of minutes to exercise per week.

They help you prioritize.

One project I work on has far too many test cases.  A full run takes, quite literally, hours on a dedicated machine.  On the other hand, a partner wanted a set of about ten, in screencast format, for their testers to work through every time something changed.  That really helped narrow down which functionality was the most important.  Those major cases can be run quickly, and if one breaks, it gets fixed before the release.

Some of your personal goals are more important than others.  It’s easy to lose track of the important ones when faced with more urgent matters; explicitly arranging them in order of importance might restore some focus.

They provide small success stories.

The relief when one annoying case passes can be tangible.  On the other hand, most bugs and features are either too large or too small to provide a real sense of progress over the course of a day.  Looking at a list of newly passed test cases can make all the difference.

I’m starting to run out of ideas; posting weekly can occasionally be stressful, partly because I expect some level of quality each time.  I am relieved when each one makes it out the door, particularly when I feel it matches what I meant to accomplish.


Written by eswald

30 Jul 2013 at 10:26 pm

Posted in Lifestyle, Technology

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s