max-nondet-array-length

Maximum allowed length for an array passed as test input.

Description

Diffblue Cover is not limited in the size of arrays it can create when generating inputs for a method. However, if these arrays hold complex objects, Diffblue Cover may not be able to cover them. In order to avoid this, you can set a limit to the size of any input arrays. By default the limit is 5. It can be overridden with the max-nondet-array-length option.

Usage

To be able to create tests for the example below, you should set max-nondet-array-length to 8 or higher:

public static int func(int[] array) {
  if (array[7] == 2)
  return 2;
  return 1;
}

Limiting the size of the generated input arrays can also help with the readability of tests. Note that it makes sense to have an unwind value that is greater than max-nondet-array-length.

phases:
-
  cbmcArguments:
    max-nondet-array-length: 8

Defaults

Phase Default
1 5
2 5
3 5

results matching ""

    No results matching ""