一句话:通过大规模实证研究揭示仅按功能正确性评分的编程作业存在显著运行时间差异,并归纳低效代码模式。
论文关注编程课程中作业主要按功能正确性评估、而运行效率鲜少被评价的缺口。作者对 250 份仅以功能正确性为评价标准的编程作业进行大规模实证研究,测量其执行时间、分析学生实现间的时间效率差异,并从代码中归纳出 27 种反复出现的低效代码模式。结果显示,这些作业在运行时间上差异显著,且多数低效模式可被 PMD、IntelliJ IDEA 或 ChatGPT 等自动化工具优化。研究进一步为教师在整个课程体系中组织与融入代码性能主题提供了可操作建议。
Practical programming assignments are critical parts of programming courses in Computer Science education. Students are expected to translate programming concepts learned from lectures into executable implementations that solve the tasks outlined in the assignments. These implementations are primarily assessed based on their functional correctness, ensuring that students' code produces the expected output when provided with specific inputs. However, functional correctness is not the only metric that evaluates the quality of programs. Runtime efficiency is a metric that is less frequently evaluated in programming courses, yet it holds significant importance in the context of professional software development. To investigate this gap and its potential ramifications, we conducted a large-scale empirical study on the time efficiency of 250 programming assignments that are evaluated solely on functional correctness. The results demonstrate that students' programming assignments exhibit significant variance in terms of execution time. We further identified 27 recurring inefficient code patterns from these assignments, and observed that most of the inefficient patterns can be optimized by automated tools such as PMD, IntelliJ IDEA and ChatGPT. Our findings provide actionable guidelines for educators to enhance the organization and integration of code performance topics throughout the programming course curriculum.