PL/SQL source lines identified as not feasible are being reported in code coverage metrics #1341
Replies: 6 comments
-
|
Hi @markhawker76 |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thanks for replying quickly. I looked into the information provided by the SYS.DBMS_CODE_COVERAGE package when reporting on a run. I can confirm that the information populated in DBMSPCC_BLOCKS appears to be correct when using the coverage compiler pragma. However I do see the issue, as there is no easy way of identifying executable code within that block (or series of blocks using 'NOT_FEASIBLE_[START|END]' arguments. Many thanks, |
Beta Was this translation helpful? Give feedback.
-
|
It would need to be investigated and developed as an enhancement. What vestion of DB are you using? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I am using Oracle 21c EE with the latest patch set. I searched and found an interesting article from Chris Saxon regarding code coverage using line numbers rather than “execution blocks”. He thought that code coverage by line numbers alone could give false positives — especially if you have the following code scenario: IF func_a() OR func_b() Here there are two execution blocks that may or may not be executed due to short-circuit evaluation. Chris seemed to suggest a line-based coverage could falsely report coverage of “func_b()”, whereas the output of Oracle’s code coverage tools would yield a more accurate outcome. I guess the hard part would be interpreting the data provided by the database into a format a developer can readily understand. If there were a way of representing both line numbers and execution blocks at the same time, perhaps the Oracle code coverage data (if accurate), would be the way to go. Sign me up for helping to test if the utPLSQL team believe it is worth pursuing. Kind regards, |
Beta Was this translation helpful? Give feedback.
-
|
Hi @markhawker76 That way, if only part of the PL/SQL line was covered, it will be indicated in the report. This provides best possible coverage information we can give. |
Beta Was this translation helpful? Give feedback.
-
|
There is another discussion #1336 that also mentions option to use dbms_plsql_code_coverage as primary source of coverage information. With DB version support bumped to 19c and above and implementation, this could also be done. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When I am using the HTML code coverage reporter, I am getting PL/SQL source lines included in the code coverage metrics even though they have been excluded with the compile pragma COVERAGE using arguments 'NOT_FEASIBLE', 'NOT_FEASIBLE_START' or 'NOT_FEASIBLE_END'.
Please could you confirm whether this is expected behaviour or not. If expected, is there another way to exclude these lines of course (apart from removing them completely :-) )
Kind regards,
Mark.
Beta Was this translation helpful? Give feedback.
All reactions