October 01, 2003
URL Canonicalization Testing
Test Cases EverywhereIf you've done any amount of API testing, you've probably built up a list of standard values you use for various datatypes. I always run through the minimum and maximum value, negative one, zero, and positive one anytime I have a numeric value, for example, and for strings I go through the ASCII characters and a couple really long strings. These values don't change very often, so it may seem that hard-coding them everywhere is not so bad. I've found they change often enough (generally because I'm adding additional values), however, that updating all those hard-coded values is a big time sink.
My solution is to encapsulate these values in a collection I can iterate through in my tests. When I add a new value, I only need to add it to one place and then it's automatically picked up by all my tests. This makes it dead simple for others to use the test cases in their tests as well.
M.J.H.
|
|
||||||||||||||||||||||||||||
|
|
|
|