MLinter:从示例中学习编码实践-梦想还是现实?
MLinter: Learning Coding Practices from Examples-Dream or Reality?
摘要:
编码实践越来越多地被软件公司使用。它们的使用促进了一致性、可读性和可维护性,这有助于软件质量。编码实践最初是由通用的linter执行的,但公司现在倾向于设计和采用自己的公司特定的实践。然而,这些特定于公司的实践通常不是自动化的,这使得确保它们被开发人员共享和使用变得非常困难。将这些实践转换为linter规则是一项复杂的任务,需要广泛的静态分析和语言工程专业知识。在本文中,我们试图回答以下问题:编码的做法可以自动学习的例子手动标记的开发人员?我们使用CodeBERT(一种最先进的机器学习方法)进行可行性研究,以学习linter规则。我们的研究结果表明,尽管在平衡的合成数据集上进行评估时,所得分类器达到了高精度和召回分数,但它们在现实世界中的不平衡代码库上的应用,在保持出色的召回率的同时,精度严重下降,阻碍了它们的可用性。
英文摘要:
Coding practices are increasingly used by software companies. Their use promotes consistency, readability, and maintainability, which contribute to software quality. Coding practices were initially enforced by general-purpose linters, but companies now tend to design and adopt their own company-specific practices. However, these company-specific practices are often not automated, making it challenging to ensure they are shared and used by developers. Converting these practices into linter rules is a complex task that requires extensive static analysis and language engineering expertise. In this paper, we seek to answer the following question: can coding practices be learned automatically from examples manually tagged by developers? We conduct a feasibility study using CodeBERT, a state-of-the-art machine learning approach, to learn linter rules. Our results show that, although the resulting classifiers reach high precision and recall scores when evaluated on balanced synthetic datasets, their application on real-world, unbalanced codebases, while maintaining excellent recall, suffers from a severe drop in precision that hinders their usability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。