albertogoffi / toradocu

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

Wrong translation produced when multiple matches for a plural subject are found #104

Open albertogoffi opened 7 years ago

albertogoffi commented 7 years ago

Input: "@param predicates the the predicates to check, cloned, not null" Expected output: (args[0]==null) == false Actual output: (args[0]==null) == false || (target.getPredicates()==null) == false

From the comment Toradocu extracts a proposition with subject predicates and predicate not is null. Then Toradocu picks as matching code elements the method parameter predicates and the method getPredicates in the target class. Toradocu would use only one of the two (according to a defined priority) if the subject is singular, but in this case predicates is plural. Then Toradocu retains both identified code elements and merge the two translations in (args[0]==null) == false || (target.getPredicates()==null) == false. Notice that || (or) is the conjunction used when no other conjunction is specified.

One possibility to solve this is to look at the verb and check if it is a third person singular verb, and in that case treat the subject as a singular noun.