Wednesday, February 3, 2010

Test-free features?

@YaronNaveh

At some mature stage of a system development we replace all of these messages:


throw new Exception("should never see this")


with something more customer oriented:


throw new Exception("An error has occur while loading the document. Please verify it is in the correct format. ")


Or even better - doing globalization:


throw new Exception(Resources.UnknownLoginError)


These changes are not expected to cause any non-UI regressions, right?

Consider the case where we originally had this


String.Format("Cannot download url");


And now the documentation guys kindly asked to change to this:


String.Format("Cannot download url {0}", url);


or this:


String.Format("Cannot download url {0} using credentials {1}:{2}", url, user, pass);


A mismatch between the number of tokens in the string to the actual provided parameters may result in this error:


Index (zero based) must be greater than or equal to zero and less than the size of the argument list.


Conclusion: Proofing/Localizing always require running all your tests and doing a regression cycle.

@YaronNaveh

What's next? get this blog rss updates or register for mail updates!

0 comments: