I have been reading Code Complete (which I would highly recommend to any software developer) and came across an entry of refactoring. One of the tips for refactoring involves A program contains code that seems like it might be needed someday
. It talks about how designing ahead (and developing ahead) w/o rigorously testing using code that is written is a bad idea for a few different reasons that were listed, among which is that you or someone else will use the methods and only realize that they aren’t implemented, or are poorly implemented. I do agree that scaffolding methods, creating methods w/o testing or really using them at all, is a bad idea, but is sometimes extremely helpful. It can allow a lead developer to outline what he or she is intending to do, and what vision they have for the future of said classes. It allows others to see these right away, but at the cost of having to know just as much about what is or is not implemented.
What I would like to see in an IDE is some sort of software health rating and monitor. Allow you to assign some value to a piece of code, let it be a class, method or property, and from there, you can view the “health” of your code. Imagine scaffolding out a class and being able to give it a “low health” rating. This information can be shared with other developers on the project (even versioned!), so that they may know what parts are well developed, and what parts may not be so well developed. It can allow developers to show “danger area’s” where code may radically change, and “stable” area’s, where code has been tested and is safe to heavily use. This is information that a single developer holds in their head as they are developing, but is hard to convey when other developers get involved. This way, you could be able to see at a glance which code is well tested, and which is not. If you use some piece of untested code, then your code gets the same label.
I believe that with tools like this, it takes an IDE well beyond a single text editor and provides many, many more benefits over just plain vi or emacs. In fact, the extremely poor quality of IDE’s is one topic that I would love to touch on, but is outside the realm of my post today. Maybe someday I will have the time to work on such a feature as a plugin to some unknown IDE that I might bet passionate about someday.
2 Responses to “Software Health Monitor”
Along those lines, Visual Studio Team Suite has code coverage highlighting, since it has an integrated testing suite. I don’t think it does highlighting based how much a piece of code is covered, but it’s a start. Someone also wrote a Vim plugin to shade code on how recently each line had changed. Seems like what you want is kind of like that, but more like the number of recent changes on each line.
That’s a great idea. When we were working on the Rubix program, Nathan saw some work-in-progress methods and thought those were intended to be the final product. That could have saved us some time if he could have somehow seen they were not intended to be anything more than almost psudo code notes for myself.