// HACKER NEWS — CYBERSECURITY
Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)
RealDiff finds runtime behavior changes that ordinary source review misses by running the same tests on both sides of a pull request and comparing observed method arguments and return values.
This is dynamic behavior comparison, not mutation testing, static analysis, or coverage. RealDiff mutates nothing, modifies no test, and does not analyze source to predict behavior. It observes only code that the existing tests execute; source information is used to build, instrument, and map those observations back to the pull request.
Suppose a pull request tries to remove the allocation made by OrderBy. In this diff, lines beginning with - are the stable base implementation, lines beginning with + are the proposed in-place sort, and the highlighted behavioral change is the new ordered.Sort(...) call:
It looks like a local allocation/performance refactor: both versions sort by Priority. The missing detail is stability. OrderBy preserves declaration order when two rules have the same priority; List.Sort does not. The fixture declares A_SEASONAL before Z_CLEARANCE, gives both priority 10, and selects the first eligible rule. The new sort reverses those equal-priority rules.
RealDiff records the values at runtime. In the block below, BASE is the result before the refactor and PR is the result after it:
Neither DiscountEngine.SelectDiscount nor CheckoutTotals.Compute is in the diff. RealDiff followed the executed calls from the edited ordering helper into that unedited pricing code and reported the changed values there.
All three tests execute this path. Two broad assertions still pass: 60 is below the list price, and 60 does not exceed it. Only the exact assertion that A_SEASONAL wins the tie reacts. Assertions check what their author thought to check; the trace also exposes changed behavior nobody asserted on.
Inspect the public .NET demo pull request and its successful hosted run.
Self-noise is subtracted. RealDiff runs the base build more than once before comparing it with the pull request. If the base disagrees with itself, that observation is removed. Timestamps, GUIDs, randomized hash ordering, and other run-to-run variation therefore do not become findings.
The origin is reported, not the blast radius. A changed value deep in a call tree can make every caller above it look different. RealDiff collapses that cascade and reports the first changed behavior whose own descendants behaved identically. You see the causal frontier where the difference begins, not every ancestor that carried the different value upward.