function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shunsuke Gimba (銀羽 俊介)Shunsuke Gimba (銀羽 俊介) 

How to get data of Code-level Apex Coverage by Apex Test Class result?

Hello. I'm not good at English...(I'm from Japan.)
Have you viewed Apex Test Class Result with Apex Code highlighted in blue and red?
I want to create the same thing at Local Program. The language is VB.net.
The purpose is to create Test Class more Efficiently.

I knew that about Apex Test Class, we can get these data by soql.
・ApexTestQueueItem
・ApexTestResult
・ApexTestResultLimits
・ApexTestRunResult
・ApexTestSuite

I couldn't find any properties directly reffering to 'which code-line is covered'.
So, my idea to realize this is as below.

1. query ApexTestResult->ApexLogId
2. query ApexLog using previous id.
3. parse Apex Log
4. collect 'STATEMENT_EXECUTE' type log with code-row-number.
5. view Apex Code, and highlight collected code-rows-number.

Then, there is a problem.
I saw many time Apex Logs by Apex Test Class execution contains so many Log Rows, 
that leads to loss of Log Rows. (Salesforce says this loss of log is by design.)

Do you have any good idea to realize my idea?
Thanks for read.