Static analysis tools are frequently used to scan the source code and detect deviations from the project coding guidelines. Given their importance, linters are often introduced to classrooms to educate students on how to detect and potentially avoid these code anti-patterns. However, little is known about their effectiveness in raising students awareness, given that these linters tend to generate a large number of false positives. To increase the awareness of potential coding issues that violate coding standards, in this paper, we aim to reflect on our experience with teaching the use of static analysis for the purpose of evaluating its effectiveness in helping students with respect to improving software quality. This paper discusses the results of an experiment in the classroom over a period of 3 academic semesters, involving 65 submissions that carried out code review activity of 690 rules using PMD. The results of the quantitative and qualitative analysis shows that the presence of a set of PMD quality issues influence the acceptance or rejection of the issues, design, and best practices-related categories that take a longer time to be resolved, and students acknowledge the potential of using static analysis tools during code review. Through this experiment, code review can turn into a vital part of the educational computing plan. We envision our findings enabling educators to support students with code review strategies to raise students awareness about static analysis tools and scaffolding their coding skills.
翻译:静态分析工具常被用于扫描源代码并检测项目编码规范偏差。鉴于其重要性,lint工具常被引入课堂,以教导学生检测并潜在规避这些代码反模式。然而,由于这些lint工具往往产生大量误报,其在提升学生意识方面的有效性尚不明确。为提高学生对违反编码标准的潜在代码问题的认知,本文旨在反思我们教授静态分析工具使用的教学经验,评估其在帮助学生改善软件质量方面的成效。本文讨论了为期3个学期的课堂实验结果,涉及65份提交的代码审查活动,共使用PMD工具审查690条规则。定量与定性分析结果表明:PMD质量问题的存在与否会影响问题的接受或拒绝率;设计及最佳实践相关类别的修复耗时更长;学生认可在代码审查过程中使用静态分析工具的潜力。通过本次实验,代码审查可成为教育计算计划的重要组成部分。我们期望研究结果能帮助教育工作者通过代码审查策略提升学生对静态分析工具的认知,并逐步强化其编程技能。