Unit Test Case Generation using Large Language Models for Students in Computer Programming | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Unit Test Case Generation using Large Language Models for Students in Computer Programming Md. Jahidul Islam, Hussain Md. Sahariyar, Nova Ahmed This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8822709/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Software testing is an essential part of the software development life cycle that helps detect some of the potential defects automatically and lower maintenance costs. Automated test case generation can offer significant benefits in terms of efficiency, coverage, and help in assessing the quality of the student-written software implementations. It automates time-consuming manual test case generation for students, specifically those who are new problem solvers, and can help them to focus on more exploratory tasks, also generating more consistent and reliable test cases than manual approaches. Due to these promising opportunities for students, we require an automated method for generating test cases. Therefore, in this research, we introduce TestT5, an LLM-based approach using the openly available methods2test dataset extracted from a vast collection of Java software repositories, designed to generate unit test cases automatically and demonstrate that it can assist students in unit testing on their programming assignments, projects, and can also assess the quality of their implementations. We also gathered feedback from professionals and conducted a human evaluation to assess the generated unit test cases in terms of understandability, readability, and testing effectiveness, along with future research opportunities. Computer programming Test Case Generation LLMs Unit Testing Software Testing Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8822709","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":591541360,"identity":"4d025fc5-01ba-4bbb-8b70-b23f63fce81d","order_by":0,"name":"Md. Jahidul Islam","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA5klEQVRIie2PsQrCMBCGLwTOJdg1Ra1PIFQC1UlfRRGc3ISiCFoRfKTMgUK7iLPgUhXcHRTdTKHgFjsK5iPDf3Aflx/AYvlJFMIAudcEIJkeWbWk0hXtCKifK1jijN7B2TBSgLwYzbTW8TXLQi5IRJP5fdKrI9DT+WBQApV0/MGeexXA8bEhR/pjKMTEqKiAD7f5FRYcXUm1wrBmVtJHruguzmPqylUZZRcUCkNyk3EpJeS6i2hvUNSITBnSb10OqXSf4dJrVjan20su+o4OF5MCXBWB6seKYMaJPpk8v21bLBbLX/IGB9lGU/4Liy8AAAAASUVORK5CYII=","orcid":"","institution":"North South University","correspondingAuthor":true,"prefix":"","firstName":"Md.","middleName":"Jahidul","lastName":"Islam","suffix":""},{"id":591541361,"identity":"1dc3cab5-1fde-427e-a452-9dc90d0bf852","order_by":1,"name":"Hussain Md. Sahariyar","email":"","orcid":"","institution":"North South University","correspondingAuthor":false,"prefix":"","firstName":"Hussain","middleName":"Md.","lastName":"Sahar","suffix":"Md."},{"id":591541362,"identity":"e0fc1e65-816e-4bba-a954-226c1985f097","order_by":2,"name":"Nova Ahmed","email":"","orcid":"","institution":"North South University","correspondingAuthor":false,"prefix":"","firstName":"Nova","middleName":"","lastName":"Ahmed","suffix":""}],"badges":[],"createdAt":"2026-02-08 15:38:12","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8822709/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8822709/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":105751667,"identity":"e56eeb98-bfd9-4bd0-a845-b84ee4c56f2f","added_by":"auto","created_at":"2026-03-30 15:35:59","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1204109,"visible":true,"origin":"","legend":"","description":"","filename":"UnitTestCaseGenerationusingLargeLanguageModelsforStudentsinComputerProgramming.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8822709/v1_covered_a7761430-1046-4fd6-b461-d7a2879d721c.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Unit Test Case Generation using Large Language Models for Students in Computer Programming","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Computer programming, Test Case Generation, LLMs, Unit Testing, Software Testing","lastPublishedDoi":"10.21203/rs.3.rs-8822709/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8822709/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eSoftware testing is an essential part of the software development life cycle that helps detect some of the potential defects automatically and lower maintenance costs. Automated test case generation can offer significant benefits in terms of efficiency, coverage, and help in assessing the quality of the student-written software implementations. It automates time-consuming manual test case generation for students, specifically those who are new problem solvers, and can help them to focus on more exploratory tasks, also generating more consistent and reliable test cases than manual approaches. Due to these promising opportunities for students, we require an automated method for generating test cases. Therefore, in this research, we introduce TestT5, an LLM-based approach using the openly available methods2test dataset extracted from a vast collection of Java software repositories, designed to generate unit test cases automatically and demonstrate that it can assist students in unit testing on their programming assignments, projects, and can also assess the quality of their implementations. We also gathered feedback from professionals and conducted a human evaluation to assess the generated unit test cases in terms of understandability, readability, and testing effectiveness, along with future research opportunities.\u003c/p\u003e","manuscriptTitle":"Unit Test Case Generation using Large Language Models for Students in Computer Programming","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-02-20 06:11:49","doi":"10.21203/rs.3.rs-8822709/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"08b68df9-96ae-49f1-b91b-d5a27ec16b03","owner":[],"postedDate":"February 20th, 2026","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-02-21T02:09:02+00:00","versionOfRecord":[],"versionCreatedAt":"2026-02-20 06:11:49","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8822709","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8822709","identity":"rs-8822709","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.