Retrofitting Code Using LLMs to Support Exceptional Behavior
[Inżynieria oprogramowania] Autorzy: Linghan Zhong, Jiyang Zhang, Jayanth Srinivasa i 2 więcej
Exception Related Code (ERC), which includes throw statements, conditions (if statements) that guard those throw statements, and try/catch blocks, is an essential component of software systems, allowing developers to detect and handle exceptional states that deviate from the expected program behavior. However, manually writing ERC across large codebases is tedious. We propose a novel task: retrofitting existing code with ERC. Namely, given code (without ERC) and Exceptional Behavior Tests (EBTs) (e.g., check if method throws InvalidArgumentException if null is given as the value to the argument) we aim to automatically generate missing ERC, such that the given tests pass. We design and implement Exception Coder (EXCODER) that performs context engineering to help Large Language Models (LLMs) tackle this task. EXCODER integrates static and dynamic program analysis with LLMs by providing t…
- Kategoria arxiv
- cs.SE
- Kategoria
- Inżynieria oprogramowania