I know that there are a number of tools for analysing .NET code and calculating the coverage, plus identifying classes/methods/properties etc that are never going to be hit.
However, I am trying to clean-up a legacy application that I am certain contains an amount of unused code – however a lot of code is accessed via some arbitrary and complex reflection tecniques that will disguise the intent to the compiler – thererfore any coverage tool that only analyses the compiled code is unlikely to generate any reliable reports on code useage within this application.
Are there any tools that work rather like profilers, whereby they listen to a running application and log what classes/methods/properties are actually hit and generate the coverage based on this data.
I hope Ive made everything clear – thanks in anticipation
You can use the VS2010 Code Coverage tools – they do use Instrumentation (which means reflection won’t trick it). Syed Aslam Basha has a post on it in his MSDN blog on how to enable it for manual testing (which it sounds like you will need to do).
Just remember you will need to click every feature etc. while its running; or just think twice before deleting code – but it should give you a good starting point.