Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Empty conditions generated #246

Open
Sophietje opened this issue Mar 10, 2023 · 1 comment
Open

Empty conditions generated #246

Sophietje opened this issue Mar 10, 2023 · 1 comment

Comments

@Sophietje
Copy link

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
Copy link
Owner

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants