3 ms·
I find the `scientist` gem by GitHub [1] a very nice way to approach the problem of testing alternative implementations. Basically `scientist` always runs both
by gioele 11y ago
I find the `scientist` gem by GitHub [1] a very nice way to approach the problem of testing alternative implementations.
Basically `scientist` always runs both the original code and the new code.
def allows?(user)
science "widget-permissions" do |e|
e.use { model.check_user(user).valid? } # old way
e.try { user.can?(:read, model) } # new way
end # returns the control value
end
It returns the result given by the original code, but it also compares both results and store statistics about when the two codes produce different results. This allows you to run experiments directly in the deployed branch without any service disruption.
[1] https://github.com/github/scientist https://github.com/github/scientist