シーカー:中間言語エージェントフレームワークを用いた例外安全なコード生成に向けて
Seeker: Towards Exception Safety Code Generation with Intermediate Language Agents Framework
December 16, 2024
著者: Xuanming Zhang, Yuxuan Chen, Yiming Zheng, Zhexin Zhang, Yuan Yuan, Minlie Huang
cs.AI
要旨
現実のソフトウェア開発において、不適切または不足の例外処理はコードの堅牢性と信頼性に深刻な影響を与える可能性があります。例外処理メカニズムは、開発者が高い基準に従って例外を検出し、キャプチャし、管理することを要求しますが、多くの開発者がこれらのタスクに苦労しており、脆弱なコードを生み出しています。この問題はオープンソースプロジェクトに特に顕著であり、ソフトウェアエコシステム全体の品質に影響を与えています。この課題に対処するために、私たちは大規模言語モデル(LLMs)の活用を通じてコードの例外処理を改善することを探求しています。徹底的な分析を通じて、以下の3つの主要な問題を特定しました:脆弱なコードの感知の不十分、例外ブロックの不正確なキャプチャ、および歪んだ処理解決策。これらの問題は現実のリポジトリ全体に広く存在しており、堅牢な例外処理の実践がしばしば見落とされたり誤処理されたりしていることを示しています。これに対応して、例外処理のためのエキスパート開発者の戦略に着想を得たマルチエージェントフレームワークであるSeekerを提案します。Seekerは、スキャナー、ディテクター、プレデター、ランカー、ハンドラーというエージェントを使用し、LLMsが例外をより効果的に検出、キャプチャ、解決するのを支援します。私たちの研究は、実際の開発シナリオにおける例外処理の実践を向上させるためにLLMsを活用する初の体系的研究であり、今後のコード信頼性の向上に向けた貴重な示唆を提供しています。
English
In real world software development, improper or missing exception handling
can severely impact the robustness and reliability of code. Exception handling
mechanisms require developers to detect, capture, and manage exceptions
according to high standards, but many developers struggle with these tasks,
leading to fragile code. This problem is particularly evident in open-source
projects and impacts the overall quality of the software ecosystem. To address
this challenge, we explore the use of large language models (LLMs) to improve
exception handling in code. Through extensive analysis, we identify three key
issues: Insensitive Detection of Fragile Code, Inaccurate Capture of Exception
Block, and Distorted Handling Solution. These problems are widespread across
real world repositories, suggesting that robust exception handling practices
are often overlooked or mishandled. In response, we propose Seeker, a
multi-agent framework inspired by expert developer strategies for exception
handling. Seeker uses agents: Scanner, Detector, Predator, Ranker, and Handler
to assist LLMs in detecting, capturing, and resolving exceptions more
effectively. Our work is the first systematic study on leveraging LLMs to
enhance exception handling practices in real development scenarios, providing
valuable insights for future improvements in code reliability.Summary
AI-Generated Summary