In this article
Compare the benchmark-prepared buggy and fixed versions under one recorded environment; the bug identifier alone does not define the test protocol.
Pair versions through the benchmark identity
The Defects4J repository describes reproducible Java bugs with minimized fixes and triggering tests. Its inspected README identifies version 3.0.1. A project identifier and bug identifier select the case; buggy and fixed revisions use the b and f suffixes. These are benchmark-prepared versions, with irrelevant fixing-commit changes pruned by maintainers. Comparing arbitrary adjacent upstream commits can therefore produce a different edit set. Preserve the benchmark release alongside the case identity when extracting a repair example.
Keep active and deprecated identities distinct
The repository retains deprecated-bug metadata and does not renumber the remaining active bugs. A gap in identifiers is not an extraction error. Newer Java behavior can affect reproducibility, so an earlier paper’s population need not equal a current active selection. State whether the study reproduces a historical release or uses today’s recorded active set. Store this selection with provenance information before joining saved predictions, patches, or fault locations to an exported table.
Export the checked-out version’s properties
The export command returns version-specific properties from a checked-out workspace. These include source and test directories, compilation and test classpaths, modified classes, and test sets. Use those properties rather than inferring a uniform project layout. tests.trigger identifies test methods exposing the bug; tests.relevant has a broader class-based meaning. A model input made from modified classes is also a localization assumption. Label that assumption explicitly if evaluating repair rather than unrestricted repository diagnosis.
Validate both sides under the same test scope
The test command documentation distinguishes normal test execution, a selected method, and supplied external suites. Record which was used and retain the failing-test report. First confirm the intended contrast between the prepared buggy and fixed versions under that protocol. The repository documents Java 11 and the America/Los_Angeles timezone for its current reproducibility setup. Changing the runtime or timezone can introduce unrelated failures. Environment incompatibility should remain a separate outcome from a candidate patch failing the triggering regression.
Interpret a passing patch as bounded evidence
A generated repair that passes available tests may differ from the developer fix without being wrong; conversely, passing does not prove correctness on untested behavior. Preserve patch identity and exact executed tests. For learning experiments, keep paired versions and related fixes from crossing partitions, following leakage guidance. Defects4J is useful for controlled Java testing, localization, and repair comparisons. It does not supply a universal train/test split or make one successful regression check an exhaustive specification of the application.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.