Buck,
Right clicking on my API program (DPI.GETCLR), and selecting code
coverage (prompt),
My submission command is:
SBMJOB CMD(RUCALLTST TSTPGM(TSB.GETCLR)) INQMSGRPY(*DFT)
So I am using the default options for RPGUnit and running all tests.
The RPGUNIT program run from the command line returns the following:
Success. 45 test cases, 131 assertions, 0 failure, 0 error.
Using Run Full coverage gives me the results described previously
(i.e. coverage of only one test case proven by running with
ORDER(*REVERSE) and getting entirely different results, and also that
the lines which are identified as not covered are definitely being
executed during the RPGUnit run)
Using append to previous result just appends the last run onto the
previous, meaning I will have to run code coverage 45 times with
different TSTPRC parameters to determine the full code coverage of the
Unit test program which seems excessive, especially as this program is
quite small (500 lines) the unit tests for larger functions could be a
lot longer!
In my opinion, the code coverage tool should amalgamate the statistics
for all runs of the analysed program called during the batch execution,
into a single report.
I genuinely dont see the code coverage tool being useful otherwise,
apart from verifying that certain parts of code are being executed when
using certain parameters, this can be done easily in debug.
Regards
Aaron Price
From: WDSCI-L <wdsci-l-bounces@xxxxxxxxxxxx> [mailto:WDSCI-L
<wdsci-l-bounces@xxxxxxxxxxxx>] On Behalf Of Buck Calabro
<kc2hiz@xxxxxxxxx>
Sent: 06 June 2014 16:42
To: wdsci-l@xxxxxxxxxxxx
Subject: Re: [WDSCI-L] RDi 9.1 Code coverage tool - Main Procedure not
covered
On 6/6/2014 9:14 AM, Aaron Price wrote:
I have just noticed that this isnt really compatible with RPGUNIT
anyway, the Coverage report seems to only show the last test case that
is run as part of the process, not the whole run. I just ran the test
cases in reverse order and got a completely different report out, and
lines that are definitely covered bu the Unit test arent shown as
being
hit.
I generally run all my test cases (which is the default action for the
command): rucalltst testsrvpgm tstprc(*all) and I see proper coverage of
each test case.
Are you specifying a subset of the test cases on your rucalltst command?
I'd be interested in understanding the value proposition to this; I'm
fairly new at TDD. In any event, try this small change to your CC
configuration. For those following us, Run > Compiled Code Coverage
Configurations... Code Coverage tab. The default setting for Code
Coverage Results is to Run full coverage. If you tick the Append to the
previous result radio button, CC analysis will accumulate through
several runs.
I just tried it by running one test at a time and the first pass it
showed coverage only for the test which was executed (as expected). On
the second pass, it showed coverage for both tests (as expected).
--buck
As an Amazon Associate we earn from qualifying purchases.