Nils-Helge Garli Hegvik on 28/04/08 17:51, wrote:
- Don't get caught up in the code coverage hysteria. Focus on writing
good tests instead of how many lines and branches of code you have
tested.

 I've no idea what level of code coverage Nils holds to be hysterical, but I
wouldn't take his advice to mean you should avoid code coverage analysis.


What I meant is that it can easily be misused. Code coverage is a nice
tool for guidance, to identify areas that needs improvement - I use
them myself too. But it's easy to get caught up in the idea of
increasing the coverage percentage just to increase the percentage of
coverage, if you understand what I mean. I don't think looking at a
coverage report and write a test just to cover that one line of code
will necessarily lead to a better tested code base. As long as you
focus on writing good tests, coverage will naturally become better.

You're totally right, that's a good skill to have, along with writing code that can be tested easily.

Back to code coverage statistics, high coverage is something I always like to see in other people's code, but not necessarily something I feel is right for my own!!! Seriously though, good coverage statistics on an open source project is a great advert.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to