This question is for someone who intimately unders...
# serialization
p
This question is for someone who intimately understands the @Serializable annotation implementation and probably deeper. For a data class, what additional operations are generated? Experience with code coverage tells me that
$$serializer()
is one and I believe that there are others generated for a property of type List, for example
@Serializable data class KoverData(val list: List<String> = emptyList())
My goal is to write a test for this data class that Kover will report as 100% covered. If you have an answer, or even a clue, please do tell.
This would be the test class:
And this would be the Kover report result.
And lastly, the Kover configuration block:
At this point my conclusion is that @Serializable (along with @Composable) gives the proverbial finger to code coverage. Is there any reason why an issue should not registered for both libraries that suggests the library developers and documenters provide information on how to effectively cover the generated code without re-testing the library code?
It has been suggested that an acceptable compromise is to filter out (exclude) coverage by the Serializable and Composable extensions while still writing tests for the non annotated User code. This sort of works but is less than ideal. Would that there is a better way.