What does HackerNews think of scientist?

:microscope: A Ruby library for carefully refactoring critical paths.

Language: Ruby

#16 in Ruby
Something I've learned in Ruby land (prob standard in other places, forgive my ignorance) that seems a bit different than what the article advocates for (fake services):

- Write your service wrapper (eg your logic to interact with Twilio)

- Call the service and record API outputs, save those responses as fixtures that will be returned as response body in your tests without hitting the real thing (eg VCR, WebMock)

- You can now run your tests against old responses (this runs your logic except for getting a real response from the 3rd party; this approach leaves you exposed to API changes and edge cases your logic did not handle)

For the last part, two approaches to overcome this:

- Wrap any new logic in try/catch and report to Sentry: you avoid breaking prod and get info on new edge cases you didn't cover (this may not be feasible if the path where you're inserting new logic into does not work at all without the new feature; address this with thoughtful design/rollout of new features)

- Run new logic side by side to see what happens to the new logic when running in production (https://github.com/github/scientist)

I use the first approach bc small startup.

Check out GitHub scientist if you are doing a migration with a ruby based system: https://github.com/github/scientist

Great support and functionality for testing differences between two systems of record.

This looks really cool! It reminded me of another library I came across a while back, Scientist from GitHub: https://github.com/github/scientist
This is some of the best testing advice I've read. I follow the first two points with enormous success. The third idea seems like it would solve a lot of the cases where i've stumbled. Much appreciated!

reminds me a lot of how github's scientist works. https://github.com/github/scientist

> Scientist for Python? https://github.com/github/scientist

Indeed; from README:

> Python library that makes testing refactored code super simple. Inspired by scientist from github.