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.


翻译:在软件项目中遵循代码风格规范对于维持整体代码质量至关重要。遵守这些规范可提高代码的可维护性、可理解性与可扩展性。此外,在软件开发过程中遵循最佳实践能够提升性能并降低错误发生概率。本文通过分析GITHUB上1,036个热门JAVA开源项目,研究代码风格与编程实践的采纳机制及时序演进规律,考察其普及程度与最常见违规类型。同时,我们按月追踪活跃代码库子集,监测编码标准遵循度的时序变化。研究发现各代码库普遍存在违规现象,其中Javadoc规范与命名规范违规最为常见。我们还发现大量违反GOOGLE Java风格指南的案例多集中于现代静态分析工具易忽略的类别。此外,宣称遵循代码风格规范的代码库在代码风格与最佳实践的整体遵循度上略胜一筹。研究结果为理解代码风格与编程实践的采纳机制提供了重要见解,指明了开源开发社区亟待改进的关键领域。本文进一步总结了核心经验教训,并为提升JAVA项目代码质量提出了未来发展方向。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
37+阅读 · 2025年7月14日
【2020新书】如何认真写好的代码和软件,318页pdf
专知会员服务
66+阅读 · 2020年3月26日
《代码整洁之道》:5大基本要点
专知会员服务
50+阅读 · 2020年3月3日
【书籍推荐】简洁的Python编程(Clean Python),附274页pdf
专知会员服务
183+阅读 · 2020年1月1日
计算机视觉最佳实践、代码示例和相关文档
专知会员服务
20+阅读 · 2019年10月9日
【Code】GraphSAGE 源码解析
AINLP
31+阅读 · 2020年6月22日
各编程领域最好的入门书籍
程序猿
28+阅读 · 2018年7月29日
《软件方法》1-8章全部自测题更新内容
UMLChina
11+阅读 · 2018年3月26日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员