Skip to content

Latest commit

 

History

History
57 lines (31 loc) · 1.52 KB

01.mutation-testing.md

File metadata and controls

57 lines (31 loc) · 1.52 KB

Mutation Testing

Instructions

  • Use dotnet command to install stryker dotnet tool install -g dotnet-stryker

  • Go inside Tests folder cd money-problem/Tests

  • Run stryker command dotnet stryker

  • Check the report inside StrykerOutput folder

Stryker Report Location

Stryker Report

  • Check remaining mutants

MissingExchangeRateException

Mutant

Stryker was able to create a mutant as we don't verify the exception message. The processed replaced the exception message by an empty string and our test still passed.

It proves our test isn't reliable. Testing the message does provide value as it contain business information.

Code Fix

When implemented, verify your test pass and run the stryker command again.

Stryker Report Fixed

MoneyCalculator

Mutant

Stryker was able to create a mutant as we don't have any assertion in our test.

Code Fix

When implemented, verify your test pass and run the stryker command again.

Stryker Report Fixed

Mutants eradicated!

Congratulations you have killed your first mutants !!!

Mutant killer

Why you should focus on good assertion?