As the name suggests, mutation testing is a software testing type that is based on changes or mutations. Miniscule changes are introduced into the source code to check whether the defined test cases can detect errors in the code.
indonesia : Mutation testing merupakan testing yang dilakukan berdasarkan perubahan atau mutasi ( terhadap suatu program dengan memodifikasi satu bagian kecil dari sebuah fungsi/method kode program ). Untuk Mengechek error code atau test case sudah cukup atau belum.
Let me simplify:
- You Write Test
- You Pass The Test
- You Mutate Your Code
- You Fail The Test
- GOOD !
graph LR
A[WRITE TEST] --> B(PASS TEST) --> D[MUTATE CODE] --> E(Fail Test) --> F((Good))
- You Write Test
- You Pass The Test
- You Mutate Your Code
- The Test still passed ?
- BAD !
graph LR
A[WRITE TEST] --> B(PASS TEST) --> D[MUTATE CODE] --> E(STILL PASSED ?) --> F((BAD!!))
Then Do something until the test possibly to fail
Hundred percent Test Coverage isn't enough to check if your code is fully tested !
one of benefits is to find out if our test case is enough or not
X + Y can become : X - Y X * Y X / Y X ^ Y
X || Y can become : X && Y
X == Y can become X !==Y
IF(true) doSomething() ELSE Return Error
can become:
IF(true) doSomething()
https://www.softwaretestinghelp.com/what-is-mutation-testing/