Skip to content
Preprint

Detecting Argument-Swap Bugs Using Context-Enhanced Code Representations

Sep 2026 · 0 citations · 27 references
Computer Science

Abstract

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 incorrectly ordered arguments, typically relying on establishing mappings between method calls and their corresponding definitions. However, such mappings are often difficult to obtain in dynamically typed languages like Python. In this paper, we present BugProbe, a learning-based approach for detecting incorrectly ordered arguments in Python method calls that does not require call-to-definition mappings. Our approach leverages multiple sources of contextual information, including local context and argument usage context, and combines name-based similarity with machine learning to construct expressive representations of method arguments. We collect a new dataset of 132,739 Python source files from the top-1,000 starred GitHub repositories, yielding 3,371,244 synthetic training examples, and contribute a curated benchmark of 55 real-world argument-swap bugs manually verified from commit histories. We evaluate our approach on this dataset and show that it achieves high accuracy and consistently outperforms a state-of-the-art baseline across standard evaluation metrics. These results demonstrate that effective detection of argument-ordering bugs is possible without relying on explicit call-to-definition resolution, making the approach well suited for dynamically typed language settings.

View source

Similar papers

Open access Sep 2026

DuaLoc: Dual-Encoder Bug Localization with Bug-Report-Conditioned Attention and Contrastive Learning

DuaLoc combines two pre-trained language models: UniXcoder for the semantic understanding of source code and GraphCodeBERT for awareness of data-flow structure and fine-tuned with a contrastive objective that shapes the embedding space around the localization task.

Amany AlBatlaa, M. Abdullah-Al-Wadud · 0 citations
#small language model Preprint Sep 2026

Labelling Bug-Fixing Commits with Local Open-Weight Language Models

This paper examines whether commits can be labelled as bug fixes from their content alone, using open-weight language models that run locally and therefore keep the process reproducible, inexpensive at corpus scale, usable on proprietary code, and independent of any issue tracker.

Philip König, Georg Goldenits, Caroline König et al. · 0 citations
Open access Oct 2026

Enhancing LLM-Based Bug Reproduction via Code Entity Retrieval and Test Case Repair

Automated bug reproduction from bug reports is a critical yet challenging step in software debugging. While LLM-based bug reproduction shows promise, its effectiveness is often hampered by insufficient contextual awareness of the relevant codebase and a tendency to produce invalid test cases. To address these limitatio...

Hao Ding, Yan-Jie Jiang, Yu-Xia Zhang et al. · 0 citations
Open access Aug 2026

A Hybrid Neural-Symbolic Framework for Reliable Automated Source Code Documentation

Inadequate code documentation is a persistent challenge in software development. Time constraints often lead developers to neglect commenting, resulting in poorly documented codebases. This undermines knowledge sharing, reduces maintainability, and weakens team collaboration. Over time, such neglect erodes software sus...

Adewuyi Joseph Oluwaseyi, Kareem Temiloluwa Faith, Odelola Precious Ayooluwa et al. · 0 citations
Open access Aug 2026

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

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 abilit...

Tianyuan Hu, Tongjie Wang · 0 citations
Open access Oct 2026

MOCA: A Hierarchical Semantic-Enhanced Code Edit Framework for Multilingual Code Co-Evolution

Multilingual code co-evolution aims to propagate code edits across programming languages while preserving functional consistency, yet the task remains challenging in real-world repositories. Our motivating examples reveal two key challenges: (1) Existing models fail to infer the rationale behind source edits and may om...

Zhi-Hao Gong, Ze-Yu Sun, Xin Yin 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.