POTD 7: Logic coverage for source code (highEnough)

Due 1-Nov-2025, 11am EST

Purpose: Practice applying logic-based testing for program source code; get ready to work on homework assignment, and prepare for quiz4 and the final exam

You may make a copy of a worksheet and complete this activity, or simply type your answers in any text editor.

You may work alone or with at most two other students in this course.


Consider the following Java method, highEnough(), and tests t1 - t7
Line  1:  public String highEnough(boolean e, int lft, int rht)
Line  2:  {
Line  3:      int result = 8;
Line  4:      int n = rht % lft; 
Line  5:      if (n == 0 || e)
Line  6:         result = rht;
Line  7:      else
Line  8:      {
Line  9:         for (int i=2; i <= n; i++)
Line 10:         {
Line 11:            result = result * 4;
Line 12:         }
Line 13:      }
Line 14:      if (result >= 17)
Line 15:         return ("Yes");
Line 16:      else
Line 17:         return ("No");
Line 18:  }    

Identify a minimal set of tests for highEnough() that achieves Correlated Active Clause Coverage (CACC).

For credit, you must use tests from the list of seven tests (t1, t2, …, t7) given in the following table.

Show your analysis and thought process.

[optional] You may start by filling out the following table. The values for test t1 are already filled in for you. (F = False, T = True, n/a = not applicable). This table will not be graded but it may be helpful when you answer this question.

test# e lft rht highEnough(e,lft,rht) n == 0 e i <= n result >= 17
t1 F 4 6 Yes F F T T
t2 F 3 9          
t3 T 4 7          
t4 F 8 9          
t5 F 4 8          
t6 T 4 4          
t7 T 5 0          


Grading rubric

[Total: 10 points]: Done (or provide evidence of your attempt, full or reasonable effort)

(-2.5 points) for 24 hours late (submitted after 1-Nov-2025 11am EST, by 2-Nov-2025 11am EST)
(-5 points) for 48 hours late (submitted after 2-Nov-2025 11am EST, by 3-Nov-2025 11am EST)


Submission

Making your submission available to instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.


Copyright © 2025 Upsorn Praphamontripong
Released under the Creative Commons License CC-BY-NC-SA 4.0 license.
Last updated 2025-10-26 9:41