albertogoffi / toradocu

Toradocu - automated generation of test oracles from Javadoc documentation
Other
42 stars 21 forks source link

Incorrect interpretation of "if the number of points is less than 2" #70

Closed bjkeller closed 7 years ago

bjkeller commented 7 years ago

This relates somewhat to issue #67 (because it deals with array length) and issue #56 (because the entity is ambiguous).

For Apache Commons Math DividedDifferenceInterpolator, have a couple of methods where get condition methods like this

    // double[] org.apache.commons.math3.analysis.interpolation.DividedDifferenceInterpolator.computeDividedDifference(double[] x,double[] y)
    public static boolean m1_t1(org.apache.commons.math3.analysis.interpolation.DividedDifferenceInterpolator receiver1_t1, double[] x, double[] y) {
        // @throws org.apache.commons.math3.exception.NumberIsTooSmallException if the number of points is less than 2. ==> args[0]<2
        return x < 2;
    }

I haven't looked at the class, but I think the parameters are a parallel array of "points" and so the condition would be expressed on the length of either array.

albertogoffi commented 7 years ago

This has been partially fixed with latest commit fixing #69, #67, #66, and #65. Toradocu now does not generate any translation for the comment in the example. In other words, Toradocu does not support the comment, but at least the there is no wrong output from our tool.