Skip to content

Support different return types #44

@davezych

Description

@davezych

I'm not sure how scientist handle this (nor how ruby handles this situation), and I know you want to stay close to the ruby lib, but it could be useful to support different return types between the control and candidate. When refactoring there is no guarantee that the candidate methods will return the same type as the existing method, which could lead to hardships trying to experiment on them. Supporting 2 different types allows us to get around that issue, and we can check the differences between 2 different complex objects in the comparison.

A potential implementation:

internal class Experiment<TControl, TCandidate>
{
    Func<Task<TControl>> _control;
    Func<Task<TCandidate>> _candidate;

    public void Use(Func<Task<TControl>> control);
    public void Try(Func<Task<TCandidate>> candidate);

    public void Compare(Func<TControl, TCandidate, bool> comparison);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions