6 Replies Latest reply on Sep 23, 2014 7:34 PM by user577296

    code coverage statistics

    user577296

      I am not able to see any Test Run Code Coverage, when I put in values for bind variables it shows nothing.

       

      I queried data from UT_TEST_COVERAGE_STATS, it has lot of data populated.

       

      Does anyone know what I might be missing? I am using Version 4.0.2.15 SQL Developer.

        • 1. Re: code coverage statistics
          user577296

          Could someone from SQL Development team please reply to this thread?

          • 2. Re: code coverage statistics
            thatJeffSmith-Oracle

            Try debugging your report.

             

            Copy it down to the user defined reports. Open the report, grab the query, and run it.

             

            See anything amiss?

            • 3. Re: code coverage statistics
              user577296

              Thanks Jeff for your reply, I am not able to copy this report. Actually do not see that report in Reports Tree anywhere.

               

              Let me provide you some more information, I am trying to do Unit Testing in SQL Developer and trying to look at Unit Test window under Reports>Unit Test Runs>Test Runs Code Coverage.

              • 4. Re: code coverage statistics
                thatJeffSmith-Oracle

                Apologies, I forgot those reports aren't accessible out of the Unit Test UI.

                 

                Here's the query we run to get the unit test coverage, LINES COVERED

                 

                select

                                        ul.unit_owner as "Unit_Owner",

                                        ul.unit_name as "Unit_Name",

                                        ul.suite_name as "Suite_Name",

                                        count(*) as "Total_Lines",

                                        count(all decode(ul.total_occur + ul.total_time, 0, null, 1)) as "Lines_Covered",

                                        ul.run_date as "Run_Date",

                                        ul.utsr_id as "Run_Id"

                                    from

                                        (

                                            select

                                                sr.utsr_id,

                                                sr.run_date,

                                                sr.name as suite_name,

                                                s.unit_owner,

                                                s.unit_name,

                                                s.line,

                                                sum(s.total_occur) as total_occur,

                                                sum(s.total_time) as total_time

                                            from

                                                ut_suite_results sr,

                                                ut_suite_item_results str,

                                                ut_test_results tr,

                                                ut_test_impl_results tir,

                                                ut_test_coverage_stats s

                                            where

                                                (:Unit_Owner is null or s.unit_owner like :Unit_Owner) and

                                                (:Unit_Name is null or s.unit_name like :Unit_Name) and

                                                sr.status = 'UT_SUCCESS' and

                                                str.utsr_id = sr.utsr_id and

                                                str.utr_id = tr.utr_id and

                                                tr.utr_id = tir.utr_id and

                                                tir.utir_id = s.utir_id

                                            group by

                                                sr.utsr_id,

                                                sr.run_date,

                                                sr.name,

                                                s.unit_owner,

                                                s.unit_name,

                                                s.line

                                        ) ul

                                    group by

                                        ul.utsr_id,

                                        ul.run_date,

                                        ul.suite_name,

                                        ul.unit_owner,

                                        ul.unit_name

                                    order by 1, 2, 3, 6 desc

                1 person found this helpful
                • 5. Re: code coverage statistics
                  user577296

                  Hi Jeff,

                   

                  Could you please provide me query for Test Runs Code Coverage? This query looks like its for Suite Runs Code Coverage.

                   

                  Appreciate your help.

                  • 6. Re: code coverage statistics
                    user577296

                    Never mind, I was able to tweak the query for Test Runs.

                     

                    Thanks for your help.