Login
Username:

Password:


Lost Password?
Register now!
Quotes : How Do You Refactor Untested Code?
on 2010/2/9 9:51:38 (412 reads)
Quotes

I am currently reading the excellent "Debug It!" book written by Paul Butcher and I wanted to share with you some of the little gems that I have found in it.

"Bug fixing often uncovers opportunities for refactoring. The very fact that you're working with code that contains a bug indicates that there is a chance that it could be clearer or better structured."

"As a rule of thumb, for every user who tells you about a problem, there will be between 10 and 100 other users who experienced the same problem and didn't think to get in touch."

"Once you start to get on top of your quality issues, you're going to want to start refactoring the old, crufty, untested code. And you should - the point of exercise is to clean up problems, and refactoring is a key element of that process. Remember, however, that refactoring crucially depends upon the support of an extensive suite of automated tests. Without tests, you're not refactoring. You're hacking. So, how do you refactor untested code? You don't. The first thing you do is to write the tests."

Source: "Debug It!", Paul Butcher, Pragmatic Bookshelf, 214 pages

Rating: 0.00 (0 votes) - Rate this News -
Printer Friendly Page Send this Story to a Friend Create a PDF from the article


Bookmark this article at these sites

                   

We Support

testdriven.com

Polls
At what stage is the agile approach (XP, Scrum, ...) adoption at your location?
Not using
Investigating
Analysed and rejected
Pilot project
Partial implementation (adoption of some agile practices)
Partial deployment (some projects are using this approach)
Deployed (all new projects are using this approach)
Jobs

Resources: Methods & Tools | SD Tools | SD Articles | SD Directory | SD Videos | SD Jobs | SQA Zone | DevBazar | Ajax Alliance | SD News | SD Conferences
SD Blogs | Forum Logiciel | Software Project Planet | SQA Planet | UML Planet | Cloud Voices | Java TV | .NET TV | Testing TV | TV Agile | RIATube
Java Voices | .NET Voices | PHP Voices | DBA Voices | Agile Voices | Scrum Planet | Ajax Voices | RIA Voices | The Waterfall Manifesto