problem-specifications
problem-specifications copied to clipboard
say: canonical-data needs improvement.
In the canonical data for the "say" problem: https://github.com/exercism/x-common/blob/master/exercises/say/canonical-data.json
- The descriptions should be descriptive.
In most cases the description is the same as the output.
{
"description": "zero",
"input": 0,
"expected": "zero"
},
The description should describe the test, and why it is useful to test that particular number.
- Should test all available numbers.
A purely test driven implementation of these tests would miss out a lot of numbers. (particularly the teens and tens)
I agree that the current descriptions are not great. The problem them becomes: what does make for good descriptions? For zero, I don't think there is a much better description. For one, we could do "number less than ten", for fourteen we could do "number between ten and twenty", but 🤷
This one seems like one where many individual cases don't have useful descriptions; instead they belong to a group of cases, and the group has a useful description. For example, groups like "ones place", "teens", "tens place".
I like that suggestion!
I like that as well, particularly because crossing one of those case boundaries results in distinct formatting changes -- the numbers within them are an equivalency class.
So then there would also be a "above 100's place" that would highlight the formatting change for thousands, millions, and so forth.
Yep. We should have all the edge cases listed.