views:

145

answers:

3

Hi,

I have a MS Visual Studio 2005 workspace, all C code. I want to find all the functions in that code, which are not called/executed when a certain test case is executed.

What is the way to get that using

1.) MS VS 2005 itself or MSVC6.0 ?

2.) Using some other tool?

-AD

+2  A: 

Might want to look into the code coverage tool in VS 2005 Team Edition. There's an FAQ on it here

There's another tool out there called ncover that looks like it does something similar as well. Seem's pretty expensive, but they do have a 30 day trial.

I'm sure others will chime in with other tools that might fit the bill as well.

Eric Petroelje
A: 

Use a code profiler. Any good code profiler should include coverage tools to give you an idea of what was called and what was not called.

plinth
+1  A: 

Assuming your test case is in a VS2005 test project, you should be able to use the 'code coverage' feature.

On the menu choose Test->Edit Test Run Configuration ()

From here select CodeCoverage tab to the left, then check the DLLs or EXEs that contain the code you wish profiled.

Next run your test, and on completion, you should be able to select Test->Windows->Code Coverage

This gives you some metrics on the coverage such as lines executed, and you call also double click entries, to jump in to a file and have onscreen highlighting of the code that was or was note executed

MattH
Hi Matt,I do not have that Menu Test->Edit ... you mentioned. I have MSVS2005 PRofessional edition. I do not see the main menu Test itself. Am i missing something?
goldenmean
That feature probably isn't available on the professional edition - you would need team edition for that.
Eric Petroelje
I'm using Team System, Development edition. I would assume this isn't a feature of your version if you don't have the menu at all, I assume you can't run unit tests, or create unit test projects with your version?
MattH