Should I Use a Code Coverage Tool?
Asked Answered
O

4

6

I'm interested in using a code coverage tool for my next .NET project but was wondering if it is necessary for me? I'm the only developer in the company I work for, so would using NCover be a benefit to me or is it just for large teams using continuous integration? Thanks

Oliy answered 28/5, 2009 at 4:49 Comment(1)
Thanks for the replies! Everything you guys said makes sense. Why not just go for it? It can only help me and further me as a developer. :)Oliy
O
9

I would say go for it. Analyzing code coverage can help even a single developer, maybe even moreso than a team, since you basically have the whole system on your shoulders. If you're the only developer, you have full control over what tools you use, and how you want things setup. Once/if more developers are added, you'll have all the tools in place to create quality software.

Ontiveros answered 28/5, 2009 at 4:52 Comment(0)
T
2

If go to the effort to write automated tests, then definitely use a code coverage tool to get an idea about how which areas of the code base those test cover.

Viewing code coverage as you write tests is also helpful in ensuring that your tests are actually testing what you think they are.

The overhead of measuring code coverage compared with the overhead of writing tests theses days is so small, that it doesn't make sense to write tests, and then not view the coverage of those tests.

Toreutics answered 29/5, 2009 at 5:4 Comment(1)
Good call. If you already have unit tests, ignoring coverage is pretty silly. I've found that checking code coverage always improves my tests, (since I find out immediately what's being run and fix what isn't) and by extension, the quality of my software. Good coverage isn't a silver bullet, but it does tend to increase your confidence in your tests, and can help focus your testing efforts by avoiding redundant tests and missed corner cases.Arlenearles
F
1

Caleb,

In case you don't already know, Visual Studio 2008 Team System Editions of VS2008 can do code coverage for you. It's not as comprehensive as NCover, but it should be a great start for you. If you like what it does and you want more bells and whistles, than I don't see why not. (It's only $200 for the classic edition the last time I checked).

-Artel

Ferino answered 28/5, 2009 at 4:58 Comment(0)
I
1

Of course you should use it. It's always another tool to help you. But remember, code coverage isn't the most important thing when testing your code. You will get a number of lines of code that are covered with tests, but that doesn't mean that your code is bugproof there. Use ncover to find places that have little or no coverage.

Irritate answered 28/5, 2009 at 5:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.