Unit Testing Coverage and Testing of Large Components

I am trying to target a fairly large class that uses many small components. At the moment, I have no idea how many of the smaller components are tested per unit.

Is there a tool or method for displaying all unverified dependencies [plus subdependencies] that are used in a larger class?

I understand that I can make a complete coverage of the project code, and that I can create a list of all tested components. However, what can I do to see this in perspective of this separate class?

Why am I asking about this? It would be ineffective if this test case were written without subcomponents to test their methods.

I am currently using:

  • JUnit 4.11
  • Java
  • JaCCO [emma compatible]
+4
source share
1 answer

@monsky. This is an interesting question.

Jacoco gives you the flexibility to include or exclude a specific set of classes in your scope. If you want to find code coverage only with dependent classes, you can do 2 things.

  • Calculate recursively all the dependent submodules of the class that you want to span. Using this when you call Jacoco, provide an explicit list of classes for which you want to enable coverage. You can do this using the include element of Jacoco.

    http://www.eclemma.org/jacoco/trunk/doc/ant.html

  • , , include, . , , 1.

intellij IDe, http://jetbrains.com/idea/webhelp/analyzing-dependencies.html

+1

Source: https://habr.com/ru/post/1538795/


All Articles