Checkstyle+:通过将Linter与大型语言模型结合使用来减少技术债务
Checkstyle+: Reducing Technical Debt Through The Use of Linters with LLMs
AI总结:
本文提出Checkstyle+,结合大型语言模型与Checkstyle,用于检测传统静态分析难以识别的语义细微风格违规,在380个Java文件样本上优于标准Checkstyle。
摘要:
良好的代码风格能提高程序的可读性、可维护性和协作性,是软件质量不可或缺的组成部分。然而,开发者在遵循风格规则时常常偷工减料,导致linter等工具在专业软件开发项目中被广泛采用。像Checkstyle这样的传统linter使用刚性的、基于规则的机制运行,能有效检测许多表面级别的违规。然而,在大多数编程语言中,有一类风格规则需要对代码有更细致的理解,超出了此类静态分析的范围。在本文中,我们提出了Checkstyle+,一种混合方法,它用大型语言模型(LLM)能力增强Checkstyle,以识别那些逃避传统基于规则分析的风格违规。Checkstyle+在380个Java代码文件的样本上进行了评估,这些样本来自从被接受的Codeforces提交中获取的30,800个真实世界Java程序的更广泛数据集。结果表明,在检测语义细致规则的违规方面,Checkstyle+比标准Checkstyle表现出更优越的性能。
英文摘要:
Good code style improves program readability, maintainability, and collaboration, and is an integral component of software quality. Developers, however, often cut corners when following style rules, leading to the wide adoption of tools such as linters in professional software development projects. Traditional linters like Checkstyle operate using rigid, rule-based mechanisms that effectively detect many surface-level violations. However, in most programming languages, there is a subset of style rules that require a more nuanced understanding of code, and fall outside the scope of such static analysis. In this paper, we propose Checkstyle+, a hybrid approach that augments Checkstyle with large language model (LLM) capabilities, to identify style violations that elude the conventional rule-based analysis. Checkstyle+ is evaluated on a sample of 380 Java code files, drawn from a broader dataset of 30,800 real-world Java programs sourced from accepted Codeforces submissions. The results show that Checkstyle+ achieves superior performance over standard Checkstyle in detecting violations of the semantically nuanced rules.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。