QuestionQ13

Test Analysis and Test Design

A route-finding application takes a starting point, an ending point, and a map containing information about one-way streets as inputs. It returns the length, in meters, of the shortest possible route.

You want to verify this system’s correctness with metamorphic testing using these two metamorphic relations:

  • MR1: For a route from point A to point B, changing one or more one-way streets to two-way streets cannot increase the route length.
  • MR2: For a map and points A, B, and C, the route length from A to C cannot exceed the combined lengths of the routes from A to B and from B to C.

You have two source test cases:

  • TC1: Start: P1, end: P2, one-way streets: S1, S2, S3. Result: route length = 1680 m.
  • TC2: Start: P2, end: P3, one-way streets: S1, S2, S3. Result: route length = 400 m.

Which test case exposes a system failure caused by violating metamorphic relation MR1 or MR2?

  • A Start: P1, end: P3, one-way streets: S1, S2. Result: route length = 500 m
  • B Start: P1, end: P3, one-way streets: S1, S2, S3. Result: route length = 2080 m
  • C Start: P2, end: P3, one-way streets: S1, S3. Result: route length = 580 m
  • D Start: P1, end: P2. one-way streets: S1, S2, S3. Result: route length = 1500 m
Explanation

Changing S2 from one-way to two-way only adds possible travel directions, so the shortest route from P2 to P3 must remain at most 400 m. A reported length of 580 m violates MR1.

Community Discussion

No comments yet. Be the first to start the discussion!