albertogoffi / toradocu

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

Empty conditions generated #246

Open Sophietje opened 1 year ago

Sophietje commented 1 year ago

Hi!

I've been trying to run Toradocu on some of my examples to generate specifications but unfortunately it doesn't seem to generate any useful conditions or properties. All of the conditions seem to be empty ("").

The examples that I've tried can be found here. I've used the following command to run Toradocu: java -jar build/libs/toradocu-1.0-all.jar --class-dir ../ --source-dir ../ --target-class [filename] > [filename]-output.txt The output of the condition translator can be found here.

The ArrayList and BinarySearchGood do not generate any warnings/errors. The Counter example does generate two warnings like this one:

[main] INFO org.toradocu.util.ComplianceChecks - The following specification was generated but discarded:
args[0]>0
Unable to compile the source
[kind=ERROR, line=1, message='.' expected]
[kind=ERROR, line=1, message=';' expected]

Could you help me figure out why Toradocu does not generate any output conditions or properties? Is this a limitation of the natural language processing or am I somehow using Toradocu incorrectly?

albertogoffi commented 1 year ago

Hi! Thank you for your report and for your interest in Toradocu! :)

I'm convinced you are using Toradocu correctly. You are not getting output conditions because of the limitations of Toradocu. In particular, Toradocu does not generalize well. Take the comment:

@throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())

If written like

@throws IndexOutOfBoundsException if index < 0 || index >= size()

Toradocu would have generated the condition

args[0]<0

that is correct (although partial).

Since I moved to industry I'm not aware of the latest developments related with Toradocu. @ariannab, do you know if any of your developments could be useful to @Sophietje? Thank you.