Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Collecting all results of the property based tests from the hackday #372

Closed
wants to merge 11 commits into from

Conversation

forki
Copy link
Contributor

@forki forki commented Apr 18, 2015

This PR is WIP and not intended to merge, but I hope it's OK to do this here in the open (since the CI is working here).

Currently we have:

  • A new project which add FsChecks (this project needs to be merged into existing FSharp.Core.Unittests)
  • A module with tests of the List module (this works as a baseline / reference implementation for collections)
  • A module with tests that check Array and Seq against the List module base line
  • New tests that verify sorting stability of List and Seq. AFAIK we don't have such tests currently in the project. At least nothing broke when we tried a wrong implementation for Seq.sortBy cannot handle sequences of floats containing NaN #370

@forki forki closed this Apr 18, 2015
@forki forki reopened this Apr 18, 2015
@forki forki force-pushed the fscheck branch 2 times, most recently from 9d2498f to e1e04b9 Compare April 18, 2015 17:13
@forki forki changed the title WIP: Just a quick check of CI WIP: Collecting all results of the property based tests from the hackday Apr 18, 2015
@forki forki force-pushed the fscheck branch 2 times, most recently from 1e22ffd to 623e4e4 Compare April 19, 2015 17:47
@KevinRansom
Copy link
Member

What is the ask for this PR?
Are these a new set of test cases?
Do the test cases overlap existing ones or are they all new?
Does it introduce a new test framework? do we plan on migrating all existing tests to a new framework?

I don't yet understand what the purpose of this is, if someone could clarify the purpose of this PR, I would be grateful.

@forki
Copy link
Contributor Author

forki commented Apr 30, 2015

Hi,

the basic idea is to bring property based testing on the table.

During the hack day we tried it out and tried to find bugs in the FSharp.Core collections. It were able to easily reproduce #373 and lot's of different variations.

Do the test cases overlap existing ones or are they all new?

The tests are overlapping yes, but there are also lots of new ones.
As one example: @theimowski created tests which show the stability of sort:

let sortByStableList<'a when 'a : comparison> (xs : 'a []) =
    let indexed = xs |> Seq.indexed |> Seq.toList
    let sorted = indexed |> List.sortBy snd
    sorted |> Seq.pairwise |> Seq.forall (fun ((ia, a),(ib, b)) -> if a = b then ia < ib else true)

This is a really amazing test. FsCheck will generate tons of different testcases with all kinds of weird types and tries to break it. As @theimowski showed with a similar test: Array.sort is not stable (as expected).

Unfortunately I don't have all the test from the participants since people told me they want to clean up before they send it.

Does it introduce a new test framework?

Yes we need a framework that is able to generate the test cases. So it's introducing https://fsharp.github.io/FsCheck/

do we plan on migrating all existing tests to a new framework?

no, not at all. thse property based tests are additional testing suite.

tl;dr: we are trying to come up with test suite that makes it easier to find bugs in FSharp.Core. But this is far from ready to merge.

@latkin
Copy link
Contributor

latkin commented May 19, 2015

There has been no update on this guy for quite a while. Please re-open when it's ready to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants