Make implicit runtime exceptions explicit.


This option tells Diffblue Cover to consider the possibility of runtime exceptions in the analysis.


Without the option, Diffblue Cover will not be able to cover the return -1 line in the following method:

public static int func(ArrayList<Integer> al) {
  try {
    return 1;
  catch (java.lang.NullPointerException e) {
    return -1;

Since many objects can produce exceptions at many points in the execution, switching this option on has a negative effect on analysis times (10x analysis time increases have been observed) and consequently, on coverage. Also, many exceptional test cases are produced which are usually not interesting in the context of unit testing. It should be kept for covering try...catch clauses that have not been covered without the option.

    throw-runtime-exceptions: true

results matching ""

    No results matching ""