Knowledge Base > Troubleshooting > Working with code R013

Working with code R013

If you receive the output code R013, this means that Diffblue Cover cannot write tests for a method because it is unable to find inputs to provide to the method that don’t cause trivial exceptions such as NullPointerException to be thrown. Please consider the parameters of the method under test, along with the class variables and instance variables it uses to ensure that it is easily possible to assign reasonable values for these quantities that do not cause trivial exceptions to be thrown.

A possible cause of an R013 is that the method under test uses a private member with an unset or bad value, as is shown in the example below:

public class SomeClass() {
  private Runnable value;
  // ...
  public int runSomething() {
    // ...
    value.run();
    // ...
  }
}

There are three solutions to this scenario. Ensure that value is initialised with a proper value, make value public or provide a getter and a setter for value.