arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2202.01322cs.SE
收藏

如何改进软件分析的深度学习(代码气味检测的案例研究)

How to Improve Deep Learning for Software Analytics (a case study with code smell detection)

Rahul Yedida, Tim Menzies

摘要:

为了减少技术债务并使代码更易于维护,能够警告程序员代码气味是很重要的。最先进的代码小型检测器使用深度学习器,而没有在该技术中探索替代方案。软件分析和深度学习的一个有前途的替代方案是GHOST(来自TSE'21),它依赖于前馈神经网络的超参数优化和一种新的过采样技术来处理类不平衡。之前的研究从TSE'21提出了这种新的“模糊采样”是有点有限的,因为该方法进行了测试的缺陷预测,但没有别的。与缺陷预测一样,代码气味检测数据集也具有类不平衡性(这激发了“模糊采样”)。因此,在这项工作中,我们测试,如果模糊采样是有用的代码气味检测。本文的结果表明,我们可以达到比国家的最先进的结果代码气味检测模糊过采样。例如,对于“特征嫉妒”,我们能够在所有数据集上实现99+\%的AUC,并且在8/10的数据集上实现“错位类”。虽然我们的具体结果涉及代码气味检测,但它们确实为其他类型的分析提供了其他经验教训。举例来说:(a)在尝试复杂学习器之前尝试更好的预处理(b)将更简单的学习器作为软件分析的基线(c)尝试“模糊采样”作为这样的基线。

英文摘要:

To reduce technical debt and make code more maintainable, it is important to be able to warn programmers about code smells. State-of-the-art code small detectors use deep learners, without much exploration of alternatives within that technology. One promising alternative for software analytics and deep learning is GHOST (from TSE'21) that relies on a combination of hyper-parameter optimization of feedforward neural networks and a novel oversampling technique to deal with class imbalance. The prior study from TSE'21 proposing this novel "fuzzy sampling" was somewhat limited in that the method was tested on defect prediction, but nothing else. Like defect prediction, code smell detection datasets have a class imbalance (which motivated "fuzzy sampling"). Hence, in this work we test if fuzzy sampling is useful for code smell detection. The results of this paper show that we can achieve better than state-of-the-art results on code smell detection with fuzzy oversampling. For example, for "feature envy", we were able to achieve 99+\% AUC across all our datasets, and on 8/10 datasets for "misplaced class". While our specific results refer to code smell detection, they do suggest other lessons for other kinds of analytics. For example: (a) try better preprocessing before trying complex learners (b) include simpler learners as a baseline in software analytics (c) try "fuzzy sampling" as one such baseline.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑