Active Topics Memberlist Calendar Search Help | |
Register Login |
One Stop Testing Forum : Types Of Software Testing @ OneStopTesting : Unit Testing @ OneStopTesting |
Topic: Unit Testing Your Documentation |
|
Author | Message |
papri
Newbie Joined: 05Apr2007 Online Status: Offline Posts: 1 |
Topic: Unit Testing Your Documentation Posted: 05Apr2007 at 2:55am |
When O'Reilly editor Mike Loukides contacted me about co-writing the,
I was apprehensive. I wasn't worried about the size of the project; I
was concerned about quality.
At first, I thought it would be especially difficult to ensure the quality of a cookbook. Instead of a few application-sized examples illustrating a few coherent topics (say, database access in Java), we had to test 350 separate pieces of code on 350 wide-ranging topics. As with a software project, we had deadlines to meet. Worse, due to the structure of our contract and the scarcity of proofreader time, this book was essentially a Waterfall project. Up to the very end, our focus was on getting everything written, with some time allocated afterward to edit the text and code. This isn't quite as crazy as it sounds, because bad text is easier to whip into shape than bad code, but it meant I didn't have a lot of time to spend on building test infrastructure. Fortunately, despite my early misgivings, the Cookbook format
actually made the individual recipes easy to test. I was able to turn
pre-existing features of the recipes (the worked examples) into unit
tests. I ran the tests in an instrumented Thanks to the test framework, on a good day I could proofread, debug, and verify the correctness of 30 recipes. I worked faster and with greater confidence than I could doing everything by hand. I was also able to incorporate the test results into the general "confidence score" calculated for each recipe on my In this article, I present a simplified, cleaned-up version
of my testing script. It parses recipe text into a set of code chunks
and assertions. It then runs the code chunks in an instrumented Edited by moderator - 19May2008 at 5:56am Post Resume: Click here to Upload your Resume & Apply for Jobs |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.