Search code examples
variablesspecificationstestcaserequirements

Are these requirements correct (variable relations)


There is this example in a book, reading:

The system shall allow posting of envelopes where the longest side (l) is longer than or equal to 12 centimeters, but not longer than 75 centimeters. The smallest side (w) must be longer than or equal to 1 centimeter. The length must be twice the width and must be greater than or equal to 10 centimeters. Measures are always rounded up to the nearest centimeter. We can rewrite this requirement to read:

  • length >= 12
  • length < 75
  • width >= 1
  • length – 2 x width >= 10

I do not understand how the last requirement (...l>=10) can coexist with the first requirement (l>=12)

Am I missing something here?


Solution

  • After having seen the original text, it is clear that the equation L - 2 W >= 10 is indeed the author's intent. This constraint makes sense.

    Anyway, there are two "bugs" left:

    • the textual specification is wrong (should read "The length must be greater than twice the width by 10 centimeters or more" or similar),

    • the constraint L >= 12 is implicit with W >= 1 and L - 2 W >= 10.

    An extra typo in the following two tables would tend to confirm that nobody's perfect.