2

I have asked on a few other sites, no response but it must be something silly as many authors mention in their books.

Here is the best text I found:

enter image description here

My ultimate question is: Why the OFF point lies INSIDE the domain when the border is open. If it is about being off the border, why cant it be outside too?

EDIT: THank you for your answers. I found another contradicting article, what do you think? enter image description here

According to the description, the INCLUDE gravity is when t>=1. However, for the other open domain, OFF point is OUTSIDE the domain, contradicting what you all and the other articles I quoted mentioned

user144171
  • 523
  • 5
  • 14
  • please don't **[cross-post](http://meta.stackexchange.com/tags/cross-posting/info "'Cross-posting is frowned upon...'")**: http://stackoverflow.com/questions/28816452/domain-analysis-why-off-points-are-inside-for-open-borders-but-outside-for-clo – gnat Mar 03 '15 at 17:27
  • The gravity example is wrong; the "on" and "off" points are clearly reversed. E.g. They ignore gravity if the time elapsed is less than 1 millisecond, so the "off" point in the *IGNORE GRAVITY* domain *must* be less than 1 or they wouldn't be testing that gravity gets ignored. – Doval Mar 04 '15 at 13:28
  • @Doval I contacted the author who is 100% confident it is correct. He wrote me: "Because there are three points on/near the boundary, you are guaranteed that you’ll have at least one point in each domain, and one point right next to it in the other domain. That’s the whole point of the ON and OFF points." But I too believe it does not make sense in his example. – user144171 Mar 04 '15 at 17:30
  • @Doval: the points are not reversed, nethertheless you are correct with the fact the example is flawed. See the edit to my answer. – Doc Brown Mar 06 '15 at 18:17

3 Answers3

4

For closed domain, both OFF and ON points are outside domain, while for open domain, the OFF point is in inside the domain. I just do not get why is that.

This is incorrect. For both open and closed domain, one point is inside and one point is outside the domain. The difference is which point is inside (and which outside).

To test a domain boundary, you need one point on the inside, as close to the boundary as feasible, and one point on the outside, also as close the the boundary as feasible.
The point ON the boundary is by definition the closest you can get. For a closed domain, this point is defined to be the last point inside the domain and for an open domain this point is defined to be the first point that lies outside the domain.

Testing with two points ON the domain boundary does not provide you any additional information, so the second point must lie OFF the boundary.
If you combine the fact that you need both a point inside and a point outside the domain with where the point ON the boundary is considered to be (inside or outside), it follows logically where the point OFF the boundary should be located.

As for why you need points on the two sides of the boundary, If you have two tests telling you that the values 10 and 11 are both outside the domain, that doesn't tell you if the domain is (correctly implemented as) "values less than 10" or perhaps "values less than 9".

Bart van Ingen Schenau
  • 71,712
  • 20
  • 110
  • 179
  • My main problem is that - why the OFF point is INSIDE the domain for OPEN border..I just do not know, off border should be just off..in either direction – user144171 Mar 03 '15 at 15:28
  • THanks I understood a lot. Except for one thing (discrete values). In a book, I found the following: Shoe size is > 4 but < 7. Increment is 0.5. They say that 4.5 (ON point), the other ON point was 6.5 (ON). It does not match the definition (the first point outside the domain). Or maybe I am too tired. – user144171 Mar 04 '15 at 21:04
  • @user144171: That does indeed not match the definition given earlier. As this is with discrete values, it is possible that they first transformed the open domain `(4, 7)` to the largest closed domain that is contained within it (`[4.5, 6.5]`) before determining the ON and OFF points for the test. With discrete values, it is more common to work with closed domains. – Bart van Ingen Schenau Mar 05 '15 at 07:30
  • I really appreciate your time and wisdom, as this is a bit separate issue (discrete values), I createad another question with more details - http://programmers.stackexchange.com/questions/275296/domain-analysis-for-discrete-values-on-and-off-points-in-these-cases. Would be very happy if you could look at it. – user144171 Mar 05 '15 at 07:53
4

From the definition, "off points" can be inside or outside the domain, both cases match that definition.

But the text says "how should you choose test points" (which means - to get a good test coverage with as few cases as possible). So when you have chosen an "on point" which is inside the domain in case of a closed boundary, it makes just more sense to choose an off point outside the domain, and vice versa.

To your edit: in the "Ignore Gravity" domain, the point 1000ms is on the boundary, and it is already outside the domain. So it makes more sense to choose an "off" point inside the domain, which means at the "Ignore Gravity" side, so 999ms would be a better choice than 1001ms (note that both values are off points for both domains). Note that when looking at the "Include Gravity" domain 1000ms is inside, and 999ms is outside, so from that point of view it makes also sense to prefer 999ms.

Doc Brown
  • 199,015
  • 33
  • 367
  • 565
3

They are giving rules about how to chose test points.

  • you have to have in test points and out one (or you'll have tested only one side of it).

  • you have to have on test points (to be sure to test the limit) and off one.

For closed borders, the on test points are in, thus there must be an off one which is out.

For open borders, the on test points are out, thus there must be an off one which is in.

AProgrammer
  • 10,404
  • 1
  • 30
  • 45
  • I have just added another contradicting article, saying that for open borders, the OFF point is outside too. – user144171 Mar 04 '15 at 13:00