arXiv:2610.38337cs.SEOct 2026

Manuscript Offprint

arXiv:2610.38337

DIFUZZI: A Differential Fuzzing Tool for Code Functional Similarity Assessment

Simantika Bhattacharjee Dristi, Matthew B. Dwyer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Simantika Bhattacharjee Dristi

University of Virginia

Charlottesville, Virginia, USA

nwc8gr@virginia.edu

Matthew B. Dwyer

University of Virginia

Charlottesville, Virginia, USA

matthewbdwyer@virginia.edu

Abstract—A range of software engineering tasks, such as optimization and refactoring, seek to preserve the behavior of software components and require methods to assess functional similarity. Research has explored formal approaches to prove functional equivalence and used machine learning methods to approximate it, but the former does not scale and does not quantify the extent of similarity and the latter struggles when subtle semantic differences are present. Differential fuzzing offers a scalable approach for differencing programs semantically, but applying it often requires substantial manual effort to construct input generators that are well-suited to a target pair of programs. To address this challenge, we introduce DIFUZZI, which incorporates an LLM-based generator synthesis step that is iteratively validated and repaired. By automating this step, DIFUZZI paves the way for broader applicability of differential fuzzing. We release DIFUZZI at https://github.com/Dristi123/difuzzi_tool, with a demonstration video at https://youtu.be/FIHNOHuo9WE

Index Terms—Equivalence Checking, Functional Similarity Assessment, Fuzzing

I. INTRODUCTION

Assessing the functional correctness of candidate programs against reference implementations is fundamental to a wide range of software engineering (SE) tasks such as code generation, refactoring, optimization, and translation [1]–[3]. While binary correctness metrics distinguish correct from incorrect programs, continuous functional similarity scores capture the extent of behavioral agreement, providing finer-grained feedback for debugging and iterative code improvement [4], [5]. However, existing approaches to functional similarity assessment have several limitations. Unit testing provides execution-based evidence but requires adequate predefined test suites. On the other hand, static code evaluation metrics (CEMs) like CodeBLEU [6] offer inexpensive, execution-free evaluation but remain sensitive to surface-level similarities that may not reflect functional behavior [7]. Similarly, LLM-judges can estimate similarity without execution [8] but often struggle to reason about deeper program semantics [9]. Differential fuzzing offers a promising solution to these limitations by dynamically generating test inputs without requiring predefined test suites, while providing execution-based evidence of functional similarity that LLM-judges or static metrics lack.

Despite its potential, differential fuzzing remains underexplored for code similarity and correctness evaluation. The few existing approaches [1], [7] often require manual intervention, making large-scale analysis impractical, while the lack of open-source end-to-end tools further limits practical adoption.

To address these gaps, in this paper, we present DIFUZZI, an automated, coverage-guided differential fuzzing tool that estimates functional similarity between source code implementations. Given a reference and a candidate, DIFUZZI generates test inputs guided by coverage feedback from both implementations, executes them on the same inputs, and compares their outputs to assess functional agreement. Supporting Python and Java at both function and file levels, DIFUZZI provides fine-grained functional similarity scores and also identifies concrete counterexamples that establish non-equivalence.

DIFUZZI offers a fully automated workflow comprising LLM-based input generator synthesis, automated validation, and coverage-guided differential fuzzing. First, an LLM synthesizes a problem-specific generator that transforms raw fuzzer bytes into valid program inputs. DIFUZZI then validates the LLM-synthesized generator for structural correctness, robustness, and input validity, using feedback-driven LLM repair to address failures. Once validated, the generator is integrated with a coverage-guided fuzzer, which mutates input bytes using coverage feedback from both implementations to exercise different execution paths and assess their functional agreement.

Our experiments in Section IV, conducted on 500 Python and Java program pairs from 5 benchmarks, demonstrate DIFUZZI's effectiveness in functional similarity estimation relative to baselines.