[BUG]: Faulty test cases in Two Fer

I work on exercises on Offline mode and when I did Two Fer Exercises after completion I ran the test and only 1 test ran just for the empty argument case and all the others skipped but there was mistakes on the other cases but it passed the tests and I submitted the solution but it failed on the online modes.

The cause was all the others tests on Offline was xtest and which caused it to be skipped and not checked.

Enabling 1 test for argument present case can solve this problem.

Exercism practices TDD so when working offline, typically only the first test is run if possible. Running the subsequent tests locally is track-specific, but the intention is you would work through them one by one. The online test runner runs all the tests every time.

This is the expected, documented behavior. See https://exercism.org/docs/tracks/javascript/tests#h-understanding-skip-tests

@BNAndras and @IsaacG I understand what you are saying but I am a new user to Exercism and joined the platform for building up my programming skills. This is the case for most of the users, and most of them are not a Professional yet to be able to manage tests on their own. If that wasn’t the case there won’t be a need for being user to a leaning platform right?

What I am trying to say is when new users join and they want to start doing exercises asap. Often, they won’t see these Docs because of this. When we click on an Exercise we see the code to run for local and a link which says Learn more about solving exercises locally and this docs should have the test docs atleast a link on how tests works in the platform but there isn’t any.

Is it the users fault for not reading all docs before proceeding to do Exercise? No.

Is it platforms fault for not giving what needs to solve an exercise offline upfront? Maybe.

Obviously I cannot blame anyone on this because, The platform is a non profit and I only wanted to point out this problem. Atleast give a reference to the test related docs in the Learn more about solving exercises locally page. Just above this doc there is the test related docs page but users avoid anything else other than things to get started.

Yes.

We can talk for a very long time how to resolve this, but the stance here is that the documentation is part of the journey and if people skip that that’s on them.

Fortunately the online tests account for this, but any “earlier” hint of someone not reading the doc is just going to make people have an issue with that down the line. Various exercises have hints or rules in either the docs, or the tests, or both. This is true across languages, just like how in the professional world you cannot rely on merely code in most cases.

Thank you for wanting to make this a better platform though. That help and energy is very welcome!

4 Likes

@SleeplessByte I understand and very much get the idea of teaching learners the importance of reading docs because thats a big part in a developers journey.

What I want to say is, giving a link to the tests doc page in the local mode setup docs can improve the fast setup and onboarding for new users. Personally I like this idea rather than reading all docs before I can onboard/start solving in my preferred way.

I might come of as aggressively putting my ideas onto the platform when I have 0 to none involvement in it. I wanted to just give my opinion on the matter thats all this is and thanks for understanding that!

1 Like

I’d be happy with a link to the test doc page in the local mode setup docs. Would you like to add that?

I would love to do it but do you have something in mind. I think something like this:

~~~~exercism/note
**Before you submit:** Please review how tests work for your chosen language to avoid common errors. You can find these docs by navigating to [Tracks](https://exercism.org/docs/tracks/), selecting your language, and clicking **Tests docs** in the sidebar.
~~~~

Edit: This goes under the Solving the Exercise

Note, there’s no penalty to submitting code that fails the tests. It doesn’t particularly matter if you read that before you submit or after you submit.

I don’t understand what you meant by this. Do I have to add this “there’s no penalty to submitting code that fails the tests” or are you telling me this is unnecessary?

Anyway I made the PR to add this.

The docs for local setup already has all the steps to solve an exercise except for tests. Because tests behave differently in local setup, giving hint about it on local setup doc would be great.

I mean the docs are worth reading but you can read them after you submit the solution, too. The wording makes it sound like it’s important you read before submitting, as though submitting incorrect code is “bad” somehow.

Note, there’s a link to the track docs on the track’s main page, too, eg https://exercism.org/tracks/javascript. See the right pane under “Stuck? Explore our docs…”

I understand that incorrect code is never wrong because thats how I learned too. What I am saying is “Giving a link about test is good for faster onboarding for new users”. This is from my POV because I have been on several problem solving and learning platforms all of them have faster onboarding for new users.

I saw all the different places tests mentioned but the local docs didn’t even have a hint on that. The platform tests are unique, So when all the steps like “Download CLI” to “Submit exercise” is mentioned in the local docs so why exempt the test step.

Edit: Tests are important in offline mode because in online mode you cannot skip tests and the tests will fail if any code is wrong but on the other hand offline mode skip tests exist and you can push incorrect codes to the platform. Its not a bad thing but why push bad code if you can just prevent it by knowing about it earlier on.

  • I didn’t saw the stuck section until recently because you have to scroll down just to get to it. Usually I just click on the calender like section to solve problem. It must be a me problem, I am just saying “Just adding a link in local setup docs is a great UX improvement”. If I encountered it anyone can encounter it because Exercism have a ton lot of users and its still growing.