Technical debt has become a common metaphor for the accumulation of software design and implementation choices that seek fast initial gains but that are under par and counterproductive in the long run. However, as a metaphor, technical debt does not offer actionable advice on how to get rid of it. To get to a practical level in solving problems, more focused mechanisms are needed. Commonly used approaches for this include identifying code smells as quick indications of possible problems in the codebase and detecting the presence of AntiPatterns that refer to overt, recurring problems in design. There are known remedies for both code smells and AntiPatterns. In paper, our goal is to show how to effectively use common tools and the existing body of knowledge on code smells and AntiPatterns to detect technical debt and pay it back. We present two main results: (i) How a combination of static code analysis and manual inspection was used to detect code smells in a codebase leading to the discovery of AntiPatterns; and (ii) How AntiPatterns were used to identify, characterize, and fix problems in the software. The experiences stem from a private company and its long-lasting software product development effort.
翻译:技术债务已成为积累软件设计和实施选择的常见比喻,这些选择寻求快速的初步收益,但从长远看却适得其反。然而,作为一个比喻,技术债务并不能就如何摆脱它提供可操作的建议。为了达到解决问题的实际水平,需要建立更集中的机制。为此,通常使用的方法包括确定代码的嗅觉,作为代码库中可能出现的问题的快速迹象,并发现设计中反复出现的问题。对代码的嗅觉和安非他明都有已知的补救措施。在纸上,我们的目标是展示如何有效地使用共同工具和关于代码气味和安非他明的现有知识来探测技术债务并偿还债务。我们提出了两个主要结果:(一) 如何将静态代码分析和人工检查结合起来,以探测代码库中出现的问题,从而发现反帕塔子;以及(二) 如何使用反帕塔子来识别、描述和解决软件中的问题。经验来自一家私营公司及其长期的软件产品开发工作。