-
Notifications
You must be signed in to change notification settings - Fork 45
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
[discussion] Ideas for specs/tests #85
Comments
Hmm, I'll probably want it being tested from the OCaml side as I do intend for native-compilation rendering to be built in sometime, and it looks like this would work for that as well yes? I'm not actually terribly familiar with the whole 'describe' method as I tend to use more traditional tests especially via fuzzers and case generation. Is there a way to use at least case generation inside these as well? I've used janestreet's Quickcheck library in the past for that but I hear there are others as well? |
Yes, nothing is stopping it from working on the OCaml side (that's how I've used it before).
Currently - no - nothing is done in that direction, although it might be possible to add. But then it's probably better to look into any existing tooling/framework for testing this codebase. And on that note, it might be useful to keep as separate concerns how to test this codebase and applications built using it. I'm thinking maybe something like https://github.com/gdotdesign/elm-spec could be useful for the latter? |
Likewise, if any of it leaked into user code then something's wrong anyway. ^.^;
You really should look into the quickcheck method. It is a significantly better testing methodology than simple inline tests (and you can always fall back into a simple inline test anyway, though I always try to structure things to not need that).
Hmm?
That looks like it is more for testing client code in the browser though? |
Exactly, or maybe also from the cli, but specifically for clients, yes. And that's what I meant by keeping it separate from testing |
Cool. :-) But yeah, definitely look at how quickcheck works (common in haskell/ocaml/erlang/etc... languages for testing). :-) |
I will definitely look into that kind of testing - I feel like I've missed that, maybe due to coming more from JavaScript and and other languages with inferior type systems.... :-) |
In essence with the property check style testing, instead of testing specific calls to specific returns, you test streams of calls with randomly generated inputs and verify that the end result is coherent and expected (like an old example is testing an elevator system, you test that when Some simple reading on the concepts (uses erlang as example code): |
Ahh, thanks, looks really interesting!
…On Wed, May 2, 2018, 19:25 OvermindDL1 ***@***.***> wrote:
In essence with the property check style testing, instead of testing
specific calls to specific returns, you test streams of calls with randomly
generated inputs and verify that the end result is coherent and expected
(like an old example is testing an elevator system, you test that when 3
is pressed it goes to level 3, etc...). :-)
Some simple reading on the concepts (uses erlang as example code):
https://ferd.ca/property-based-testing-basics.html
https://propertesting.com/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#85 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUfUruMip9dYRkOMBFgdmkOorsUow4dks5tuewWgaJpZM4TvdAD>
.
|
Please have a look at https://github.com/neochrome/bucklescript-tea/tree/specs for a simple take on how specs/tests possible could be implemented.
For now it is expected to first be compiled using the bucklescript compiler, then executed using node (see
package.json
). It's possible it could work to execute more like a script using the-bs-main
switch of the compiler, but I couldn't get it to work right away.Would something like this be interesting?
The text was updated successfully, but these errors were encountered: