分析学生用自然语言写注释指导AI生成代码的行为模式。
Commenting with Copilot: A Taxonomy and Multi-Year Analysis of Student Code-Generation Specifications
- 构建三维度注释分类体系:类型、代码抽象层级、代码结构。
- 多数学生写的是描述功能的‘What’注释,复杂逻辑转向‘How’说明。
- 学生更关注验证生成代码正确性,而非反复修改注释。
随着AI编程工具融入开发环境,学生越来越多地通过自然语言描述期望行为,并依赖工具生成代码,编程重点从编写代码转向规范说明。然而,关于学生在AI辅助编程任务中所写的注释作为规格说明的情况仍知之甚少。本研究分析了四年内来自本科生编程作业和反思的提交数据,这些任务要求学生撰写注释以指导代码生成,并基于测试反馈优化解决方案。我们提出一个涵盖三个维度的注释分类体系:注释类型、代码表达层次与代码构造。通过自动化分类方法,研究了这些维度在不同尝试中的变化,以及学生在反思中如何描述该过程。结果显示,学生主要撰写自然语言形式的‘What’类注释,对于更程序化的构造则更多采用‘How’类说明;同时,学生更关注验证生成代码的正确性,而非反复重写注释。
原文摘要 · Abstract (English)
As AI code tools become integrated into programming environments, students increasingly describe intended behavior in natural language and rely on these tools to generate code, shifting emphasis from code writing to specification. Yet little is known about the comments students write as specifications in AI-assisted programming tasks. We analyze a four-year dataset of undergraduate programming submissions and reflections from tasks in which students wrote comments to guide code generation and refined solutions using test-case feedback. We introduce a taxonomy spanning three dimensions: comment type, code expression level, and code construct. Using automated classification, we examine how these dimensions vary across attempts and how students describe the process in their reflections. Our findings show that students mostly wrote natural-language What comments, shifted toward How comments for more procedural constructs, and focused more on verifying generated code than on repeatedly rewriting comments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。