{"id":{"repo_id":"embry-riddle","oai_identifier":"oai:commons.erau.edu:edt-1917"},"canonical_url":"https://search.dev.ndltd.org/etd/embry-riddle/oai:commons.erau.edu:edt-1917","repository":{"repo_id":"embry-riddle","name":"Embry Riddle Aeronautical University","base_url":"https://commons.erau.edu/do/oai/"},"display":{"title":"A Study of Preconditions and Postconditions as Design Constraints for LLM Code Generation","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>","abstract_html":"&lt;p&gt;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.&lt;/p&gt;","abstract_has_math":false,"creators":["Newcomb, Luke"],"institution":null,"degree_name":"Master of Software Engineering","degree_level":"Thesis - Open Access","degree_discipline":"Electrical Engineering and Computer Science","degree_department":null,"school":null,"contributors":[],"advisors":[],"committee_chairs":[],"committee_members":[],"year":2025,"date_issued":"2025-04-01T07:00:00Z","date_published":"2025-04-01T07:00:00Z","updated_at":"2026-07-27T19:26:22Z","subjects":["software engineering","design by contract","large language models","code generation"],"languages":[],"rights":[],"rights_urls":[],"identifier_entries":[]},"links":{"outbound_url":"https://commons.erau.edu/edt/927","outbound_label":"Repository record","outbound_source":"dc:identifier"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:creator","label":"Author","values":["Newcomb, Luke"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.available","label":"Dc Date Available","values":["2025-10-01T07:00:00Z"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Electrical Engineering and Computer Science"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Thesis - Open Access"]},{"key":"thesis:degree_name","label":"Degree Name","values":["Master of Software Engineering"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["software engineering","design by contract","large language models","code generation"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier","label":"Identifier","values":["https://commons.erau.edu/edt/927"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["<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>"]},{"key":"dc:title","label":"Title","values":["A Study of Preconditions and Postconditions as Design Constraints for LLM Code Generation"]}]}],"canonical_facts":{"dc:creator":["Newcomb, Luke"],"dc:date.available":["2025-10-01T07:00:00Z"],"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>"],"dc:identifier":["https://commons.erau.edu/edt/927"],"dc:subject":["software engineering","design by contract","large language models","code generation"],"dc:title":["A Study of Preconditions and Postconditions as Design Constraints for LLM Code Generation"],"thesis:degree_discipline":["Electrical Engineering and Computer Science"],"thesis:degree_level":["Thesis - Open Access"],"thesis:degree_name":["Master of Software Engineering"]},"updated_at":"2026-07-27T19:26:22Z"}