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

开源项目中代码风格和最佳编程实践的采用与演变

Adoption and Evolution of Code Style and Best Programming Practices in Open-Source Projects

University of Auckland(奥克兰大学)

Alvari Kupari, Nasser Giacaman, Valerio Terragni

AI总结:

本文研究了开源项目中代码风格和最佳实践的采用与演变,发现常见违规情况并提出改进方向。

摘要:

在软件项目中遵循代码风格规范对于维护整体代码质量至关重要。遵守这些规范可以提高可维护性、可理解性和可扩展性。此外,在软件开发过程中遵循最佳实践可以提高性能并减少错误的可能性。本文分析了1,036个在GITHUB上流行的JAVA开源项目,研究代码风格和编程实践是如何被采用和演变的,考察其普及程度以及最常见的违规情况。此外,我们还研究了一部分活跃仓库,每月跟踪对编码标准的遵守情况的变化。我们发现各仓库中普遍存在违规情况,其中Javadoc和命名违规是最常见的。我们还发现大量违反GOOGLE Java Style Guide的情况,这些情况常被现代静态分析工具所遗漏。此外,声称遵循代码风格实践的仓库在整体遵守代码风格和最佳实践方面略高。结果为代码风格和编程实践的采用提供了有价值的见解,突显了开源开发社区改进的关键领域。此外,本文还识别了重要的学习经验,并提出了未来改进JAVA项目代码质量的方向。

英文摘要:

Following code style conventions in software projects is essential for maintaining overall code quality. Adhering to these conventions improves maintainability, understandability, and extensibility. Additionally, following best practices during software development enhances performance and reduces the likelihood of errors. This paper analyzes 1,036 popular open-source JAVA projects on GITHUB to study how code style and programming practices are adopted and evolve over time, examining their prevalence and the most common violations. Additionally, we study a subset of active repositories on a monthly basis to track changes in adherence to coding standards over time. We found widespread violations across repositories, with Javadoc and Naming violations being the most common. We also found a significant number of violations of the GOOGLE Java Style Guide in categories often missed by modern static analysis tools. Furthermore, repositories claiming to follow code-style practices exhibited slightly higher overall adherence to code-style and best-practices. The results provide valuable insights into the adoption of code style and programming practices, highlighting key areas for improvement in the open-source development community. Furthermore, the paper identifies important lessons learned and suggests future directions for improving code quality in JAVA projects.

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

↑