标签:
Brian Sletten
Beverly Hills, California, U.S.
DEBT, WhEn WEll MAnAgED, is a useful financial instrument for both ordi- nary citizens and successful organizations. It balances present insufficiencies by borrowing against future surpluses. Used judiciously, short-term debt is an effective tool for smoothing out the rough edges of cash ebbs and flows. When abused, it becomes a burdensome yoke that makes it increasingly stressful to move along.
In the world of software development, borrowing time can be a useful strat- egy for meeting “at risk” milestones, while completing most of what needs to be done. Ward Cunningham introduced the notion of “technical debt” as something developers can incur as they head toward the end of an iteration,* or a deadline, if time gets short. At that point, they may not be able to do code right, but by taking some shortcuts they may be able to program code “right enough” to still cross the finish line.
Even though the software is in a temporary, imperfect state, this is a perfectly reasonable thing to do if the technical debt incurred is managed responsibly. If it is not paid off, however, it will start to become more painful to do over time. Continued borrowing against the future without repayment will put the project further at risk.
The best way to pay off your technical debt is to assess what “loans” were taken at the end of each iteration. Ask your developers to identify specific hacks? they would like to unwind, and quantify how much time they think they need to do so.
* Iteration: A short period of time chosen by an agile project team (a week, two weeks, a month, etc.) during which a key requirement chosen by the customer will be developed, tested, and then delivered to the customer for approval or comment. The next iteration will then begin to develop the next most important requirement and/or correct the work done in the preceding iteration.
? Hack: A quick fix or solution to a programming problem that works, but is less than ideal and may need to be revised when time allows. Fixing the inelegant code may be referred to as “unwinding a hack.”
?
???????????????They do not need to pay debt off immediately, but it is good to gauge the extent of the needed repair while the shortcuts are still fresh in the developers’ minds.
Make sure there are specific code problems identified to be rewritten, not just arbitrary buckets of time requested. This is not an opportunity to goof off, it is a disciplined approach to keeping your code base clean.
Additionally, an increasing array of software analysis tools such as code cover- age, coupling analysis, and detection of style deviations can automatically help identify places where debt has been incurred, perhaps without your knowl- edge. Enter these items into your issue tracking system and schedule them against future iterations. By balancing the workload to include new business functionality and paying off loans, it is possible to keep your technical debt from spiraling out of control while still satisfying customer feature requests.
Software gets unwieldy for many reasons. But it usually comes down to hacks, insufficient documentation, inappropriate dependencies, shortcuts, and devi- ations from the intended design. When developers throw up their hands and say they need to start over on a system, chances are that unpaid technical debt has become overwhelming. They feel the need to declare the software equiva- lent of bankruptcy.
By identifying this debt along the way and dealing with it quickly, you can make more frequent “minimum payments” to prevent ensuing chaos. This metaphor is a surprisingly useful way to explain to business stakeholders how software can become unmanageable over time and why they should invest in keeping code clean.
标签:
原文地址:http://blog.csdn.net/wangzi11322/article/details/48489311