20

I am in the process of writing unit tests for someone else's code. Right now, I am just sort of looking through all the classes of the main code branch to see if I have written tests to cover all cases. What sort of tools exist that could aid me in this to see how many more tests I still have to write?

  • This question is really about code coverage. Unit tests are just a way to exercise the code, for which one might want code coverage. There are many other ways to exercise code, for which one might also want code coverage. – Ira Baxter Jun 6 '15 at 9:32
10

StackOverflow has a rather extensive post which details many of the available code-coverage solutions for C#/.Net. Content reproduced below, and all credit should go to the users of SO:

  • NCover
  • Visual Studio (2008 Pro) | (2005 Team System (Development, Test or Team Suite Editions))
    • Well, it's Microsoft so I'd expect it to work properly
    • Fully Integrated into Visual Studio
    • At least $5,469
  • PartCover
    • Open Source
    • Supports statement coverage
  • OpenCover - successor to PartCover
    • OpenSource
    • Supports branch and statement coverage
    • 32 and 64 bit support
    • Silverlight support
    • Background
  • SD Test Coverage
    • Works with 32 and 64 bits
    • Works well in embedded systems (e.g, phones) and with Mono
    • C# versions 1.2 thru 7.2
    • Handles both small and very large code bases
    • $250 for single user license
  • JetBrains dotCover
    • $100 for Personal License
    • Supports statement coverage
    • Silverlight support
  • NCrunch

    • $159 for personal license
    • $289 for commercial seat license * Free during beta, to become commercial, pricing unknown future unknown.
    • Code coverage indicators in Visual Studio
    • Continuous (near real time) testing
    • Visual per-test code coverage
    • Performance metrics, parallell multi-core test execution
  • NDepend

    • $410 for developer license
    • NDepend can import coverage data from NCover, DotCover, Visual Studio 2013, 2012, 2010 and 2008 Code Coverage files.
    • Dependency Graph
    • Dependency Structure Matrix
    • Visualizing Code Metrics
    • Validating Code Rules
1

My team and I use Typemock's Isolator. It's a unit testing framework with some nice features, one of them is code coverage. We are very satisfied with this product.

-1

Squish Coco

  • Coverage levels up to MC/DC and MCC
  • Compare coverage delta between tests
  • Calculate optimal test execution order
  • Pre-commit and post-commit patch analysis
  • Supports C++ and C in addition
  • 300 Euros per licenses. Available in batches of five.

(Disclaimer: I'm working for the vendor of above tool)

  • 1
    Please disclose your affiliation with Squish Coco. – RockPaperLizard Feb 3 '18 at 3:11
  • And also name the pricing conditions. If I'm not mistaken, this one doesn't come for free. – Izzy Feb 3 '18 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.