POTD 7: Logic coverage for source code (highEnough)

Section 1: — Due 29-October-2026, 1pm
Section 2: — Due 30-October-2026, 1pm

Purpose: Practice applying logic-based testing for program source code; get ready for Assignment 5, and prepare for quiz 4 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 another student in this course (max team size = 2).


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) CS 3250-001 (Section 1):

(-2.5 points) for 24 hours late (submitted after 29-Oct-2026 1pm, by 30-Oct-2026 1pm)
(-5 points) for 48 hours late (submitted after 30-Oct-2026 1pm, by 31-Oct-2026 1pm)

CS 3250-002 (Section 2): Please refer to Schedule-002 for the due date.

(-2.5 points) for 24 hours late (submitted after 30-Oct-2026 1pm, by 31-Oct-2026 1pm)
(-5 points) for 48 hours late (submitted after 31-Oct-2026 1pm, by 1-Nov-2026 1pm)


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 © 2026 Upsorn Praphamontripong
Released under the Creative Commons License CC-BY-NC-SA 4.0 license.
Last updated 2026-10-27 11:48