Hello everyone! Today I wanted to write a blog about someone else’s blog post that I found online last week while reviewing for one of my final exams. Its by James White ( https://blog.scottlogic.com/2017/09/25/mutation-testing.html ) and in his blog he talks about mutation testing, which is one of the topics we’ve covered in class recently. Mutation testing is a way to test the code that you have written by altering your code with changes that are designed with the intent of being detected by different tests you have written for your code. Basically, it mutates your code so your tests can find the mutation and, if that happens, then you know your tests worked correctly. If the mutation survives in your code then you know the tests didn’t work.
What I like about James’ blog is that he makes the idea easy to understand, and incorporates plenty of different examples to walk readers through how mutation testing works. I specifically like his example of why mutation testing is needed, and how, in his example, mutation testing was able to point out a flaw in his code that otherwise would have gone unnoticed, since you could have changed the line of code or even deleted it all together and, without mutation testing, it would have looked correct even though it wasn’t.
The other thing I liked about James’ blog is the different examples he gives of what these mutations look like. How it can change (input > 0) to (input <= 0) or how it could mutate code to check true instead of false. I also liked how he addressed the common question of how long it would take mutation testing to run, since that is a question I had myself once we started learning about mutation testing. I also thought it was pretty cool that he mentioned how mutation testing can help point out instances of redundant code, and some other neat things about it too. Overall I enjoyed reading his blog, and it helped me better understand the material we learned about in class.
From the blog CS@Worcester – Nick’s Blog by nramsdell1 and used with permission of the author. All other rights reserved by the author.