Skip to content
Open access

JDQuery: Query-Driven Defect Localization for Java Source Code Based on Code Knowledge Graphs

Aug 2026 · Electronics · 0 citations · 17 references

Abstract

Java is one of the most widely used object-oriented programming languages, making accurate and efficient defect localization essential for improving software quality and reliability. Conventional static analysis techniques primarily rely on predefined rules and localized syntactic matching, which may limit their ability to capture complex structural and semantic relationships among program entities. To address these limitations, this paper proposes JDQuery, a query-driven defect localization framework for Java source code based on a code knowledge graph. The framework parses Java source code into abstract syntax trees (ASTs), extracts software entities and their semantic relationships according to a formalized domain ontology, and constructs a unified code knowledge graph that integrates syntactic and semantic information. Based on the structural characteristics of Java defects, defect patterns are translated into Cypher queries, enabling flexible defect localization through graph pattern matching. Experiments on multiple open-source Java projects, including both injected defects and native real-world defects, demonstrate that JDQuery achieves precision values of 97.20% and 92.87% on two projects of different code sizes. A comparative evaluation with PMD further shows that JDQuery achieves substantially higher recall while maintaining comparable precision for the evaluated defects. Efficiency experiments demonstrate that JDQuery maintains millisecond-level query latency even when processing large-scale Java projects.

Read PDF

Similar papers

#artificial intelligence Preprint Sep 2026

FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generation

FeatLens builds a feature index that links natural-language feature descriptions to function-level code entities and dynamically constructs a task-specific seed graph from the feature index and applies semantic-structural graph reasoning with personalized PageRank to select a compact reasoning graph.

Xu-Tian Li, Bo Xiong, Yi-Feng Zhu et al. · 0 citations
Preprint Sep 2026

Detecting Argument-Swap Bugs Using Context-Enhanced Code Representations

Names of source code elements convey rich semantic information and have been widely used in software engineering tasks such as bug detection, code completion, type prediction, and code classification. Prior studies exploit lexical similarity between method arguments and formal parameter names to detect bugs caused by i...

Subrata Das, Ali Aman, Muhammad Asaduzzaman et al. · 0 citations
Open access Sep 2026

Ontology driven cross language design smell detection through semantic reasoning

Design smells are structural flaws that, if not detected early, can impair software quality and increase maintenance costs. Traditional detection approaches are language-specific and rely on low-level metrics, making them ineffective for heterogeneous, multilingual systems. This paper presents Ontology-Driven Design De...

Sabiyyah Sabir, Ghulam Rasool, Tariq Umer et al. · 0 citations
Open access Aug 2026

StructFix: a structure-aware reasoning framework for automated program repair with code property graphs

StructFix is proposed, a structure-aware APR framework that grounds masked patch generation in Code Property Graphs (CPGs), and explicitly coupling structural dependencies with masked generation improves repair effectiveness and enables transfer across datasets.

Mengtian Cui, Yang-Fan Liu, Zhibo Lu et al. · 0 citations
Conference Aug 2026

A Domain Specific Language for Pattern Specification and Automated Validation for Metamodel-Based Languages

Large collections of software artifacts often contain recurring structural patterns that can provide useful evidence for language understanding or empirical analysis, and provide requirements for language improvement of self-adaptable languages. OCL-based queries may specify such patterns but become more complex when p...

Ankita Vyas, Gunter Mussbacher · 0 citations
Book Open access Oct 2026

AnchorRepair: A Reference-Guided Dual-Agent Framework for Code Translation Repair

AnchorRepair is proposed, a dual-agent framework that treats the Java source as first-class diagnostic evidence that generalizes across LLM backends without modification and achieves repair coverage comparable to a general-purpose coding agent at less than half the cost.

Jia-Jun Sun, Yao-Cai Zhao, Feng-Jie Li et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.