JDExtractor: an automated approach for efficient extraction of defect-related methods in Java projects - Liu, Tianyang; Ye, Jiawei; Ji, Weixing (Automated software engineering, 2026)
High-quality repositories containing real-world defects are essential for developing defect-related algorithms. Although plenty of defect repositories exist, they often fail to capture the context of inter-procedural defects, which include all methods in the propagation path from the defect-source method to the defect-triggering method. This limitation is particularly critical for the Null Pointer Exception (NPE), a common defect that often propagates across multiple methods in Java systems. To address this problem, we propose a novel and automatic approach, called JDExtractor , to extract defect-related methods from real applications. The main challenge is how to identify all defect-related methods efficiently and accurately. JDExtractor tackles this challenge by constructing a method-level data graph using the principle of Java type compatibility and simplifying the data graph using filtering criteria. Data flow analysis helps construct a coarse-grained method-level data graph, which reflects the potential patterns of inter-procedural data interaction, thereby ensuring analysis efficiency. Afterward, filtering analysis simplifies the data graph based on the propagation properties of inter-procedural defects, thus ensuring analysis accuracy. Evaluation results suggest that both the static slicing tool WALA and the dynamic slicing tool Slicer4J yield several false positives, whereas JDExtractor successfully extracts defect-related methods and defect propagation paths with fewer false positives in a short time. Moreover, JDExtractor has been applied to open source projects on GitHub, ultimately extracting defect-related methods for 67 defects from 319 compiled open source applications.