albertogoffi / toradocu

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

Wrong and non-compilable condition (primitive result compared with null) #217

Open ariannab opened 6 years ago

ariannab commented 6 years ago

Running Toradocu on class org.apache.commons.collections4.MultiMapUtils produces the following condition:

    "returnTag": {
      "comment": "true if the map is empty or null.",
      "kind": "RETURN",
      "condition": "args[0].isEmpty() ? (result == true||result==null)"
    },

This highlights 2 problems:

ariannab commented 6 years ago

The missing check over the result type (2nd problem) is solved by #226.

ariannab commented 6 years ago

The current translation is: ((args[0]==null)==false) && (args[0].isEmpty()) ? methodResultID == true : methodResultID == false

Which is more correct than the original one, but it is still incorrect. Indeed, Toradocu fails to understand that the last part of the comment (or null) still refers to the map.