Documentation Coverage Testing With dcov
How often have you thrown up your hands in disgust at the poor quality of documentation for an open source project? Wouldn’t it be nice if someone put together a documentation coverage tool that worked like test coverage too ls? Well, you’re in luck—dcov is here (at least for Ruby code).
dcov is still pretty immature (the current release is called ‘Young and Feeble’), but it’ showing a lot of promise. It’s already capable of verifying that each module, class, and method of your code is documented. The upcoming release adds coverage checking for each parameter to a method (and other goodies, see below).
One of the biggest problems with writing generic documentation coverage tools is that there is a real lack of standards for documentation. Jeremy MacAnally, the author of dcov, is trying to build some consensus on this. Take a look at his blog post on the topic. (Feel free to toss in your own two cents while you’re there.)
In the upcoming release, dcov provides a mechanism for writing your own analyzer—it’s still rough, but it looks a lot like an RSpec specification. Here’s the way Jeremy’s implemented parameter checking using the new mechanism:
documentation_for_methods do |the_documentation|
the_documentation.must "document all parameters." do
param_names_for(the_documentation.token).each do |param|
the_documentation.token.reporting_data[:parameters_without_coverage] <
;<
param[0] unless
the_documentation.token.comment.include?("#{param[0]}")
end if the_documentation.token.params
end
end
With this new feature, it should be easy to adapt dcov to whatever documentation standards exist within your own organization.
Jeremy has been working on dcov as part of the Google Summer of Code, he’s being mentored by Chad Fowler.
-- -pate http://on-ruby.blogspot.com
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Parallel Programming with NVIDIA CUDA
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Linux-Based X Terminals with XDMCP
- Validate an E-Mail Address with PHP, the Right Way
- You Need A Budget
- Why Python?
- The Linux powered LAN Gaming House
- Python for Android
- I use Wireshark on a daily
1 hour 4 min ago - buena información
6 hours 10 min ago - One important "bucket" that I didn't note (désolé si qqun deja d
7 hours 11 min ago - Gnome3 is such a POS. No one
16 hours 38 min ago - Gnome 3 is the biggest POS
16 hours 49 min ago - I didn't knew this thing by
22 hours 53 min ago - Author's reply
1 day 2 hours ago - Link to modlys
1 day 3 hours ago - I use YNAB because of the
1 day 3 hours ago - Search
1 day 8 hours ago





Comments
Dcov is something we need
Thanks, I've checked out his blog, and hope that dcov will continue to improve upon itself. Keep us all posted as to it's progress
John
Thank you for an analyzer
Thank you for the article. It was very informing. A problem of document always was. I am above what to think.