Caching is better than mocking

5 points by chrislloyd


olegkovalov

Basically golden files, right?

vlnn

Somehow I hate the idea — maybe due to working for so long in the company where lots of tests were based on golden files. In big enough project it led to constant manual work of maintenance and manual overrides (when differences exist but not really matter). Even worse in the world of LLMs where results are varying even for same arguments!

Sorry to say, but I hate the idea, and I only wonder how it works for the author.

carlana

For network calls to third party APIs, as part of development, I will record the call (with my own library but it's just a minimalist clone of Ruby's VCR) then I just strip out any identifiable data (API keys, etc) and use that for testing.