problem-specifications icon indicating copy to clipboard operation
problem-specifications copied to clipboard

say: canonical-data needs improvement.

Open Insti opened this issue 8 years ago • 5 comments

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)

Insti avatar Jan 17 '17 08:01 Insti

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 🤷

ErikSchierboom avatar Jan 26 '22 13:01 ErikSchierboom

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".

petertseng avatar Feb 02 '22 12:02 petertseng

I like that suggestion!

ErikSchierboom avatar Feb 02 '22 12:02 ErikSchierboom

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.

BethanyG avatar Feb 02 '22 17:02 BethanyG

Yep. We should have all the edge cases listed.

ErikSchierboom avatar Feb 03 '22 07:02 ErikSchierboom