Large Language Models (LLMs) are one of the most promising developments in the field of artificial intelligence, and the software engineering community has readily noticed their potential role in the software development life-cycle. Developers routinely ask LLMs to generate code snippets, increasing productivity but also potentially introducing ownership, privacy, correctness, and security issues. Previous work highlighted how code generated by mainstream commercial LLMs is often not safe, containing vulnerabilities, bugs, and code smells. In this paper, we present a framework that leverages testing and static analysis to assess the quality, and guide the self-improvement, of code generated by general-purpose, open-source LLMs.
First, we ask LLMs to generate C code to solve a number of programming tasks. Then we employ ground-truth tests to assess the (in)correctness of the generated code, and a static analysis tool to detect potential safety vulnerabilities. Next, we assess the models ability to evaluate the generated code, by asking them to detect errors and vulnerabilities. Finally, we test the models ability to fix the generated code, providing the reports produced during the static analysis and incorrectness evaluation phases as feedback.
Our results show that models often produce incorrect code, and that the generated code can include safety issues. Moreover, they perform very poorly at detecting either issue. On the positive side, we observe a substantial ability to fix flawed code when provided with information about failed tests or potential vulnerabilities, indicating a promising avenue for improving the safety of LLM-based code generation tools.
Aesthetic Assessment of Chinese Handwritings Based on Vision Language Models
The Open University of China(中国开放大学);Engineering Research Center of Integration and Application of Digital Learning Technology, Ministry of Education(数字化学习技术集成与应用教育部工程研究中心);OUC-online(国开在线)
A Comparison of Inquiry-Based Conceptual Feedback vs. Traditional Detailed Feedback Mechanisms in Software Testing Education: An Empirical Investigation
More than a Judge: An Empirical Study of Agent-Human Interaction in Crowdsourced Testing Assessment
State Key Laboratory for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);Laboratory of Data Intelligence and Interdisciplinary Innovation, Nanjing University(南京大学数据智能与交叉创新实验室);Technical University of Munich(慕尼黑工业大学)
Open-Source Autonomous Driving System Analysis and Multi-Disciplinary Hardware-in-the-Loop Research Paradigm with Reinforcement-Learning Testing and Large Language Models
School of Cyberspace Science and Technology, Beijing Jiaotong University(北京交通大学网络空间科学与技术学院);School of Information Engineering, Chang’an University(长安大学信息工程学院)