Link to home
Start Free TrialLog in
Avatar of Frank Danny
Frank DannyFlag for United States of America

asked on

How can i resolve this Mutation testing report?

I am a newbie on mutation testing. I am using  PIT  to test my  code.Can anyone please  suggest  how  can I resolve this  code?

 
      import java.io.IOException; 
 
 5     import org.springframework.http.client.ClientHttpResponse;
 
 6     import org.springframework.web.client.ResponseErrorHandler;
 
 7     
 
 8     
 
 9     public class DataTagsNamesErrorHandler implements ResponseErrorHandler {
 
 10         @Override
 
 11         public boolean hasError(ClientHttpResponse response) throws IOException {
 
 12         	
 
 13  1  return false;
 
 14         }
 
 15     
 
 16         @Override
 
 17         public void handleError(ClientHttpResponse response) throws IOException {
 
 18         }
 
 19     }
 
  
Mutations 

13  1.replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
 

Active mutators
•INCREMENTS_MUTATOR
•VOID_METHOD_CALL_MUTATOR
•RETURN_VALS_MUTATOR
•MATH_MUTATOR
•NEGATE_CONDITIONALS_MUTATOR
•INVERT_NEGS_MUTATOR
•CONDITIONALS_BOUNDARY_MUTATOR

Tests examined

Open in new window

Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

quick overview on mutation https://www.guru99.com/mutation-testing.html
Once you understand this then perhaps you can apply it to your specific mutator
Avatar of Frank Danny

ASKER

Thank you@David
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.