>Importance of Tests

>Today while fighting the undead for BLITEOTW day, I managed to fix about 491 failing unit tests for the W3C XPath 2.0 test suite. Formatting of XSDouble and XSFloat values were causing some of the biggest pain. However the big nightmare was getting xs:gDay, xs:gMonth, and xs:gMonthDay date creation setup right. This is where the importance of tests, and a guide test suite comes in. With out the tests, it would have been a crap shoot making sure we had things setup correctly. With out tests that can be re-run time and again, you have no way to know that you aren’t doing more harm than good when changing your code. Reading specifications, and coding to how you think it should be done, is not the same as actually running that code against a test suite.

Testing Status for PsychoPath against the XPath 2.0 Test Suite is as follows:

Tests: 8139
Failures: 2500
Errors: 87
Code Coverage: 75.2%

As I’ve mentioned before, when I started out testing, we only had about 20% code coverage, and we failed nearly 6000 of the tests. If you are writing against a specification and it has a test suite that is commonly used to check compliance, take the extra time to run your implementation against the test suite. It helps to make sure your implementation is interoperable with others. It will make your consumers happier, as well as any adopters that may be building off your implementation. Oh and Publish your results.

It takes time. It isn’t glorious. The effort can pay dividends later. Oh and thanks to Nick Boldt for letting me know about BLITEOTW.

Advertisements
This entry was posted in bliteotw, eclipse, xml. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s