Skip to content
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

Priority of the empty test validation #3

Open
stijnvanhoey opened this issue Dec 11, 2016 · 1 comment
Open

Priority of the empty test validation #3

stijnvanhoey opened this issue Dec 11, 2016 · 1 comment

Comments

@stijnvanhoey
Copy link
Contributor

stijnvanhoey commented Dec 11, 2016

The empty test is prior to all other tests, as it makes little sense to test for any other test when the field is just an empty string. Hence, this test aborts the other tests on a value when an empty string is encountered. It will simplify the implementation, as the other tests do not have to take into account the possibility of getting an empty string as input value. it will also diminish processing time (all empty values are faster evaluated with just a single test).

However, this has a major drawback as well:

When a conditional test is added (if) that includes the specification to decide when empty strings are allowed or not, this model runs into trouble. It requires to add a general empty test as well (empty is - sometimes - possible) and the priority of the empty test will stop the other tests, i.e. the if test is never started.

Therefore, we could decide about having the empty-test not as first priority test. This should be balanced against:

  • all implemented tests will have to properly handle empty strings as input
  • redundant tests will be run against these empty strings
@peterdesmet
Copy link
Member

Can you provide a commented example of this situation? Would be helpful to understand the issue.

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

2 participants