The Artima Developer Community
Sponsored Link

Agile Buzz Forum
sensing variables

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
sensing variables Posted: Aug 19, 2006 4:07 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Kevin Rutherford.
Original Post: sensing variables
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


Getting Serious about Preserving Behavior
is a great little article by Mike feathers, in which he introduces a refactoring trick he calls sensing variables. The gist is this:

You want to refactor some code, but it's too ugly to test as it currently stands. So there's a danger that the refactoring will somehow inadvertently change behaviour. Mike suggestes introducing a new variable outside of the scope of the code under test, and then altering the code to report state into that variable. Now, write tests that check the values in the variable, under a variety of conditions. Those tests will tell us whether our subsequent refactorings have changed the variable's value - in other words, whether we have accidentally changed some deep behaviour somewhere. Very nice.

Read: sensing variables

Topic: Find your relief Previous Topic   Next Topic Topic: The Death of UML?

Sponsored Links



Google
  Web Artima.com   

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