The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Writing Unit Tests as Programmer's Warm-Up

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Slava Imeshev

Posts: 114
Nickname: imeshev
Registered: Sep, 2004

Slava Imeshev is a Software Engineer with experience that began when machines were big
Writing Unit Tests as Programmer's Warm-Up Posted: May 16, 2008 12:56 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Slava Imeshev.
Original Post: Writing Unit Tests as Programmer's Warm-Up
Feed Title: Slava on Everything
Feed URL: http://jroller.com/imeshev/feed/entries/rss
Feed Description: Slava Imeshev's Weblog
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Slava Imeshev
Latest Posts From Slava on Everything

Advertisement

"Flow" is a the most productive state of programmer's mind. You can induce the flow by starting your day with writing unit tests.

All programmers know this state of "flow", when your productivity is at its highest. The design decisions are coming naturally, the written code is perfect and a week's work can be done in a couple of hours. And it feels really good. I think it's just the sense of creative fulfillment. Some call it creative Zen.

The problem is, the flow does not come on demand. It usually requires some kind of warming-up. What I have noticed is that it is much easier to get into the flow after you are doing something that you like, something rewarding but not laborious. Yes, meetings are ultimate killers of the flow. Want to be productive, don't go to meetings. After trying many activities, I found one that helps to get into the flow. It works great for me and may work for you, especially if you are into eXtreme Programming a.k.a XP. This activity is writing unit tests.

It works the following way: Start your day with finding classes or methods that not covered with tests. There are always that are not covered. Write tests for some of them. As you are adding tests, you may be noticing small deficiencies in the code. Refactor them. You may even find bugs while writing tests.

Even if you didn't not feel like programming at all in the beginning, in 30 minutes you will notice that interest appears. The test coverage improves, refactoring is already helping to improve design. And you have just found a couple of subtle bugs (you will for sure) thanks to the new tests. All this feels really good and you are already coding. You are in the flow.

This "programmer's warm-up" helps to get into flow even when it seems that creativity has gone forever. Try it and quite possible it works for you. And don't forget the nice side effect in form of increased test coverage.

Helpful Resources on Unit Test and Test Coverage

Some of these tools are not free, but, believe me, they worth every cent.

Read: Writing Unit Tests as Programmer's Warm-Up

Topic: Oldie but Goodie Previous Topic   Next Topic Topic: Smalltalk Solutions Daily Update:

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use