How to remove specific classes from getting mutated

1,934 views
Skip to first unread message

Anish Paul

unread,
Jan 5, 2015, 2:29:00 AM1/5/15
to pitu...@googlegroups.com
Hi

So i have given a general location of all my class files to get mutated, but there are some classes which do not have appropriate test cases. Is there any way i can remove these classes (without the testcases) from the original location so that it wont get mutated. I am kinda new to this topic.
Like is it possible for me to use <exclude> tag remove these classes.
Thanks

    <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <version>1.0.0</version>
                <configuration>
                <inScopeClasses>
                    <param>com.nokia.*</param>
                      <excludes>
                     <exclude>com.nokia.gui.*</exclude>
                       <excludes>
                </inScopeClasses>
                <targetClasses>
                    <param>com.nokia.*</param>
                </targetClasses>
                <outputFormats>
                            <outputFormat>HTML</outputFormat>
                </outputFormats>
                </configuration>

Chris Rimmer

unread,
Jan 5, 2015, 2:51:53 AM1/5/15
to pitu...@googlegroups.com
I believe PIT uses coverage analysis to see which classes are worth mutating. So if there are no relevant tests, it won't mutate them.

Chris

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anish Paul

unread,
Jan 5, 2015, 3:36:51 AM1/5/15
to pitu...@googlegroups.com

but i do get cases where mutation coverage fails because there are no relevant test cases for classes.

Henry Coles

unread,
Jan 5, 2015, 4:18:22 AM1/5/15
to pitu...@googlegroups.com
On 5 January 2015 at 08:36, Anish Paul <anish...@gmail.com> wrote:

but i do get cases where mutation coverage fails because there are no relevant test cases for classes.


PIT does use coverage data to target tests, however it will still create mutants where there is no coverage. These mutants will be given a status of NO_COVERAGE so they can be easily distinguished from mutants that are covered by tests, but not killed. Processing these mutants has a cost approaching zero.

Classes can be excluded from the analysis using the excludedClasses element at the same level as targetClasses. InScopeClasses was removed as an option some time ago.

Hopefully this is all explained in :-

http://pitest.org/quickstart/maven/

Cheers

Henry

Anish Paul

unread,
Jan 5, 2015, 4:56:37 AM1/5/15
to pitu...@googlegroups.com
Hi Henry,

Thanks for the updates, i went through the quickstart and read about the excludedClasses will try to work with it and get back.

Thanks Again

--
You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/R_HOHUTgSRk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages