A key aspect of technical debt (TD) management is the ability to measure the amount of principal accumulated in a system. The current literature contains an array of approaches to estimate TD principal, however, only a few of them focus specifically on architectural TD, and none of these are fully automated, freely available, and thoroughly validated. Moreover, a recent study has shown that many of the current approaches suffer from certain shortcomings, such as relying on hand-picked thresholds. In this paper, we propose a novel approach to estimate architectural technical debt principal based on machine learning and architectural smells to address such shortcomings. Our approach can estimate the amount of technical debt principal generated by a single architectural smell instance. To do so, we adopt novel techniques from Information Retrieval to train a learning-to-rank machine learning model that estimates the severity of an architectural smell and ensure the transparency of the predictions. Then, for each instance, we statically analyse the source code to calculate the exact number of lines of code creating the smell. Finally, we combine these two values to calculate the technical debt principal. To validate the approach, we conducted a case study and interviewed 16 practitioners, from both open source and industry, and asked them about their opinions on the TD principal estimations for several smells detected in their projects. The results show that for 71\% of instances, practitioners agreed that the estimations provided were \emph{representative} of the effort necessary to refactor the smell.
翻译:技术债务(TD)管理的一个关键方面是衡量一个系统中积累的本金数量的能力。目前的文献中包含一系列估算TD本金的方法,然而,只有少数方法具体侧重于建筑设计TD,而其中没有一个是完全自动化的、免费的和经过彻底验证的。此外,最近的一项研究显示,许多目前的方法存在某些缺陷,例如依赖手选的阈值。在本文件中,我们提出了一个根据机器学习和建筑气味来估计建筑技术债务本金以解决这些缺陷的新办法。我们的方法可以估计一个建筑气味实例产生的技术债务本金数额。为了做到这一点,我们采用了信息检索法的新技术,以培训一个学习到课堂的机器学习模型,该模型可以估计建筑气味的严重性,并确保预测的透明度。然后,我们静态地分析源代码,以计算产生气味的代码的准确数量。最后,我们将这两个数值结合起来计算技术债务本金。为了验证这一方法,我们进行了案例研究,并采访了16名来自开放源和行业的从业者,我们采用了新的技术本金本位技术本金本位技术本位技术本金本金本金本金本金本位技术本金本位技术。我们用了对71的气估算结果进行了研究,为测算。他们测测了他们关于71的气测了几个的气图,他们测了他们测了他们测了他们测了几个了行。