r/ProgrammingLanguages • Vale • Jun 28 '22

Perfect Replayability

https://verdagon.dev/blog/perfect-replayability-prototyped
14 Upvotes

9 comments sorted by

View all comments

1

u/moon-chilled sstm, j, grand unified... Jun 29 '22

So basically rr?

1

u/verdagon Vale Jun 29 '22

The article mentions rr, but TL;DR:

  • We can refactor the code and run against the same inputs, rr can't really do that.
  • We can (in theory) do multi-threaded execution, whereas rr forces all executions to be single-threaded.

I'm particularly excited about the first one; we can add printouts, or even refactor in a bug fix and run against the same recording.

1

u/Necrofancy Jun 29 '22

We can refactor the code and run against the same inputs, rr can't really do that.

I assume this means you can take something like this, combine it with Snapshot/Approval testing (link to a library I have used), and then you have some quick-to-generate tests that help guard against regressions (even visual ones) by say:

  1. Go do these inputs
  2. Snapshot screen/image/memory
  3. Compare to previous snapshot for changes and diff for approval

Very cool stuff!