FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2003

URL Canonicalization Testing

(Page 12 of 16)
Test Cases Everywhere

Test Cases Everywhere

If 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.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK