albertogoffi / toradocu

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

"but" means "&&" not "||" #61

Closed bjkeller closed 7 years ago

bjkeller commented 7 years ago

For the @param in the following class

package pkg;

public class Counter {
  /**
  * @param count  the count of all things wonderful, must be positive but less than 10
  */
  void wonderfulCount(int count) {}
}

The condition should be count >0 && count < 10, but Toradocu is generating count > 0 || count < 10.

Are there examples where the correct interpretation of "but" is not a conjunction?

albertogoffi commented 7 years ago

Toradocu uses || as the default operator to connect conditions. && is used in specific situations and we can indeed handle but to be treated as and. We need to check the result of this change on the regression test suite, since I have no example in mind where the but should not be an and conjunction.