Re: PITEST - Exclude logging from mutations

1,451 views
Skip to first unread message

Marcin Zajączkowski

unread,
Nov 14, 2013, 8:45:30 AM11/14/13
to pitusers
Dnia Czwartek, 14 Listopada 2013 14:35 Tom Barber <tom.a....@gmail.com> napisaďż˝(a)
> Hi, I've recently discovered PITest and it looks great. I've run it against an existing suite of unit tests for an application and have found that many of the surviving mutations are due to logging entries - LOG.info("xyz"); - where the mutation could remove the call without a test failing. Is it possible to filter these out so that they are ignored by mutations?

Hi Tom. What logger library do you use? PIT by default shouldn't try to mutate logging statements.

Marcin

--
http://blog.solidsoft.info/ - Working code is not enough



Tom Barber

unread,
Nov 14, 2013, 8:54:28 AM11/14/13
to pitu...@googlegroups.com
Hi Marcin,

The logger class in question in this instance has been developed internally, which might be why it hasn't been excluded :(

Is there any way of ignoring "LOG.*" lines of code?

Thanks for getting back to me so quickly.

Tom

Marcin Zajączkowski

unread,
Nov 14, 2013, 9:29:07 AM11/14/13
to pitusers
Dnia Czwartek, 14 Listopada 2013 14:54 Tom Barber <tom.a....@gmail.com> napisaďż˝(a)
> Hi Marcin,
>
> The logger class in question in this instance has been developed internally, which might be why it hasn't been excluded :(
>
> Is there any way of ignoring "LOG.*" lines of code?

Yup, that's the reason, but "avoidCallsTo" switch/parameter should allow you to exclude also custom logging statements.

See: http://pitest.org/quickstart/commandline/

Marcin



>
> Thanks for getting back to me so quickly.
>
> Tom
>

Tom Barber

unread,
Nov 14, 2013, 10:17:19 AM11/14/13
to pitu...@googlegroups.com
Thanks - that was just what I was hoping for!

Tom
Reply all
Reply to author
Forward
0 new messages