Doc2Oracle: Investigating the Impact of Javadoc Comments on Test Oracle Generation

πŸ“… 2024-12-12
πŸ›οΈ arXiv.org
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This work investigates the impact of Javadoc comments on large language model (LLM)-driven Java test oracle generation (TOG). Addressing the questionβ€”β€œWhich Javadoc components most effectively improve oracle accuracy and defect detection capability?”—we propose the first systematic, quantitative framework. Our method employs multi-granular Javadoc parsing (e.g., functional descriptions, `@returns`, `@throws`, `@param`), context-aware importance scoring, and controlled prompt engineering, evaluated via attribution analysis on the Defects4J benchmark. Results show that Javadoc collectively improves TOG accuracy by 18.7% and defect detection rate by 23.4%; functional descriptions and exception declarations (`@throws`) contribute most significantly, whereas parameter documentation (`@param`) alone yields limited gains. This study is the first to empirically quantify the differential utility of Javadoc elements in LLM-based TOG, providing evidence-based guidance for test-oriented code documentation optimization.

Technology Category

Application Category

πŸ“ Abstract
Code documentation is a critical aspect of software development, serving as a bridge between human understanding and machine-readable code. Beyond assisting developers in understanding and maintaining code, documentation also plays a critical role in automating various software engineering tasks, such as test oracle generation (TOG). In Java, Javadoc comments provide structured, natural language documentation embedded directly in the source code, typically detailing functionality, usage, parameters, return values, and exceptions. While prior research has utilized Javadoc comments in test oracle generation (TOG), there has not been a thorough investigation into their impact when combined with other contextual information, nor into identifying the most relevant components for generating correct and strong test oracles, or understanding their role in detecting real bugs. In this study, we dive deep into investigating the impact of Javadoc comments on TOG.
Problem

Research questions and friction points this paper is trying to address.

Impact of Javadoc on LLM-based test oracle generation
Identifying relevant Javadoc components for accurate oracles
Role of Javadoc in detecting real software bugs
Innovation

Methods, ideas, or system contributions that make the work stand out.

Utilizes Javadoc comments for test oracle generation
Combines documentation with contextual information
Investigates impact on detecting real bugs
Soneya Binta Hossain
Soneya Binta Hossain
University of Virginia
Software EngineeringSoftware TestingProgram AnalysisAI4SELLM4SE
R
Raygan Taylor
Dillard University, USA
M
Matthew B. Dwyer
University of Virginia, USA