I'm hunting a metric to measure the cost of cut-and-paste programming. We already use tools to detect duplicated code - but if we don't clean up our duplicated code, how much will it cost us? We know that the DRY principle, Don't Repeat Yourself, is a core principle of Extreme Programming. How can we actually measure the impact of non-DRY code on our projects? I'm referring to the simplest duped code problem of the same expressions in two or more places. Other cases of duplication such as the same logic written differently in different places is trickier to detect.I'm hunting a metric, a solid number that I can offer management. I am aware of the WTF metric of Robert Martin, but that is not precise enough.What is the purpose of insisting on a metric? Management is insisting on this metric and they won't be dissuaded. I'm really afraid that they may mandate that duplicated code be reduced on each sprint. Because we are so pressed to deliver, developers will find the duplicated code and hack it so it does not get detected. This would be a ticking time bomb!
A metric to measure the cost of cut and paste programming
coding style;dry