http://qs1969.pair.com?node_id=361821

Further to What is the best way to add tests to existing code?, I need to organise a huge and growing test suite. In particular, I'm eager to learn good ways to map unit test programs to external sources -- such as bug-IDs, test-case IDs, test plans, and so forth.

For example, given a specific bug-ID, could you tell me: a) if it is being tested by the regression test suite; and b) which bit of unit test code actually tests that bug. Ditto for a specific test-case-ID/test plan.

Curiously, for the Perl core, given a particular RT ticket #, there is currently no easy way to tell which of Perl's 80,000-odd tests test for it. Or even if it's regression tested at all. (If you're lucky, you might find a reference to the RT ticket # in code comments and/or change logs).

There's been a lot of interest in code coverage, and Paul Johnson has done a wonderful job with Devel::Cover. What about bug coverage? That is, what percentage of your bug database is covered by your test suite? Which, btw, might make a nice kwalitee measure of CPAN modules.

You might partition your test suite into two pieces: one to test bugs raised in the field; the other to grow in-step with the code as you develop it (i.e. test-driven development). My current plan is simply to insert bug-IDs/test-case IDs in test program comments and Configuration Management change logs. How do you do it?