Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discussed here: exercism/discussions#10 I'm trying to improve custom_set in two ways: 1. Reducing the test suite, to remove redundancy or uninteresting implementations. 2. Changing test order to improve flow Reducing the test suite ---- The previous test suite contained 74 tests, which is a lot. I haven't checked all the exercises, but it's the biggest test suite that I've come across. If all of those tests provided value (exposing corner cases, improving implementations, etc.) then that's fine. But I found there to be a lot of duplicate tests. With the subset/union/etc tests, a student's implementation is usually done by the 2nd or 3rd test, so the remaining tests didn't provide any additional value. So I have removed the tests that seemed redundant. The tests also expected methods like `size`, `delete` or `is_empty`. I have removed those because - They aren't vital to the behavior of a Set - They are usually implemented as an alias - They aren't used by the set operations (diff/subset/etc) Changing test order ---- The previous test suite started with `equal`. I found that this requires students to implement two things: - Creating a new element - Comparing two collections of elements I have chosen to start the tests with `contains`, since that only requires one set. And, helpfully, when the student implements `add` and `equal`, they can leverage their already-existing `contains` function.
- Loading branch information