Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multi-module support for mutation coverage #307

Open
chr-knafl opened this issue Oct 18, 2016 · 2 comments
Open

Enable multi-module support for mutation coverage #307

chr-knafl opened this issue Oct 18, 2016 · 2 comments

Comments

@chr-knafl
Copy link

Hi!

Say we have a project A and B. In project A are many tests for production code of module B. And B also covers some production code of A. Can pitest also consider those tests for the mutation coverage? It would be a nice feature if not. It is shortly discussed here: https://groups.google.com/forum/#!searchin/pitusers/multi$20module|sort:relevance/pitusers/1CNgSrlZcgk/FDOQljX93hMJ

Thanks in advance!

Regards
Christoph

@StefanPenndorf
Copy link
Contributor

Your description sounds like a circular dependency between A and B. On the other hand regarding your title I'd assume you're talking about the maven plugin. Maven prohibits circular dependencies.

But I've had a similar situation: We do have a domain module with lots of entities and business objects.I'm not talking about data containers following an anaemic data model but instead about rich entities with domain functions, behaviour and knowledge. Those will be used primarily by other services that reside in different modules. There is sometimes not much value in testing those entities in isolation. On the other hand we do not mock entities in service tests and entity behaviour will be checked by service tests (as well).


The problem with this proposal is the boundary: Which dependency is "in" and which is "out". I don't think it's feasible to instrument and record the invocations in the whole classpath. Maybe the package prefixes already defined for mutation are enough?
Might be some work necessary and will increase number of potential mutants (more coverage means more code with potential mutation points).

@chr-knafl
Copy link
Author

Hi!

Sorry for the late answer!
No I don't have a circular dependency.

What I have has is the following:

project A uses project B

B has production code and test code. This is ok.
A also tests production code of B indirectly, as A's production code uses B's production code.
So there are tests in A that indirectly test B, meaning that this impacts B's mutation coverage.

But as I understand only B's test code is used to calculate B's mutation coverage.

Do you know what I mean?

Regards
Christoph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants