commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [ALL] jacoco-maven-plugin advantage over cobertura-maven-plugin (CODEC-161)
Date Wed, 30 Jan 2013 14:59:44 GMT
Is Cobertura dead? I'd prefer to keeping using a FOSS test coverage tool
instead of one behind a license (Clover). Should we switch to Clover (we
have a license for Apache)? What about Emma?

Thoughts?

Gary


On Wed, Jan 30, 2013 at 7:00 AM, Bruno P. Kinoshita <kinow@apache.org>wrote:

> Hi all,
>
> I preferred to write to the mailing list with an [ALL] component tag
> instead of commenting a resolved issue. I apologize if it was not the right
> choice.
>
> In CODEC-161, the following if statement could never reach 100% coverage
> with cobertura-maven-plugin:
>
> if ((sumLength >= 5) && (sumLength <= 7))
>
>
> The branch where both boolean expressions are false can never be covered
> with cobertura instrumentation, even when the whole interval is tested (<5,
> >=5, <=7 and >7). As Sebb pointed out, this could be rewritten as:
>
> if (!(sumLength < 5 || sumLength > 7))
>
>
> And then cobertura-maven-plugin could reach 100% coverage. There is
> already an issue in cobertura-maven-plugin for this [1], but looks like it
> won't be fixed any soon.
>
> However, using jacoco-maven-plugin, it correctly interprets that the whole
> interval is covered, without the need to rewrite the if statement.
>
> Also, using -Djacoco.skip=true skipped the jacoco execution (I think the
> cobertura-maven-plugin has some issues skipping its execution in maven).
>
> The jacoco-maven-plugin is still in 0.6.1.20121212... version, but it may
> be useful in case a component has problems with the cobertura-maven-plugin.
> Sonar supports jacoco too.
>
> In case someone would like to try, there is a sample project with junit +
> jacoco-maven-plugin in github [2].
>
> Cheers,
>
>
> [1]
> http://sourceforge.net/tracker/?func=detail&aid=3097325&group_id=130558&atid=720015
> [2] https://github.com/kinow/tests-for-coverage
>
> Bruno P. Kinoshita
> http://kinoshita.eti.br
> http://tupilabs.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message