Skip to content

[RankFO Integration] Port RankF_O ordinal heuristics + OBO baseline into iDFlakies minimize pipeline#72

Open
Md-Arif-Hasan wants to merge 6 commits into
UT-SE-Research:masterfrom
Md-Arif-Hasan:rankfo-integration
Open

[RankFO Integration] Port RankF_O ordinal heuristics + OBO baseline into iDFlakies minimize pipeline#72
Md-Arif-Hasan wants to merge 6 commits into
UT-SE-Research:masterfrom
Md-Arif-Hasan:rankfo-integration

Conversation

@Md-Arif-Hasan

Copy link
Copy Markdown

Summary of this PR

This PR integrates the RankF_O ordinal ranking approach (Phase 2) into the iDFlakies minimization pipeline (Phase 3) and adds an OBO (One-by-One) linear-scan baseline for comparison.

What Changed

New package: idflakies-core/.../minimizer/ranking/

  • RankFOScorer: Ports all five RankF_O heuristics from Python to Java:

    • Plus One (+1)
    • Number of Methods (#M)
    • Distance (D)
    • Combined (+1, D)
    • Combined (#M, D)
  • DetectionResultsLoader: Loads detection results from .dtfixingtools/test-runs/results/ JSON files.

  • RankFOScoreCache: Provides disk-based score caching with modification-time (mtime) invalidation.

  • RankFOCandidateReorderer: Public entry point used by TestMinimizer to reorder candidate tests based on RankFO scores.

Modified: TestMinimizer.java

Two optional features were added. Existing minimization logic remains unchanged.

  • -Ddt.rankfo.enable=true

    • Reorders candidate tests using RankFO scores before delta debugging.
  • -Ddt.minimizer.obo=true

    • Enables an OBO (One-by-One) linear-scan baseline that evaluates candidates individually.

Validation

Validated on kevinsawicki/http-request (M19 from the RankF_O paper):

  • Detected 13 of 25 order-dependent (OD) victims.
  • All detected victims correctly identified customConnectionFactory as the polluter.
  • The Distance (D) heuristic achieved the best performance, reducing polluter-finding time by 14.5% compared to the baseline.
  • RankFO + OBO works as expected: the polluter is ranked first and confirmed in a single run.

Test Coverage

  • Added 40 unit tests, all passing.

Usage

# RankFO-guided delta debugging
mvn idflakies:minimize \
  -Ddt.rankfo.enable=true \
  -Ddt.rankfo.heuristic=DISTANCE

# OBO baseline
mvn idflakies:minimize \
  -Ddt.minimizer.obo=true

# RankFO + OBO
mvn idflakies:minimize \
  -Ddt.rankfo.enable=true \
  -Ddt.rankfo.heuristic=DISTANCE \
  -Ddt.minimizer.obo=true

…plementation

Implements DetectionResultsLoader.load() which reads test-run result JSON files
from .dtfixingtools/test-runs/results/ in chronological order and converts them
to List<TestOrderRecord> for consumption by RankFOScorer.

Key adaptations from the brief: actual iDFlakies data lives in test-runs/results/
(timestamp-prefixed UUID files) rather than detection-results/round-*.json;
the JSON field names testOrder and results.result match exactly.

Adds Level 3 smoke test to RankFOScorerTest that validates parsing against
real .dtfixingtools output from http-request/lib/. All 18 ranking tests pass
(0 failures, 0 skipped).
…Reorderer

- Add RankFOCandidateReorderer: loads detection results, scores candidates
  via RankFOScorer, and stable-sorts the prefix so the real polluter lands
  in the first half of the delta-debugger's split.
- Modify TestMinimizer constructor to conditionally reorder when
  -Ddt.rankfo.enable=true; heuristic selectable via -Ddt.rankfo.heuristic
  (default: DISTANCE_TO_VICTIM). Falls through silently on missing data.
- Add RankFOCandidateReordererTest covering reorder, BSS, unscored tests,
  empty orderings, and bad heuristic fallthrough (6 tests, all green).
…ics and score cache

- Rename HeuristicType enum values to match paper notation exactly:
  PLUS_ONE, METHODS, DISTANCE, COMBINED_PLUS_ONE_DISTANCE, COMBINED_METHODS_DISTANCE
- Rename heuristic classes accordingly: PlusOneHeuristic, MethodsHeuristic, DistanceHeuristic
- Implement Combined heuristics: base heuristic for primary score,
  Distance tiebreaker from last valid ordering (per paper Figure 4)
- Add RankFOScoreCache: filesystem-backed cache keyed by victim/heuristic/OdType
  with mtime-based invalidation against detection results directory
- Update RankFOCandidateReorderer default heuristic to DISTANCE
- All 39 unit tests pass
Adds -Ddt.minimizer.obo=true flag to TestMinimizer. When enabled, replaces
delta-debugging with a linear scan: try each candidate individually before
the victim, stop at the first that alone reproduces the expected result.

Composes with RankFO ranking: when both flags are active, RankFO reorders
candidates by polluter score and OBO confirms the top-ranked one first.
This reproduces the paper's rank-then-linear-confirm strategy.

Usage:
  mvn idflakies:minimize -Ddt.minimizer.obo=true                          # OBO baseline
  mvn idflakies:minimize -Ddt.rankfo.enable=true -Ddt.minimizer.obo=true  # RankFO + OBO

All 40 unit tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant