question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it clearer that mutation happens in-place

See original GitHub issue

As I have never run mutmut before, I left it running in the background while I continued to do some work, and discovered that the mutations happen on the codebase in-place. I think this is totally reasonable, but it didn’t match my assumptions approaching the tool, so I ended up (a) not able to continue working against the codebase, and (b) probably invalidating some of the tests that mutmut performed by writing files while it was running.

It’d be good if this were clearer!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boxedcommented, Dec 20, 2019

Good luck with that! If the mutants aren’t really testable, we are discussing more advanced whitelisting ideas in https://github.com/boxed/mutmut/issues/47

1reaction
pavulon18commented, Dec 17, 2019

@boxed , Apology accepted. I really appreciate that. I understand about being sleep deprived. I will also apologize for becoming defensive and retaliatory.

Now on to business. I like your idea about changing mutmut apply to mutmut write. I do think that would help give an additional indication that something could be changed.

I also agree that the changes you made in the documentation are much better than the original.

Although I still like my idea of having the extra statement similar to what I wrote above (although I am biased), I think you’ve definitely made some improvements in clarity. I am looking at this from the viewpoint of someone who is an inexperienced programmer and who is still being bombarded with a lot of new concepts. There are times when some points of a new concept are not immediately absorbed. I do concede that you do have (and originally had, as well) a statement that should have caught my eye, but I failed to catch it.

I also have a question about mutmut when used in a project using SQLAlchemy. I’ll pose my question here but if you think this is not the appropriate place for this, please point me in the right direction.

Should the classes that are used for mapping SQL tables be mutation tested? and if so, how do I go about fixing my classes to kill the mutations? I can supply specific examples of code that I am talking about, if need be.

I have not seen anything online that addresses this issue. These questions could simply be due to my lack of experience.

EDIT: After writing this earlier, I have figured a way to test at least some of the functions in my SQLAlchemy classes that I was confused about. I’ll try to build on this to see if I can get most, if not all of them testable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Washing your code: avoid mutation - Artem Sapegin
Mutation may lead to unexpected and hard-to-debug issues, where data becomes incorrect somewhere, and you have no idea where it happens.
Read more >
Mutation, Repair and Recombination - Genomes - NCBI - NIH
Mutation and recombination can both be defined as processes that result in changes to a genome, but they are unrelated and we must...
Read more >
How do we classify mutations in biology? - CC
Silent mutations are mutations that do not result in a change in phenotype. This can occur if: A change in the nucleotide sequence...
Read more >
Why You Should Probably Never Use pandas inplace=True
This article will explain what the pandas inplace=True keyword means, how it behaves, and why you should probably never use it.
Read more >
Mutants and Mutations - The Uncanny X-Flies
How do mutations occur. ... to produce energy (of course the cells have mechanisms to clear these molecules and protect from their effects)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found