Empowering Educators: Towards a GPT-Based Approach to Automate Unit Test Generation

Assessing code automatically is a significant challenge in distance learning, especially in large online courses with limited teaching resources. Although auto-gradable programming exercises address scalability, creating enough high-quality exer-cises-particularly designing comprehensive unit tests-remains time-consuming and labor-intensive. To address this, we introduce a GPT-based feature that automates unit test generation for customized exercises. With a single button press, instructors can adapt existing exercises to meet specific teaching objectives while preserving auto-gradability. The AI-generated tests comprehensively cover potential edge cases that might otherwise be overlooked, thus reducing the need for manual oversight. An empirical evaluation with eight experienced educators showed these tests to be both thorough and time-efficient, achieving an average System Usability Scale (SUS) score of 81.79. Participants, who reported intermediate to advanced proficiency in designing manual unit tests and intermediate familiarity with AI tools like ChatGPT, praised the feature's ease of use and seamless workflow integration. Their combined expertise in teaching, coding, and AI-informed course development allowed them to provide insightful feedback on the practicality and reliability of our GPT-based solution. Our study includes a small participant pool (<tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathrm{n}=8$</tex>) and primarily focuses on Python, a language wellsupported by GPT. Future research will involve expanding the participant group, exploring additional programming languages, and assessing long-term tool performance and adaptability in diverse educational contexts. By harnessing GPT's language modeling capabilities, our approach addresses the gap between generic, limited-coverage test generation and the need for robust, domain-specific tests. Early reports from participants suggest that specialized exercises-such as those involving advanced data structures-can also benefit from automated unit test generation, though further evaluation is necessary. By leveraging artificial intelligence, this method streamlines exercise customization and enhances the overall usability and effectiveness of programming education tools. It has the potential to revolutionize auto-gradable exercise creation at scale, empowering educators to deliver high-quality instruction while tackling both the technical and pedagogical challenges in programming education.

Authors

Institutions

Publication Details

Published
2025-04-22
DOI
https://doi.org/10.1109/educon62633.2025.11016616
Citations
1
Primary Topic
Teaching and Learning Programming
Type
article
Field-Weighted Citation Impact
1.69
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Empowering Educators: Towards a GPT-Based Approach to Automate Unit Test Generation

Mohamed Elhayany, Christoph Meinel
1 citations
Teaching and Learning Programming
1.69
article

Empowering Educators: Towards a GPT-Based Approach to Automate Unit Test Generation

Mohamed Elhayany, Christoph Meinel
article en
1 citations

Abstract

Assessing code automatically is a significant challenge in distance learning, especially in large online courses with limited teaching resources. Although auto-gradable programming exercises address scalability, creating enough high-quality exer-cises-particularly designing comprehensive unit tests-remains time-consuming and labor-intensive. To address this, we introduce a GPT-based feature that automates unit test generation for customized exercises. With a single button press, instructors can adapt existing exercises to meet specific teaching objectives while preserving auto-gradability. The AI-generated tests comprehensively cover potential edge cases that might otherwise be overlooked, thus reducing the need for manual oversight. An empirical evaluation with eight experienced educators showed these tests to be both thorough and time-efficient, achieving an average System Usability Scale (SUS) score of 81.79. Participants, who reported intermediate to advanced proficiency in designing manual unit tests and intermediate familiarity with AI tools like ChatGPT, praised the feature's ease of use and seamless workflow integration. Their combined expertise in teaching, coding, and AI-informed course development allowed them to provide insightful feedback on the practicality and reliability of our GPT-based solution. Our study includes a small participant pool (<tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathrm{n}=8$</tex>) and primarily focuses on Python, a language wellsupported by GPT. Future research will involve expanding the participant group, exploring additional programming languages, and assessing long-term tool performance and adaptability in diverse educational contexts. By harnessing GPT's language modeling capabilities, our approach addresses the gap between generic, limited-coverage test generation and the need for robust, domain-specific tests. Early reports from participants suggest that specialized exercises-such as those involving advanced data structures-can also benefit from automated unit test generation, though further evaluation is necessary. By leveraging artificial intelligence, this method streamlines exercise customization and enhances the overall usability and effectiveness of programming education tools. It has the potential to revolutionize auto-gradable exercise creation at scale, empowering educators to deliver high-quality instruction while tackling both the technical and pedagogical challenges in programming education.

Hasso Plattner Institute (DE)
Quality Education
Openalex Percentile: Top 13%
Teaching and Learning Programming
1.69
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.