Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we continue to allow for multiple examples? #893

Closed
sshine opened this issue Jan 21, 2020 · 2 comments
Closed

Should we continue to allow for multiple examples? #893

sshine opened this issue Jan 21, 2020 · 2 comments

Comments

@sshine
Copy link
Contributor

sshine commented Jan 21, 2020

Since Exercism v3 necessitates a different directory structure (as evidenced in exercism/v3#200), I thought that this would be a good time to review which decisions related to directory structure were made in the past and if their reasons still apply.

It was decided in #395 (and implemented in #396) that we should support multiple examples per exercise and extended in #397 (and implemented in #477) with the possibility of negative examples. One consequence of these discussions is that multiple examples are provided in a directory structure examples/{success,fail}-{foo,bar}/{package.yaml,src/<SLUG>.hs}. The merits of this particular directory structure for handling multiple files won't be elaborated here, but can be read in the referenced issues and pull requests.

Re-iterating some of the advantages and disadvantages of multiple examples:

  • 👍 we can test that multiple signatures are accepted by the test suite
  • 👍 we know that some recommended solution is possible
  • 👎 running the test suite takes longer (18/101 ≈ 20% of exercises have 2 examples)

Re-iterating advantages and disadvantages of negative examples:

We have three negative examples currently: the test suites of accumulate and strain are verified to fail when solutions are not lazy enough, and test suite of of robot-name is verified to fail when solutions are not collision-aversive.

I'm okay with leaving things as they are, since both of these features were at one point favored by both @petertseng and @rbasso. I'm also okay with simplifying things and have just one (positive) example at the cost of quality. This is slightly more maintainable and provides a slightly lower bar for new contributors.

This issue was created as a reaction to exercism/v3#200 in which it was briefly assumed that we distribute only a single example solution in a file called Example.hs (as is the norm on many other tracks), when in fact our current setup is more elaborate. Rather than to insist on continuing to do so, this issue can be an opening for having a discussion of the subject if anyone is inclined to do so. If not, this issue can be closed briefly and be resumed at any point later in time.

@petertseng
Copy link
Member

In which I explain how I would evaluate this decision (what assurances does the project want to make about the product it provides?)

In e.g. an open source project that provides a library, they test the library to make sure that e.g. it compiles, or that it can be used in some specified way to get some specified result. Since one of the things Exercism provides is the tests for a problem (along with its specification and the stub file), then we ask what properties we want to ensure are true about the tests.

For example, "it is possible to write a solution that passes these tests" seems to be something all tracks agree that we want to test, and providing one solution is one way to achieve that goal.

So, the current structure implied that this track additionally wanted to test "it is possible to write a solution with this other type signature" and "if a solution has X incorrect behaviour, the tests reject that solution".

So, I think the first question to ask is what exactly this track wants to ensure is true about the tests it provides. Then it is possible to think of ways to ensure those things.

sshine added a commit to exercism/v3 that referenced this issue Mar 3, 2020
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism/haskell#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
@sshine
Copy link
Contributor Author

sshine commented Mar 25, 2020

I'm closing this issue as its main purpose is to highlight that this discussion was being made in exercism/v3#200. Since nobody is interested in having it, this issue can be opened again if the discussion should once again arise.

@sshine sshine closed this as completed Mar 25, 2020
BethanyG pushed a commit to BethanyG/v3 that referenced this issue Mar 31, 2020
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism/haskell#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
ErikSchierboom pushed a commit to ErikSchierboom/haskell that referenced this issue Jan 27, 2021
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
ErikSchierboom pushed a commit to ErikSchierboom/haskell that referenced this issue Jan 28, 2021
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
ErikSchierboom pushed a commit to ErikSchierboom/haskell that referenced this issue Jan 29, 2021
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
ErikSchierboom pushed a commit to ErikSchierboom/haskell that referenced this issue Jan 29, 2021
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into exercism#893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
iHiD pushed a commit that referenced this issue Feb 5, 2021
This merges the existing [v2 track's directory structure][v2] with
[v3 track's directory structure][v3] as outlined in the v3 repository.

In particular, the layout of multiple example solutions is preserved
until Haskell track contributors come to another conclusion than the
current. This discussion is extracted into #893.

The ordering of the files in the ASCII drawing is incidentally made so
that the track-specific files are listed first.

[v2]: https://github.com/exercism/haskell#directory-structure
[v3]: https://github.com/exercism/v3/blob/master/docs/maintainers/generic-how-to-implement-a-concept-exercise.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants