4 Replies Latest reply on Feb 13, 2015 7:44 AM by petery009

    How you do validation and testing?


      Hi all


      I just realized that i don't care much of validation of a filed, for example, if i know it's a number field like amount, i just put the type as number, in fact, user can put text in it.


      another question , when i write a code to do something, i don't really think all the possible scenarios that could make it fail. i just make sure it works if user do this or that.


      I know i was not doing enough. so can anyone share what they do for validation and testing?


      Or just point me to some direction. Appreciated.




        • 1. Re: How you do validation and testing?
          Stephen Huston

          Number fields which don't require strict number types can result in invalid indexing, but a few number-like fields, such as zip codes need to be text if they are to allow for zip+4 and still sort correctly.

          I tend to enforce strict numeric type requirements on number fields. This also makes users realize when they are entering the wrong stuff in a field.

          Dates also need to be validated as dates or they end up full of garbage. [GIGO]

          Text fields are very loose in what's generally allowable, but you should enforce the validation rules which may actually matter, like not allowing LastName fields to be left blank in personal records, etc.


          My general rule is to enforce rules on fields where the record will not be useful if things are omitted, as well as protecting non-text data types from being misused.

          • 2. Re: How you do validation and testing?

            Thank you Stephen.

            • 3. Re: How you do validation and testing?

              Validation criteria is, or should be, a significant item in developing requirements for a system. That is to say every customer or project can have vastly different validation and validation handling requirements. Their is no one best way to do it. A good developer won't eschew validation settings because of a knowledge gap.

              Testing requirements and procedures can pivot on the crucial question of how much pain is tolerable if a solution fails to perform. You've got to consider everything including loss of reputation as a developer.

              • 4. Re: How you do validation and testing?

                Thank you Coherentkris.