Skip to content

Edge cases for tests? #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
budmc29 opened this issue Jan 4, 2018 · 3 comments
Closed

Edge cases for tests? #1071

budmc29 opened this issue Jan 4, 2018 · 3 comments

Comments

@budmc29
Copy link
Member

budmc29 commented Jan 4, 2018

Should we test edge cases and invalid input in our tests?

As an example we have: https://github.com/exercism/problem-specifications/blob/master/exercises/armstrong-numbers/canonical-data.json

Should we add the following tests to that track and others that are similar (consider it a more general qustion, but this example is specific)?

  • Missing input (caling the method with no argument)
  • Negative input
  • Invalid input (ex: "----")

I see we have some specifications that cover negative numbers for example, but not all of them.

As far as I am concerned the tests are good as they are, and I don't want to over complicate things or go into too much details.

The reason why I think this might help, is that it will help user handle parsing input.
For example in bash, if you don't force the user to handle the input he might not bump into the fun world of passing input from CLI to functions, and handling whitespace, comparing string with integers or handling arguments with spaces.

@NobbZ
Copy link
Member

NobbZ commented Jan 4, 2018

We settled once to not test for inputs that are not possible to create in any reasonable type checking compiler.

You simply can't pass a string as a number or too many or to less arguments in such systems.

If though a language that allows to pass in strings for numbers such edgecases should be added to the canonical tests by that tracks maintainers.

@rpottsoh
Copy link
Member

rpottsoh commented Jan 5, 2018

refer to #902.

@budmc29
Copy link
Member Author

budmc29 commented Jan 7, 2018

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants