The Artima Developer Community
Sponsored Link

Agile Buzz Forum
breaking the ice

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
Kevin Rutherford

Posts: 171
Nickname: spinach
Registered: Apr, 2006

Kevin Rutherford is an independent agile software development coach based in the UK
breaking the ice Posted: Feb 26, 2007 12:13 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Kevin Rutherford.
Original Post: breaking the ice
Feed Title: silk and spinach
Feed URL: http://silkandspinach.net/blog/index.xml
Feed Description: kevin rutherford on agile software development and life in macclesfield
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Kevin Rutherford
Latest Posts From silk and spinach

Advertisement

A new project and a new pile of legacy code always presents me with a large psychological barrier: where should I begin testing, and where should I begin trying to understand what's where?

Bill Wake, in the Planning Game Simulator chapter of his Refactoring Workbook, has a great answer. Bill suggests that we begin by writing just one test - any test - for every class in the system. The tests can be as simple as you like; their only purpose is to break the ice. Not only do these tests get every class into the test harness, they also prove to me that it's possible to get every class under test - and that removes the psychological barrier completely. From there it is always a lot easier to continue writing more tests.

I saw this effect for real recently on a client project, and we also experienced it at this month's AgileNorth coding dojo. We wanted to refactor a smell away from some of the "GUI" code in Wake's planning game simulator exercise, and someone suggested we needed to make the refactoring safe by writing a test first. But this was GUI code, so the temptation was to shrug and claim it was impossible. Undeterred, Guy wrote a couple of lines that created the window, pushed a button and checked the resulting number of cards in the backlog, and suddenly we were off and running. The refactoring we had in mind was now safe, and the code now seemed like it was ours.

At that point another interesting effect occurred. We looked at the few tests we now had, and we saw smells in the product code - smells we hadn't seen when we reviewed it at the start of the evening. The test code was revealing usability smells in the class' interfaces, and our understanding of what to do and where the code wanted to go deepened.

Even a two-line test can have a dramatic impact on the stress of dealing with "untamed" code.

Read: breaking the ice

Topic: Lock-in and Consumers Previous Topic   Next Topic Topic: Former Smalltalkers in podcasts

Sponsored Links



Google
  Web Artima.com   

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