Are you aware of a tool (I imagine something like a jest plugin) where you can specify a unit test with all the inputs and their possible values and add logical rules to be able to omit some of the input permutations based on the given logical rule.
The remaining set of permutations to test might be represented in a table (and I'd be prompted to fill in all these tests.)
That does not seem hard to do at all, but maybe there is something out there.
+ is there any tool which does something similar under the hold? Maybe a proof assistant when we are specifying our types? Dunno it just seems there must be something and I can't join the dots.
a
alltom
07/31/2019, 2:09 AM
I wrote something related… You define some dimensions and their ranges (logged in/out, regular/admin user, fetch succeeds/fails) then you annotate each test with an expression for the contexts where it ought to pass. It’s missing the coverage chart you mentioned, though. That sounds nice, though our issue was having too many tests (at runtime) due to the combinatorial explosion, not too few. 😂
d
Dan Cook
07/31/2019, 3:24 AM
I saw a video showing how to make a Sudoku solver in a logic language (I think it was prolog?) just by specifying the rules for a valid column, row, and box. Then you just feed it a puzzle and it gives back the valid answer(s)
p
Pezo - Zoltan Peto
07/31/2019, 10:09 AM
@alltom that is interesting. Do you mean these were dynamic assertions evaluated runtime at the first place (some kind of integration tests), not static tests (like simple unit tests)? What language/ tech stack did you use?
Pezo - Zoltan Peto
07/31/2019, 10:10 AM
@Dan Cook exactly! I always wondering I’d need Prolog (or something similar) for that. As I’ve seen there is Prolog implementation running on js available, if I don’t find something already done I’ll use that.
a
alltom
07/31/2019, 3:17 PM
It was built on unit tests. One test might be like, "the controller should render a button, in all contexts where logged-in is true and the fetch succeeds" (leaving regular/admin user unspecified). The test runner then goes through the truth table defined for that test file and runs that test everywhere its guarding expression is true.