problem-specifications
problem-specifications copied to clipboard
Tournament - add non-error test case with a different team name
For the tournament exercise, one of my students took the team names from the instructions and hard-coded them in the source code. Despite this, his solution passed all the tests. I believe this is because in all of the "non-error" test cases, the team names are the same as in the instructions. To discourage this hard-coding of team names, I would suggest to either
- add a non-error test case with different team names, or
- to change (at least) one of the team names in one of the existing non-error test cases.
Changing test cases is not allowed according to the spec, so (2) is not an option here.
Perhaps you could open a PR that adds such a case?
As a side note in case you're newish to Exercism: the tests on Exercism generally assume that the student is actually willing to learn and doesn't try to "cheat" the exercises, that's why a lot of exercises don't check for completeness and don't have guards against hardcoding solutions. You will encounter the same issue in many exercises.
I will open a PR.
Thanks for the side note - I understand. I guess it still makes sense to have test cases that reduce the chance that certain poor coding practices happen. But maybe "hardcoding test data" is something the automatic code analysers could catch (sometime in the future)?
I guess it still makes sense to have test cases that reduce the chance that certain poor coding practices happen.
Yea, I agree