mibuso.com

Microsoft Business Solutions online community
It is currently Sat May 25, 2013 8:56 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Code Coverage - exporting and filtering
PostPosted: Fri Jun 06, 2008 2:02 pm 
Offline

Joined: Wed May 12, 2004 9:24 am
Posts: 214
Location: Malta
Country: Malta (mt)
When using Code Coverage, I would like to:

a) filter out the lines have not been executed (i.e. the red lines)

b) export the lines (actually, just the black lines) to a single text file.

Does anyone konw how to do this?

Thanks,
Alastair


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 2:31 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8704
Location: 3rd rock from sun
Country: United States (us)
filter on "No. of hits" <> 0 then copy and paste them to excel.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 3:14 pm 
Offline

Joined: Wed May 12, 2004 9:24 am
Posts: 214
Location: Malta
Country: Malta (mt)
Hi Rashed,

Thanks for the quick reply.

I realise now that I can even remove the filter on the Object Type and Object No. and this will show me all the executed code in all the objects. Unfortunately, I can't display the Object Type and Object No. - the only column that shows in "View Columns" is Code. If there is a way of showing those fields that would be great.


Regards,
Alastair


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 3:50 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8704
Location: 3rd rock from sun
Country: United States (us)
design the form and add the fields to the form.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 4:09 pm 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
ara3n wrote:
design the form and add the fields to the form.


This is useful! :)

_________________
Tomas,
Dynamics NAV Enthusiast


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 5:43 pm 
Offline

Joined: Wed May 12, 2004 9:24 am
Posts: 214
Location: Malta
Country: Malta (mt)
OK, thanks for that. Here's all the steps (I just sent this out to the other developers I work with because I think it will be quite useful):

1. Design the Code Coverage form (Form 566) and add the fields Object Type and Object ID.
Add some documentation, save and close the form.

2. Go to Tools – Debugger – Code Coverage – Code.

3. Press Ctrl+F7 to view the filters.

4. Remove the filters for Object Type and Object ID (so that you can see code for all the objects together – you can identify which code is for which object thanks to the fields added in step 1 above).

5. Add a filter for No. of Hits, <>0 (this will show only the black lines).

6. If you want you can even copy the lines to Excel.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 10, 2008 9:32 pm 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7504
Location: Milan
Country: Italy (it)
[Topic moved from Navision forum to Navision Tips & Tricks forum]

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 11, 2008 12:01 am 
Offline

Joined: Thu Jul 17, 2003 10:52 pm
Posts: 638
Location: Capelle a/d IJssel
Country: Netherlands (nl)
What you're missing in code coverage is the sequential order in which code is executed.

_________________
Create dynamic Excel or Word documents, ReportX


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 11, 2008 2:34 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8704
Location: 3rd rock from sun
Country: United States (us)
That is what you use client Monitor for.

Also if you use SQL perform tools. It combines Code coverage with client Monitor so you can debug those really bad code and loops.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 11:56 am 
Offline

Joined: Sat Dec 08, 2007 10:35 am
Posts: 62
Location: Coimbatore
Country: India (in)
This Really Good Tips =D> =D> =D>


Top
 Profile  
 
 Post subject: Re: Code Coverage - exporting and filtering
PostPosted: Mon May 24, 2010 4:19 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Mon Dec 11, 2006 10:34 am
Posts: 2863
Location: Bergamo
Country: Italy (it)
i've never find the "no. of hits" very reliable, because the "if" statements (and all the code that does not start and end in the same line), are shown as never hit. (edit: this does not depend from the semicolon, as i wrote before) this makes the code coverage less useful, because you won't see the whole line of code, but only the second(or third or fourth) one
edit: [removed a wrong example and replaced with this one]
Code: Select all
Code
  WITH VATAmountLine DO  //hits=0
    IF FINDSET THEN//hits=1
      REPEAT//hits=0
        IF (PrevVatAmountLine."VAT Identifier" <> "VAT Identifier") OR//hits=0
           (PrevVatAmountLine."VAT Calculation Type" <> "VAT Calculation Type") OR//hits=0
           (PrevVatAmountLine."Tax Group Code" <> "Tax Group Code") OR//hits=0
           (PrevVatAmountLine."Use Tax" <> "Use Tax")//hits=0
        THEN//hits=1
          PrevVatAmountLine.INIT;//hits=0

_________________
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: