albertogoffi / toradocu

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

Missing translation of @return comments about "empty" return value #120

Open albertogoffi opened 7 years ago

albertogoffi commented 7 years ago

Toradocu is not able to translate @return comments about the emptiness of the return values.

Some examples:

Empty @return condition. Comment: an empty Bag
Expected condition: true?result.isEmpty()==true
Actual condition: 
Empty @return condition. Comment: an empty sorted Bag
Expected condition: true?result.isEmpty()==true
Actual condition:
Empty @return condition. Comment: a new empty FluentIterable
Expected condition: true?result.isEmpty()==true
Actual condition:
Empty @return condition. Comment: an empty Queue
Expected condition: true?result.isEmpty()==true
Actual condition:

The fact that there is no if in the comments can suggest that the guard is true and that the comment is actually expressing a property of the return value of the commented method.

khaeghar commented 7 years ago

This should be an easy thing to do.

The only problem is the predicate that we get, that would be (args, is bag/sorted bag/FluentIterable/Queue) and we would not get the condition (That it is actually what we need, because we do not care about the type of the return)

albertogoffi commented 6 years ago

Over time, we solved many of the initial problems. Of the initial examples, the only missing translation we have now is the following (in org.apache.commons.collections4.FluentIterable):

Empty @return condition. Comment: a new empty FluentIterable
Expected condition: true?result.isEmpty()==true
Actual condition: