5 minutes ago

The original failed test case created by FailureDoc is as follow. We have an assertion failure at line 29.

The comments at line 16, 23, and 25 are FailureDoc's explanation. We use these explanation and create three passed test cases. These three passed test cases and the original failed test case are Ziyuan's input.

Analyzed Result

2 minutes ago

Result from Ziyuan:

entries.count >= 4.0 (org.apache.commons.math.linear.OpenMapRealVector:585)

Remarks

91 seconds ago

Explanation for the bug:

var13 is an ArrayRealVector with value {1, NaN, 1}; var21 is an OpenMapRealVector with value {NaN, Infinite, NaN}. When comparing an ArrayRealVector object and OpenMapRealVector object, if two objects have the same lengths and have NaN in one of their entries, the function equals() returns true. However, the functions hashcode() of ArrayRealVector and OpenMapRealVector are implemented differently. That is the reason why we have an assertion failure at line 29.

One possible solution to fix this bug is reimplementing the functions hashcode() in two classes ArrayRealVector and OpenMapRealVector.

In this case, the explanation from Ziyuan is correct. If the number of entries in var21 is greater than 3, the expression var13.equals(var21) returns false (because var13 and var21 have different lengths) and the assertion failure does not occur.

Daikon

The result of Daikon in this case can be found here. In the entry of method isNaN() in class OpenMapRealVector, there is an invariant this.entries.count == 4. We can use this entry as explaination similar to Ziyuan's result. However, note that besides this useful invariant, Daikon returns many other invariants, not only in method isNaN() but also in other methods.