Meaning of Diffblue Cover reason, error and testability codes

When running Diffblue Cover the output produced may contain reference to certain reason, error or testability codes. Reason codes usually indicate that Diffblue cannot write tests for parts of the code due to how it is structured. Error codes may indicate an issue in Diffblue Cover itself. Testability codes indicate whether a method is testable, or is considered valuable to test. The possible reason and error codes are described here for convenience:

Code Meaning Suggestion
R000 Success. N/A
R001 Method under test is not callable from another class in the same package (X). Make the method visible to another class in package X.
R002 Nothing to assert: the constructed class doesn’t have observer methods. Observer methods are parameterless, read-only methods that return the state of the class; for instance, getters, size(), toString(). Add getter methods to the constructed class.
R003 Nothing to assert: the return/parameter types of the method under test don’t have observer methods. Observer methods are parameterless, read-only methods that return the state of the class; for instance, getters, size(), toString(). Add observer methods to the parameter/return types of the method.
R004 Unable to find any meaningful assertion. Add getter methods in the parameter/return class types of the method under test that access or return fields written by the method under test. This error could also happen because good inputs for the method under test could not be determined.
R005 Unable to load class "X". Loading the class failed (probably because it was not present in the classpath), but it is needed to generate the test. Check that your classpath is complete; in particular, check that you do not have any dependency exclusions configured.
R006 Unable to load class "X": static initializer failed. The static initializers of the class threw an exception while trying to load it. Diffblue Cover needs to load the class to generate a test. Check that the class can be loaded without any errors in the environment where you create and run your tests.
R007 Unable to instantiate class "X": no accessible constructor or factory method. Diffblue Cover needs to construct an instance of "X" but we could not find any accessible constructors or factory methods. Provide a package-visible constructor or factory method for testing that, ideally, takes no arguments and does not throw, return null or return a subtype.
R008 Unable to instantiate class X containing the method under test. Diffblue Cover was not able to instantiate the class using accessible constructors or factory methods. We aborted because the method under test lives in this class, or a nested class. As R007
R010 Timeout while generating the arrange/act section of your test. Generating the arrange/act sections of your test took more than X seconds. This often happens because we ran code in your project which requests user input (System.in), implements a service loop, or runs into an infinite (or very long) loop. N/A
R011 Attempt to “X” broke the sandboxing policy. To generate tests we execute your code in a sandboxed environment which, by default, prevents things like overwriting your files or opening network connections. Your code tried to break the current sandboxing policy, so we aborted. N/A
R012 User code failed badly by throwing a “X”. When trying to execute some of your code, we received a particularly serious error "X" (an instance of LinkageError or VirtualMachineError). One possible reason is that initializing a class failed due to timeouts or sandboxing at some point, so later instantiation attempts of this class will fail with an error. Stack trace:… This will require debugging why your code caused the error; possible mitigations may include modifying the sandboxing policy or increasing timeouts, or changes to your code to make it easier to test.
R013 Unable to generate test inputs not throwing a trivial exception: “X”. We failed to find inputs to the method under test which would NOT lead to throwing of a trivial exception, like NullPointerException or LinkageError. This happened most likely because we couldn't find good inputs for your test.
R014 Could not start test generator because “X” could not be found. We could not start the test generator because “X”, which is documented as a requirement for test case generation, could not be found. Make sure that all required dependencies (JDK, …) are installed in paths where Diffblue Cover can find them.
R015 Test replay failed. A test was generated but immediately failed one or more assertions, probably because the method under test is stateful or nondeterministic. Try splitting stateful or nondeterministic methods into stateless and deterministic parts where the state or nondeterminism is injected via a parameter.
R016 Current JVM does not match JDK which compiled the project. Diffblue Cover needs to be executed with the same or a more recent Java version that the version with which the project was compiled. Make sure that the first java executable in your PATH environment variable is the same or a more recent version than the project Java version. Either recompile the project with an older Java version or run dcover with a more recent JVM.
R017 Unable to create any tests that do not assert on a thrown exception. If only exception test cases are created for a particular method, tests are then discarded as testing only exceptions is not considered to be valuable test coverage and can provide false confidence. Diffblue Cover could not determine valid inputs for the methods under test. Please ensure factories are added for the input types.
R020 Temporary files were created but not deleted. Ensure that the method under test deletes any temporary files created.
E009 Unrecoverable runtime error in the test generator. X where X is a description of the error. N/A - this is a general unrecoverable error.
T000 Should be tested. N/A
T001 Trivial getter. Trivial getters are not considered valuable to test. Information only.
T002 Trivial setter. Trivial setters are not considered valuable to test. Information only.
T003 Method not callable. The method under test is not callable from another class in the same package. Make the method visible to another class in package.
T004 Anonymous class. The method under test is in an anonymous inner class. Factor out the anonymous class into a package-visible class.
T005 Trivial constructor. Trivial constructors are not considered valuable to test. Information only.

results matching ""

    No results matching ""