IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
  • No replies
1 Post

Pinned topic First impressions

‏2015-03-20T21:37:13Z | feedback

Thank you for the RDi TOA beta!  It's very cool as an RPG programmer to be able to see code coverage come to IBM i.  I completely understand that this is a beta, and I'd like to share my first impressions while the memory is still fresh.

1) It's pretty easy to set Code Coverage in RSE

2) I have Preferences > Run/Debug > IBM i Debug > Terminate debug session on program completion UNchecked so I can debug SQL UDTFs.  This means that I need to click the 'Stop' icon when the program has finished running.  This results in an ominous looking (but harmless) message telling me that I manually stopped the debugger.

3) The colour coding of the RPG source in the Code Coverage report is... unusual.  /free specs aren't coloured at all, and fixed specs look like the tokeniser is off by a few columns.

4) CC properly treats EXEC SQL DECLARE CURSOR ... FOR ...; as declarative / non-executable code. Yay!  In general, CC does a very good job identifying comments, blank lines, declarations and other non-executable code. 

5) CC thinks BEGSR and ENDSR are executable, but they get marked as 'run' when the subroutine is invoked.

6) I have O-specs in the first program I tried this on.  They are all marked as 'not run' even though the report was produced.  I suspect this is because of H OPTION(*NODEBUGIO) so I recompiled the program to use *DEBUGIO and reran CC.  The coverage went from 79% to 94% which picked up all of the O-specs except for marking the OR lines as 'not run'.  Interestingly, the F-spec for the printer file is not marked; does CC think it's a declaration?

7) The only actual puzzler is that a DOW 1=1; line is marked 'not run' but the corresponding ENDDO; is marked 'run'.  This particular program uses a giant DO loop to FETCH rows from an SQL cursor.  The first DOW is the only line of calculations that was marked 'not run' in error.  All the other lines were correctly marked 'run'.  They are a mix of free and fixed format calculations, just for the record.

8) The F-spec for a database file this program WRITEs to is marked 'run'.  It was in fact used, so Yay!

In all, the code coverage looks pretty sweet.  Now I need to get cracking on a more realistic scenario - a service program.