An Empirical Study of the Code Generation of Safety-Critical Software Using LLMs

An Empirical Study of the Code Generation of Safety-Critical Software Using LLMs

26 January 2024 | Mingxing Liu, Junfeng Wang, Tao Lin, Quan Ma, Zhiyang Fang, Yanqun Wu
This paper explores the application of large language models (LLMs) in generating safety-critical software code, focusing on domains such as nuclear energy and the automotive industry. The study aims to address the challenges of improving development efficiency and ensuring software safety in these critical sectors. The authors conduct a case study using GPT-4 to generate code based on overall and specific requirements, proposing a novel prompt engineering method called Prompt-FDC. This method integrates basic functional requirements, domain feature generalization, and domain constraints to enhance code completeness, comment rate, compliance, readability, and maintainability. The results show that with appropriate prompt methods, LLMs can generate safety-critical software code that meets practical engineering application requirements. The study also introduces a new software development process and V-model lifecycle for safety-critical software, demonstrating the potential of LLMs in improving development efficiency and software safety.This paper explores the application of large language models (LLMs) in generating safety-critical software code, focusing on domains such as nuclear energy and the automotive industry. The study aims to address the challenges of improving development efficiency and ensuring software safety in these critical sectors. The authors conduct a case study using GPT-4 to generate code based on overall and specific requirements, proposing a novel prompt engineering method called Prompt-FDC. This method integrates basic functional requirements, domain feature generalization, and domain constraints to enhance code completeness, comment rate, compliance, readability, and maintainability. The results show that with appropriate prompt methods, LLMs can generate safety-critical software code that meets practical engineering application requirements. The study also introduces a new software development process and V-model lifecycle for safety-critical software, demonstrating the potential of LLMs in improving development efficiency and software safety.
Reach us at info@study.space