algorithm-archive icon indicating copy to clipboard operation
algorithm-archive copied to clipboard

Uniform testing

Open Liikt opened this issue 6 years ago • 3 comments

While looking through the code of PR #542 we came across the problem of sometimes not having proper test cases. In this PR random numbers are generated and you can't really make out if the computation actually succeeded or not.

Some implementations do have that but some don't and I think this is something we should consider.

I'll leave the issue here for discussions and ideas.

Liikt avatar Dec 24 '18 02:12 Liikt

This is closely related to #320. I agree, we need to create more rigorous tests for most methods. This is part of the upcoming revisions that I am working on now. That said, I would love to have some discussion on what tests are most worthwhile for the methods we currently have.

leios avatar Dec 24 '18 21:12 leios

After a discussion on stream, we realized that it wasn't clear what was meant by "uniform testing" I had naively assumed it meant that most main() functions would include a test (if possible), like so:

function main()
    init()
    run_method()

    if(test_passed())
        println("This method works!")
    else
        println("This method doesn't work!")
    end
end

Please let me know how you would like for this testing to happen.

leios avatar Apr 10 '19 22:04 leios

Yes basically that we have (where it works) a defined input with defined output. If randomness is involved than we may need a threshold but I think the most algorithms don't rely on randomness so something like you described would be possible.

Liikt avatar Apr 11 '19 12:04 Liikt