[论文解读] An architectural technical debt index based on machine learning and architectural smells
本文提出了一种全自动、透明且经过验证的架构技术债指数(ATDI),该指数利用机器学习估算架构债本金,通过排名架构异味严重程度,并结合静态代码分析测量代码规模。该方法在估计准确性方面获得了71%的从业者一致认可,提供了一种完全自动化、免费获取的替代方案,优于基于阈值的方法。
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.
研究动机与目标
- 解决目前缺乏全自动、免费获取且全面验证的架构技术债(ATD)本金估算方法的问题。
- 克服现有方法依赖人工设定阈值或任意基准的局限性。
- 开发一种透明的、基于机器学习的系统,用于估算重构单个架构异味实例所需的工作量。
- 通过开源项目和工业界的从业者验证该方法,确保其在现实场景中的相关性。
- 提供一种可扩展、可操作且可复现的方法,用于跟踪和管理软件系统中的架构技术债。
提出的方法
- 使用基于信息检索技术(如TrueSkill)训练的排序学习梯度提升机器学习模型,估算架构异味实例的严重程度。
- 应用静态代码分析,精确统计每个架构异味实例所涉及的代码行数。
- 将机器学习预测的严重程度评分与代码行数结合,计算归一化的架构技术债本金指数(ATDI)。
- 采用归一化折损累计增益(NDCG)为0.97,评估模型在严重程度估算上的排序性能。
- 通过一项包含16名来自开源和工业项目的从业者的案例研究,验证整个流程。
- 通过分析特征重要性确保预测透明性,避免依赖黑箱或有偏的输入。
实验结果
研究问题
- RQ1机器学习模型能否准确地根据可维护性和可演化性影响,对架构异味实例的严重程度进行排序?
- RQ2从业者的评估与所提出的ATDI模型生成的技术债本金估算在多大程度上一致?
- RQ3结合基于机器学习的严重程度估算与静态代码分析,如何提升架构技术债测量的准确性与透明度?
- RQ4当前方法在低严重程度或小规模异味实例方面存在哪些局限性?
- RQ5如何扩展该模型以支持更多编程语言,并纳入利息成本估算(维护负担)?
主要发现
- 机器学习模型实现了0.97的归一化折损累计增益(NDCG),表明在排序架构异味严重程度方面具有高准确性。
- 在从业者验证研究中,71%的反馈确认估算的技术债本金与实际重构工作量高度吻合。
- 该方法在大规模债务估算中表现出高精度,但小规模估算的一致性较差,表明仍有改进空间。
- 从业者认为该方法具有可操作性和透明性,尤其得益于机器学习预测的可解释性以及与代码规模的清晰映射。
- 研究识别出若干关键改进方向,包括建模类层次结构的影响,以及扩展对C/C++系统的支持。
- 受访者强调还需估算利息(维护成本),这为未来工作提示了整合变更指标的必要性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。