From: <duv...@ya...> - 2005-09-26 20:39:56
|
... From another lazy b... :p (there is no reason you are gonna be the only one) What stops a developper to add //NOCOBERTURA around pieces of code tricky to test ... ? I foresee in the very next future to vizually review the code and add @TODO style comments with requests for refactoring. I would only do that with a copy in an Excel-sheet to copy / paste the information provided to the developper and exact location but I therefore would never dare to open a such box... like adding simply a //NOCOBERTURA The usage of an aspect to open the private constructor could be a simple option if this case appears many times :) \T, --- Mark Doliner <Mar...@sa...> wrote: > I guess I'll try to summarize? > > This is a tough problem to solve. It does not seem like there is a way to heuristically > determine if a class' constructor should be considered a source-line-of-code. There's just no > way to know if the developer intends for the constructor to be called. > > So it looks like we have three options > > a) Use normal source comments (//NOCOBERTURA) to flag lines that should not be counted. This > would mean that cobertura-instrument would need to be aware of your source code. And we would > have to change instrumenting to parse through the source and look for //NOCOBERTURA, which would > slow things down a little bit. It also makes your source code a bit less neat. > > b) Use Java 1.5 annotations to flag things that should not be counted. Only people using Java > 1.5 would be able to take advantage of this. And it would also mean you'd have annotations for > Cobertura sitting around in your compiled classes. > > c) Do absolutely nothing. Having some uncovered constructors sitting around your classes isn't > the worst thing in the world. > > I vote for c. Mostly because I'm lazy :-) It also keeps Cobertura from getting too complicated > (although, from a user standpoint options a and b are pretty simple). > > -Mark > > -- Any fool can write code that a computer can understand. Good programmers write code that humans can understand. Martin Fowler T. : +32 (0)2 742 05 94 M. : +32 (0)497 44 68 12 @ : duv...@ya... Do you skype too ... ? |