METAMON: Finding Inconsistencies between Program Documentation and Behavior using Metamorphic LLM Queries
Hyeonseok Lee, Gabin An, Shin Yoo

TL;DR
METAMON is a novel approach that leverages test generation and large language models to automatically detect inconsistencies between code documentation and actual program behavior, improving code understanding and quality.
Contribution
This paper introduces METAMON, combining search-based test generation with LLM reasoning to automatically identify documentation-code inconsistencies, a task previously reliant on manual effort.
Findings
Achieves 0.72 precision in classifying inconsistencies
Recalls 0.48 of actual inconsistencies
Evaluated on 9,482 code-documentation pairs from open-source projects
Abstract
Code documentation can, if written precisely, help developers better understand the code they accompany. However, unlike code, code documentation cannot be automatically verified via execution, potentially leading to inconsistencies between documentation and the actual behavior. While such inconsistencies can be harmful for the developer's understanding of the code, checking and finding them remains a costly task due to the involvement of human engineers. This paper proposes METAMON, which uses an existing search-based test generation technique to capture the current program behavior in the form of test cases, and subsequently uses LLM-based code reasoning to identify the generated regression test oracles that are not consistent with the program specifications in the documentation. METAMON is supported in this task by metamorphic testing and self-consistency. An empirical evaluation…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsScientific Computing and Data Management · Data Quality and Management · Semantic Web and Ontologies
