On Fri, 02 Jul 2010, Karen Etheridge wrote: > On Fri, Jul 02, 2010 at 06:46:24PM +0200, Leon Timmermans wrote: > > My suggestion would be to make sure all new code examples are > > properly tested by unit tests, and incrementally try to make that > > true for old code examples. Examples with bugs in them are rather > > embarrassing. > > I really like that idea! Each perldoc document could be backed by a > parallel unit test file, which could also serve as useful instruction > to the reader on how to write good tests.
I would rather see some framework that takes the sample code directly out of the POD. Otherwise you end up with the maintenance issue of the documentation and the tests being out-of-sync. Having tests that don't actually test what you think they do is often worse than no tests at all because they give you a false sense of confidence. Cheers, -Jan