I’m working through the concept exercises, which has been a lot of fun, but there is one thing that I don’t like: the amount of test cases being used. With practice exercises, each test cases should introduce something new, not be a variant of an earlier test case. I found this is not always the case with concept exercises. Take the cater-waiter exercise, which has huge numbers of test cases, most of which are just there for exhaustiveness:
The huge number of test cases makes for an incredibly long test run output, which makes it harder to spot where things went wrong. The test cases are even defined in a separate file, which makes them harder to find.
This is clearly something we need to discuss: @depial, who co-authored this, and (if she’s around at the moment?) @BethanyG: we copied Cater Waiter pretty directly from the Python track.
Do you mean the size of the test data (which I agree is egregious, and has been trimmed somewhat on the Python track), the number of test variations (which could be trimmed down more, and maybe should be here), or the number of parent tests (which each correspond to a method from the sets module in Python)?
I don’t think 7 parent tests is excessive, but maybe only 2 variations of each - three at most? Julia is also organized a bit differently from the way Python does sets, so we may want to trim down the parent tests as well.
And we might want to rethink the test data for Julia. Maybe combine the two test data files or make the content shorter. But I think @depial should definitely weigh in as to the best path forward here, since they know Julia better than I do.
I feel like we could trim the number of test cases without much issue. I agree that we don’t need >20 for a task (I’m usually happy with <5-6). For example, we could slightly alter the story to just be a vegetarian/vegan restaurant, and that would likely drop quite a few of the test cases (the idea for that comes from task 3, which need a solution that loops through 5 options).
We could also drop the last task altogether, if desired, since it is a combination of set functions in earlier tasks (at least according to the exemplar.jl). All other tasks cover different set functions. Not sure how you feel about that @colinleach
Overall, I don’t think it’ll be hard to trim the number of test cases.
I found this is not always the case with concept exercises.
@ErikSchierboom, I thought this exercise was a bit of an outlier, but are you seeing similar issues with other exercises? I don’t tend to put a lot of testing into those that I personally write, but I’ll be happy to look into any I did and also the ones we ported from other tracks.
I’ve opened a PR to address superfluous test cases in cater-waiter and elyses-enchantments
Along the way, I did a quick scan of all the concept runtests.jl files and other than those two, the other testsets look within reason. Even when they have upwards of 10 tests in a Task, they generally seem to be testing valid aspects, but I’m still willing to take a closer look at any exercise in particular that anyone has an issue with.