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?
between
should include or exclude the lower and higher values. The QA person may be pedantic but as long as there is uncertainty someone needs to clarify the user stories/requirements. It might turn out that they way it is done is how it is supposed to be, but a decision has to be made.