Does anyone have tools or experience with code coverage for PL/SQL. I believe this is possible using DBMS_PROFILER?
Not sure if this is quite what you're after, but in 10g onwards there's a tool to do static PL/SQL code analysis.
Info here... http://www.psoug.org/reference/plsql_warnings.html
Note that it can be enabled at either session or database level.
In my experience it's thrown up quite a few false negatives so far.
I found something useful on http://www.databasejournal.com/features/oracle/article.php/10893_2197231_3 page.
select exec.cnt/total.cnt * 100 "Code% coverage"
from (select count(1) cnt
from plsql_profiler_data d, plsql_profiler_units u
where d.runid = &&runid
and u.runid = d.runid
and u.unit_number = d.unit_number
and u.unit_name = upper('&&name')
and u.unit_owner = upper('&&owner')
) total,
(select count(1) cnt
from plsql_profiler_data d, plsql_profiler_units u
where d.runid = &&runid
and u.runid = d.runid
and u.unit_number = d.unit_number
and u.unit_name = upper('&&name')
and u.unit_owner = upper('&&owner')
and d.total_occur > 0) exec;
There is a package you can install called DBMS_profiler. With this, you can start a profile and Oracle will store data in special tables. Then stop the profile and report from those tables.
http://www.toadworld.com/BLOGS/tabid/67/EntryID/267/Default.aspx has info about checking code coverage using the PL/SQL profiler.
Some helpful info about profiling on 9i or 10g is included in Metalink Article 243755.1 "Implementing and Using the PL/SQL Profiler" for information on profiling code. Grab the prof.zip from the bottom of the article, it has a profiler.sql which will nicely format your results after a profiling run.
More 10g documentation is available here without a MetaLinka account: http://download.oracle.com/docs/cd/B19306%5F01/appdev.102/b14258/d%5Fprofil.htm
If you are running 11g there is a new Hierarchical Profiler documented here: http://download.oracle.com/docs/cd/B28359%5F01/appdev.111/b28424/adfns%5Fprofiler.htm
See SD Test Coverage Tools. We're about to release a PLSQL test coverage tool with the same capabilities as our other tools, including a GUI to display the results on top of your source code, and a generated coverage report that collects details on individual functions as well as rollups for packages.