In my application there are some predefined expression templates that can be used to filter data. One of them is "
between x and y". A QA engineer claims that there is a defect in its definition, because "
between 100 and 200" gives different results than "
between 200 and 100". The expression is internally translated to "
value >= x and value <= y", so obviously there are no results when the second boundary is lower than the first one.
I have checked that the same behavior is in SQL - "
between x and y" assumes that y >= x or there are no results. It means that the operator is not commutative, at least in SQL.
So, is the QA right that "
between x and y" should be commutative?