Free text fields - testing validations for string length, etc.

  • 1
  • Question
  • Updated 5 years ago
My application has a lot of free text fields. How do I test for them in Hexawise? Most if not all in my apps have some form of validation on input as well as max char string length etc. Should those items become the values in the plan?
Photo of Gonzo


  • 1 Post
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of Justin Hunter, Hexawise Founder

Justin Hunter, Hexawise Founder, Founder and CEO

  • 246 Posts
  • 15 Reply Likes
Thank you for your question!

There are several ways to address this:

Last week, Sean told a Hexawise user the following:

"Typically you'll include the free text field as a parameter, and then reflect those validations as values. For example, suppose your field is called "Memo". If that's interesting to test in your test plan, you might add a parameter called "Memo" with the following 6 values: "valid memo, too long memo, too short memo, memo with valid special characters, memo with invalid special characters, blank"
I made those values up of course, you'd use values applicable to your system and the validations you're testing for. Hope this helps!"


Additional variations to consider include the following: 

Depending upon the behavior/rules you're trying to test, one strategy could be to define inputs like these (which do not include specific values):

Field 1: valid, invalid, blank
Field 2: valid, invalid, blank

Or, for weighting purposes:

Field 1: v, v, v, v, i, b
Field 2: v, v, v, v, i, b

Or, alternatively, could be a strategy like this (using nothing but valid values - each being an equivalence class that would/could sometimes lead to different system behavior):

Income: high, medium, low
Credit Rating: bad, OK, good

And, for that matter, a third approach could be to use specific values that would be a combination of specific valid and specific invalid values:

Income: -100, 0-100, 101-300, 301-500
Credit Rating: -345, 0-400, 401-800, 800 - 20000