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
Support tests written on interpreted languages #778
Comments
I think this is a good suggestion. To implement this I assume that we would have to be able to create a mutated standalone binary that can be run in the same way as the original binary. Not sure how to take this from the current binary in memory, but one potential solution would involve calling a normal linker to be able to create a freestanding executable. Given the wide range of build systems and how they are invoked I think the easiest way might even be to provide hooks where Mull calls an external script/program for linking and another external program for executing the tests. That would allow for full flexibility regarding how test binaries should be built and how they are invoked. Some open questions that I see around this approach:
|
I'd love to see Mull supporting this use case. There are, however, obstacles. Here are some technical details.
if(env("specific-mutant-id")) {
// mutated code
} else {
// original behavior
} This approach actually has some benefits (e.g. mutant generation will be a bit faster and the size of the program will be smaller). But it also has at least one drawback - if a hot path in the program contains many mutations, then we may lose many CPU cycles with all these
Some comments on @gebart's questions
It is possible to implement as part of
There is at least mutate_cpp that can be used to achieve this goal.
IMO, these two share the same issue: there might be shared resources that prevent parallelization.
This is an easy decision, IMO. We can just store the temporaries in a temporary folder and then either let OS take care of them, or ask users to do it. |
I feel your pain with support tests written on interpreted languages! But let's take a look at this from user point of view. Imagine you have a C/C++ project where someone wants to use mutation testing. In most projects unit tests covers a small part of a project, much more smaller, than "big" tests like integration/system tests and these tests often written on interpreted languages (like Python). So Mull have limited applicability in a real projects. It produces results that are not representative. Support of a single type of tests severely restricts use of Mull on practice. I see several ways for those who like me wants to integrate Mull to a real projects:
Can you implement limited support for integration tests?
|
Just to clarify a bit: I'd be happy to see this feature. My point was that it is not a trivial task and would require some fundamental changes in how Mull works. It's worth mentioning that removing JIT will also lead to performance degradation. In this PR #793, I dropped part of JIT for controlling mutations and the test run against OpenSSL is now 6 times slower, ~100s vs ~600s. I'd need to find a way to speed it up a bit. |
Personally I don't care about performance (total execution time) of mutation testing at all. For me it's ok to run Mull for a night or a couple of days and then analyze results. Mutation testing is not a usual testing like e2e, unit tests or even performance tests. I'm not sure it is worth to add MT as a pre-commit check and so it is not huge difference 100s or 600s. For those who want to integrate MT to continuous integrate much more important ticket with mutation testing only for changed source code (see #790). With fixed #790 integration of MT to a development process would look like this:
|
Just a follow-up: with the recent changes in place (#798) Mull can handle tests written in interpreted languages. Please, stay tuned and let me know if you need it badly. |
The tutorial is here: #882 |
In a most C/C++ projects only small part of tests written on C/C++. Other parts are implemented on Interpreted languages like Python, Perl etc, because they are cheaper in implementation and maintenance. As far as I understand Mull supports only tests written on C/C++. It means that it cannot kill all produced mutants even there are exists tests that can do it, because Mull don't run them.
It would be good to add ability to execute all possible tests exist in a project. Otherwise mutation testing using Mull is imperfect.
The text was updated successfully, but these errors were encountered: