Replies: 4 comments
-
Hello, 'RosarioPulella! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future! |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker @Sergio0694 @azchohfi I would love to hear your thoughts. |
Beta Was this translation helpful? Give feedback.
-
Sounds interesting, does FsCheck work with just vanilla MsTest? I think that's what we're using currently, eh? |
Beta Was this translation helpful? Give feedback.
-
They have some examples. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem this feature would solve
As a contributor, I would like to write tests based on properties that I want to hold and have test cases generated for those properties, so that I don't have to write numerous test cases, the generated test cases can be richer and my test code more clearly shows what properties it wants to test for.
Describe the solution
We make use of FsCheck to write property based tests. This should make it easier to write tests while running more test cases and it should help up find minimal cases of test failures quicker.
This will lets us write our test based on specifications and generate test cases. This will help up gain test coverage a lot more easily and allow us to replace some existing tests with ones that describe desired behavior more clearly.
We can start with new test on a control that lack tests and expand to others.
Additional context & Screenshots
Property bases testing originates from QuickCheck and FsCheck provides similar functionality. In FsCheck the user can write properties that they want to test and generators for test cases, then FsCheck will generate test cases for the properties being tested and if it finds a falling case it will attempt to simplify.
Some articles to show how this works and some motivation.
https://fscheck.github.io/FsCheck/
https://aaronstannard.com/fscheck-property-testing-csharp-part1/
https://simonreynolds.ie/fscheck-an-introduction/
https://youtu.be/_0BFkslU8yM
Computerphile video on QuickCheck
Beta Was this translation helpful? Give feedback.
All reactions