Re:Mutation Driven Testing: When TDD Just Isn’t Good Enough
by tom_mellior on Saturday February 06, 2021 @08:02AM
(#26046231)
Nor does this exercise the trimming of the substrings, for example. This is good for testing the happiest path, I agree. I was interested in the tedious testing of all the unhappy paths.
Re:Mutation Driven Testing: When TDD Just Isn’t Good Enough
by masklinn on Saturday February 06, 2021 @07:25AM
(#26046088)
> not the implicit fourth requirement that the function throws an exception for other inputs.
You could probably generate invalid inputs by taking a list of strings as input. Though of course at that point the property test has to reimplement half the function.
That's an issue I often end up having with property tests: the oracle for interesting properties is as complex as the SUT, so you end up with two of them.
I would write something like this in haskell:
This captures the three requirements, but not the implicit fourth requirement that the function throws an exception for other inputs.