Exercise specifications, or lack thereof

Hi all.

For a bit of context, I am an experienced programmer, but fairly new to the Exercism platform. To get a feel for the place I joined the tracks for some languages I already know reasonably well, and have been working through some of the exercises.

One thing I noticed immediately in the Bash track is the lack of a detailed specification for each exercise. It appears they only consist of the generic template text used by all tracks for that exercise.

Now, with the C track, for example, the stub files generally contain function and structure declarations which in a strongly-typed language are enough to give you the idea of what you are supposed to do to solve the exercise. These ‘hints’ do not exist in the Bash track, that I have found so far, anyway.

I’m thinking particularly of ‘Allergies’, though others are similar. It says nothing of what the inputs to the script are, and what the expected output formats are. Because I know Bash I was able to open and read the bats file to ‘reverse engineer’ this information. I have to think that a beginner just trying to work some exercises for practice may not have the knowledge or ability to do so, and would quickly become very frustrated.

I see that Exercism strongly pushes test-driven development, which is of course fine, but I wonder if this vagueness in the problem statements is intentional or not? Is the spec supposed to be sussed out by interpreting the results of the tests?

I am not complaining, and I understand that this site is driven by volunteers, so I guess that’s my actual question: is this vagueness intentional, or would some PRs that fill in the Bash-specific input/output formats be welcomed?

I don’t mean spelling everything out, but rather, again using Allergies as an example, just informing that the input is two args passed to the script; that the first arg is a number, and the second a string; and that a <number> list arg form expects a space-delimited list in response, and that the <number> allergic_to_<x> form expects a true/false response.

If such a PR were welcome, I gather the instructions.append.md file is the place for it?

Apologies if this has been discussed. I tried a search, but did not find anything recent that speaks to my question. Thanks for consideration.

1 Like

Yes, users are expected to be able to open the test file to determine the input format.

That said, there’s no reason we couldn’t add a line or two to the stubs documenting the input format, possibly with an example.

I feel like it would be great to have it codify somewhere as a hint/instruction when new learners start a track (unless it already is in there and I’m just actually blind.) Can imagine a bunch of new users got confused by that.

Updating the stub solution file would be a good place for it. In addition, it would not cost Exercism money (changing the instructions for every exercise, and translating the updated docs, would be a relatively costly operation)

If we’re considering mass-updating the stubs, do we want to consider using the test generator and a Jinja file? There is a lot of shared boilerplate that can be shifted to a common imported file, similar to what I did here for Racket.

1 Like

Yes, users are expected to be able to open the test file to determine the input format.

OK, well given this expectation I will retract my suggestion for input/output specification, but like k8s3dnih9, I feel this expectation could be made much more explicit.

The HELP.md says:

Solving an exercise means making all its tests pass.

…but this is a broad, nebulous goal with no clear first step, whereas stronger language along the lines of:

Review the <foo.bats> file to see the inputs sent to your script, and the expected output of your script.

is an actionable step that would not likely be intuited by a beginner new to the platform, or to programming itself without this explicit guidance, at least in the first half dozen or so exercises in the track, until the workflow is established.

2 Likes