Content area

Abstract

In this thesis, we present two approaches: one for generating header comments and the other for generating unit tests for test-driven development (TDD). These approaches share some similarities, including the use of LLMs and templating, but are used to achieve different goals. Documentation comments are essential for maintainability, yet they are often missing or outdated. This is true not only for programs in general-purpose languages, but also for artifacts in other languages often found in software projects such as scripts or configuration files. To address this problem, we present an approach that uses Large Language Models (LLMs) to generate header comments (aka, ‘block comments’ or ‘doc-strings’) for elements of different languages in different documentation formats. Given a file in some language and a description of elements in the file to be documented and the documentation format to be used, the approach generates header comments for all undocumented elements in the file that is guaranteed to conform to the documentation format. We describe a prototype implementation and its integration into an industrial development pipeline. Feedback from our industrial partner, an LLM-as-judge evaluation, and the participants of a user study involving a broad range of languages indicates that the approach is viable, able to produce sufficiently high-quality documentation in general, and holds potential for improving industrial documentation practices across different programming languages and teams.

TDD is a process that has been shown to reduce software defects, but is not always adopted in industrial software. TDD can also reduce the cost of debugging software by finding code defects earlier and can contribute to better software design. We also present an approach that uses generative AI to generate unit tests to facilitate TDD. Given a user goal, the approach generates formalized requirements in the form of a goal model, which is then used to generate unit tests in a test folder. We describe a current prototype implementation and show the results of our approach.

Details

1010268
Business indexing term
Title
Generation of Header Comments and Generation of Unit Tests for Test-Driven Development using Large Language Models
Number of pages
98
Publication year
2025
Degree date
2025
School code
0283
Source
MAI 87/6(E), Masters Abstracts International
ISBN
9798270206970
University/institution
Queen's University (Canada)
University location
Canada -- Ontario, CA
Degree
M.S.
Source type
Dissertation or Thesis
Language
English
Document type
Dissertation/Thesis
Dissertation/thesis number
32353687
ProQuest document ID
3283373943
Document URL
https://www.proquest.com/dissertations-theses/generation-header-comments-unit-tests-test-driven/docview/3283373943/se-2?accountid=208611
Copyright
Database copyright ProQuest LLC; ProQuest does not claim copyright in the individual underlying works.
Database
2 databases
  • ProQuest One Academic
  • ProQuest One Academic