-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add a getting started tutorial #119
Comments
This would be very helpful. 💯 Particularly, I'd really appreciate a succinct example for the more QuickCheck-like use case, where you're exercising functionality in lots of random orders to find strange issues. I have a I already did some simple "input -> result" fast-check assertions in that file (to ensure compatibility with other implementations of secp256k1), but I actually only found this bug in manual testing. Returned Typed Arrays were using references to internal buffers rather than copies of them, so if you used library methods in a certain order, and continued trying to use earlier results, your earlier results were continuing to be modified by the library (since I was accidentally giving you a reference rather than a copy). I'd love to see an example which uses fast check to try all the various different methods in many orders, and confirm that we still get reasonable results. |
Partial answer for the moment, I need to dig a little bit more in your message before coming with a full answer. Concerning:
I have an opened issue #8 to implement commands-like approach - model based testing. I have seen this method in used with RapidCheck C++. Snippet example (C++ code): https://github.com/emil-e/rapidcheck/blob/master/examples/counter/main.cpp Basically you define commands with:
And your done ;) The framework does all the magic for you. It is really a feature I want to see in fast-check, so I will definitely work on it whenever I got enough time to think of a nice implementation. I want to apply this approach for UI testing (I already built a POC for that at work based on fast-check). |
@bitjson I just submitted an example of simple implementation of model based testing based on fast-check. See Model based testing example #120 For the moment, I do not provide a built-in implementation in the framework. It would require some more work:
Related to your point:
|
In reality, given #120, there is very few work to do to have a ready to use solution. If it solves your problem I can start adding this feature to fast-check in a next minor. Basically, I can:
And this is it. |
@bitjson Just added a hands-on tutorial containing both a definition of property based and a sample project example tested with fast-check. Available directly from the README |
@dubzzz awesome! Thanks for the examples, those are both very helpful. And I would love to be your first user for a built-in model based testing framework! Just let me know when you have something ready for me to try – I'll try it on the Secp256k1 interface in |
Closing the issue. There is an open issue to keep track on the model based way |
Content:
The text was updated successfully, but these errors were encountered: