Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] finding dead code in C projects



Greg Rundlett wrote:
> I'm wondering if anyone has success stories about finding dead code in
> large (C) projects?

I don't deal with C/C++ enough to have specific tools to recommend, but
the general principle should be something like:

1. develop comprehensive unit tests;
2. execute unit tests in a profiler;

The reports generated by the profiler will then point to the source that
never gets used. Then a developer can then do a bit of manual
investigation to confirm that it looks like that code path will never be
executed or if it is a deficiency in your unit tests. (You'll probably
also turn up a pile of previously unknown bugs in the code as a byproduct.)

Regardless of what tool you use to identify "dead" code, you'll want
unit tests to give you confidence to hack out the stuff you think is not
useful while not breaking anything that matters.

 -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org