Earlier quoted context omitted.
Not mutation testing — nothing is mutated. It builds both branches with instrumentation, runs the same test suite on each, and diffs the recorded arguments and return values. In that example, selectDiscount returns a different discount and the order total goes 85 → 60. Neither function is in the diff; only the sort helper is. The tests still pass — one asserts the total is positive, and 60 is positive.
please try speaking in your own words. i still have no idea what this is for. is it two compare two impls? is it to "optimize" a function (i assume not since there's no mutation)?
Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)
11–14 of 14 posts
Re: Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)
#12Re: Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)
#13I just wanted to share for others that there is a configuration language call Dhall (https://dhall-lang.org/) that has this kind of guarantee as one of its nicest features. See the "Refactor Fearlessly" section. In Dhall, most behavior preserving refactors produce the exact same hash code so you can know - for an absolute fact - that a refactor is behavior neutral. The point of sharing that other language is just to legitimize that "this is a thing" i.e. it has value recognized by others.
Re: Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)
#14I love the concept and see the value for refactoring. There is tremendous value in knowing that two implementations are run-time equivalent. I just wanted to share for others that there is a configuration language call Dhall ( https://dhall-lang.org/ ) that has this kind of guarantee as one of its nicest features. See the "Refactor Fearlessly" section. In Dhall, most behavior preserving refactors produce the exact sa…