Show HN: Laboratory, a Python port of GitHub's Scientist library for refactoring
github.com
github.com
PHP
https://github.com/LartTyler/Analyst
Javascript
https://github.com/trello/scientist
Because `enabled?` and `run_if` determine when a candidate runs, it's impossible to guarantee that it will run every time. For this reason, Scientist is only safe for wrapping methods that aren't changing data.
When using Scientist, we've found it most useful to modify both the existing and new systems simultaneously anywhere writes happen, and verify the results at read time with `science`.
[1]: https://github.com/github/scientist/blob/master/README.md#de...
The with statement is one of my favorite additions to the language. It's a really flexible syntax to encapsulate control flow, exceptions, necessary cleanup steps… etc. etc.
@experiment.with(new_function)
def old_function()
...> Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable.
I hope you have a formal specification of that cache. That will help ensure your design is correct in the first place before you even get to running it in code.
I shall be playing with this soon. Cheers!