Back to results

Embry Riddle Aeronautical University

A Study of Preconditions and Postconditions as Design Constraints for LLM Code Generation

Abstract

dc:description.abstract

<p>Large Language Models (LLMs) have significantly advanced automated code generation, but current methods predominantly rely on natural language descriptions. This approach encounters challenges when handling complex, class-level software generation tasks due to inherent ambiguity and under-specification. Few studies have investigated how more formal software engineering constraints, such as explicit preconditions and postconditions, influence class-level generation tasks. This work addresses this gap through a structured evaluation of six state-of-the-art LLMs generating software implementations from systematically designed class-level specifications. Results demonstrate that incorporating explicit design constraints significantly boosts initial generation accuracy (measured via the pass@k metric), particularly in Python but also in Java and C++. Models with fewer parameters or weaker initial performance saw especially pronounced benefits. These findings suggest integrating structured software engineering constraints into LLM-based code generation workflows to enhance accuracy and maintainability in automated software projects.</p>

Degree

thesis:*
Name thesis:degree_name
Master of Software Engineering
Level thesis:degree_level
Thesis - Open Access
Discipline thesis:degree_discipline
Electrical Engineering and Computer Science
Year dc:date.available
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Newcomb, Luke

Subjects

dc:subject × 4

Identifiers

dc:identifier.*
Repository record dc:identifier
https://commons.erau.edu/edt/927
OAI identifier oai:identifier
oai:commons.erau.edu:edt-1917

Chain of custody

source
Harvested from
Embry Riddle Aeronautical University
Base URL
commons.erau.edu/do/oai/
Last updated
2026-07-27
Source record
OAI-PMH GetRecord
citation

Newcomb, Luke. A Study of Preconditions and Postconditions as Design Constraints for LLM Code Generation. Thesis - Open Access thesis, 2025. https://commons.erau.edu/edt/927