{"id":{"repo_id":"embry-riddle","oai_identifier":"oai:commons.erau.edu:edt-1917"},"canonical_url":"https://search.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":"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.","abstract_html":"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.","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":null,"date_issued":"","date_published":null,"updated_at":"2026-11-18T19:27:21Z","subjects":["software engineering","design by contract","large language models","code generation"],"languages":[],"rights":[],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://commons.erau.edu/edt/927","outbound_label":"Repository record","outbound_source":"dc:identifier","record_url":"https://commons.erau.edu/edt/927","record_label":"Repository record","record_kind":"record","record_source":"dc:identifier","download_url":null,"download_label":null,"download_source":null,"access_status":null,"embargo_until":null,"access_note":null},"source_record":{"url":"https://commons.erau.edu/do/oai/?verb=GetRecord&metadataPrefix=oai_etdms&identifier=oai%3Acommons.erau.edu%3Aedt-1917","prefix":"oai_etdms"},"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":"dc:date.created","label":"Dc Date Created","values":["2025-04-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":["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."]},{"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:date.created":["2025-04-01T07:00:00Z"],"dc:description.abstract":["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."],"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-11-18T19:27:21Z"}