Bug - StrewAnalyzer with files without tests crashes worker
Description
If a file is submitted without tests, and any of the strew metrics are selected the worker fails due to the following exception
java.lang.IllegalArgumentException: NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.
at com.google.gson.Gson.checkValidFloatingPoint(Gson.java:359)
at com.google.gson.Gson$1.write(Gson.java:327)
at com.google.gson.Gson$1.write(Gson.java:313)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
This is caused by a missing return statement in the addAssertionsPerTestCase
method causing a 0.0/0.0 -> NaN.
Priority - Medium
This means we cannot detect coverage for methods without tests
Definition of done
When a test has been written that tests this case When the return statement has been added
Edited by Tim van der Horst