Core concepts: Control vs Candidate
masterScientist.NET uses two primary abstractions to facilitate safe refactoring:
- Control: The existing, proven implementation. It is defined using the
experiment.Use()method. The result of theUseblock is what is ultimately returned to the caller ofScientist.Science<T>. - Candidate: The new, refactored implementation being tested. It is defined using the
experiment.Try()method. Scientist monitors the candidate for performance, correctness (result matching), and exceptions, but its output is not returned to the caller.
If no Try blocks are declared within an experiment, the Scientist machinery is bypassed and the control value is returned directly.