albertogoffi / toradocu

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

Skipping the condition in the predicate when translating sentence #107

Open khaeghar opened 7 years ago

khaeghar commented 7 years ago

At PrecisionRecallCommonsMath3#testArithmeticUtils

Given the comment: "Positive number."

The expected condition is: "args[0]>0"

But instead received empty condition.

When adding the subject and the verb "is" manually (via identifying the pattern), the comment becomes: "parameter is a positive number"

But still no translation. This is due to the fact that Toradocu gets as a predicate only "is number", so the tuple subject/predicate is: (parameter, is number)

When "is number" goes through all the matching, it doesn't produce a match, therefore, no translation.

albertogoffi commented 7 years ago

In the log I don't see any comment like "positive number" executing the mentioned test.

Still we should check the current behavior on such kind of comments.

khaeghar commented 7 years ago

Sorry, testArithmeticUtils is not the test.

The test is testPrimes, in CommonsMath3.

There are also examples in com.google.common.hash.Hashing_goal.json and com.google.common.base.Splitter_goal.json.