Skip to content

Commit

Permalink
Shrink & clean up custom_set.json
Browse files Browse the repository at this point in the history
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
whit0694 committed Apr 20, 2016
1 parent eda25a5 commit 4d00d78
Showing 1 changed file with 74 additions and 323 deletions.

0 comments on commit 4d00d78

Please sign in to comment.