From: Scott S. <sco...@gm...> - 2005-06-23 19:34:01
|
Hi, I don't know the answer on the Cobertura internals, but I would point out two things: 1. Your example's return type is void, but I'd assume you meant it to be boolean. 2. The compiler might optimize or reorganize such a simple method into this= : public boolean branchCoverage(boolean b) { return b; } Scott Stirling On 6/23/05, Czechowski, Igor <Igo...@sa...> wrote: > The reason I'm asking is that I think that in certain cases I get faulty > reports regarding branch coverage. > Any help would be appreciated. >=20 > A simple example would solve my problem: >=20 > 1: public void branchCoverage(boolean test) { > 2: if (test){ > 3: return true; > 4: else > 5: return false; > 6: } >=20 >=20 > When can I achieve 100% branch coverage ? > 1) When lines 2,4,5 are executed > 2) When lines 2,3,4,5 are executed >=20 > Thanks > Igor >=20 >=20 >=20 > -----Original Message----- > From: cob...@li... > [mailto:cob...@li...] On Behalf Of > Czechowski, Igor > Sent: Wednesday, June 22, 2005 3:23 PM > To: Cobertura-devel > Subject: [Cobertura-devel] Branch coverage question ? >=20 > Hi, >=20 > Where can I find detailed description of branch coverage that cobertura > measures ? >=20 > Thanks > Igor >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |