T - Testability Codes

Introduction

These output codes are associated with the testability of your Java code and provide reasons for not attempting to write tests - for example, trivial setters and getters don't get separate tests because they are called by other unit tests and covered that way.

T000 - Method eligible for test creation

Initial analysis indicates that this method is eligible for test creation - Diffblue Cover will attempt to create tests.

T001 - Trivial getter

Diffblue Cover will not attempt to create tests for trivial getters. The method may be tested indirectly (via another method).

T002 - Trivial setter

Diffblue Cover will not attempt to create tests for trivial setters. The method may be tested indirectly (via another method).

T003 - Private method

The method is declared private or in a private inner class. It cannot be called from another class in the same package. Diffblue Cover will attempt to test it indirectly through other callable methods. If you want to test this method directly make it package-private.

T004 - In anonymous inner class

The method is declared in an anonymous inner class. It cannot be called directly. Diffblue Cover will attempt to test it indirectly through other callable methods. If you want to test this method directly, factor out the anonymous class into a package-private class.

T005 - Trivial constructor

Diffblue Cover will not attempt to create a test for this constructor. It may be tested indirectly. Default constructors of static utility classes are considered trivial.

T006 - Main method

Refactor the main method. E.g. factor out its body into a separate, accessible method that returns the results that should be asserted on.

T007 - Framework configuration callback

Certain framework callbacks should not be directly tested because of possible side effects. Diffblue Cover will attempt to test indirectly through other callable methods.

T008 - Private and never called

The method cannot be called from another class in the same package. It is not called by any other method and therefore cannot be tested. If the method is dead code then remove it from your code base.

T009 - No implementation for abstract class

The method is a non-abstract instance method in an abstract class or a default method in an interface. Diffblue Cover would test such methods by using an implementation of that abstract class or interface. However, no such implementation has been found. Please provide an implementation for the abstract class or interface.

T010 - Abstract or interface method

Diffblue Cover will not attempt to create tests for abstract or interface methods as there's nothing to test.

T012 - Synthetic method

Indicates that the method is synthetic. Currently, this includes methods:

  • that are marked as synthetic by the compiler

  • that are not directly callable

  • that are generated by frameworks, e.g. Hibernate

  • that exist on the JDK class but do not appear in the source code

Diffblue Cover considers these methods as not directly callable.

T020 - Other trivial method

Diffblue Cover will not attempt to create tests for trivial methods. The method may be tested indirectly (via another method).

T021 - Empty method body

Diffblue Cover will not attempt to create a test for this method.

T022 - Cannot test mocked method

The method under test is not unit-testable because it must be mocked.

T023 - Testability unknown

Indicates that the testability could not be determined for the method. Diffblue Cover considers these methods as not testable.

T033 - Method excluded from test creation

Diffblue Cover did not create tests for this method as the user chose to exclude them. If you wish to have tests created for this class, please check that it is not within the --exclude option.

Last updated