-2

All, There is an issue while running mutation test cases.

Getting the mutation test case failures as follows:

removed call to java/util/List::sort → SURVIVED
removed call to java/util/List::forEach → SURVIVED

The code:

List<CustomClass> data;//address is the field in the CustomClass
UseCase useCase; //setEventBus is the method
   data.sort(Comparator.comparingInt(CustomClass::getAddress));
     
   data.forEach(frame -> useCase.setEventBus(frameList, data.getAddress()));

I have written couple of unit test cases but mutants survived. Can anyone help here for this problem?

RagaSGNur
  • 199
  • 1
  • 2
  • 15
  • I also do my first steps with mutation testing, so it's just a guess: Your test is still green, even when the `sort` and `forEach` is removed from code. Write a test, that fails when you remove one of these calls. – Timo Jul 25 '22 at 16:24

1 Answers1

0

The failed mutation cases are solved.

removed call to java/util/List::sort → SURVIVED:

Added the test case for the below line data.sort(Comparator.comparingInt(CustomClass::getAddress)); The test case is added to store the unsorted data in 'data' object.

RagaSGNur
  • 199
  • 1
  • 2
  • 15