Using test section to help with code

so i basically look at the test like when i dont understand the instructions properly i look at the test and try to understand the instructions better with the inputs and outputs in test, should i avoid doing and just try to rely on only instructions given or this is how it should be hmm. (i am doing the python track btw)

I usually find it’s essential to look carefully at the tests. They give a lot of low-level detail that isn’t spelled out in the instructions. Python is pretty flexible, but this will be even more important with languages that do careful compile-time checks.

2 Likes

This is explicitly part of how this track is meant to be used. See the track docs on TDD.

1 Like

Definitely look at the tests. Done well, they are a form of documentation about how a thing (function, HTTP endpoint, whatever) should be used – how it should be called, and what the result should look like.

Ideally there should be enough instruction in the README to construct your own test suite. That’s one of the things I do to mentor junior devs, have them do that without first looking at the one Exercism supplies, then compare and contrast. But sometimes the README glosses over details like the exact types of args and return values, in languages where that matters. Oh well. Whether the intent of Exercism is such that the README should indeed be so complete, is another debate.

1 Like