POTD 5: Data flow graph coverage for source code

Section 1: — Due 15-October-2026, 1pm
Section 2: — Due 16-October-2026, 1pm
Purpose:

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

public static List<String> fizzBuzz(int n) 
{
   var answer = new ArrayList();
   for (int i = 1; i <= n; i++) 
   {
      if (i % 2 == 0 && i % 3 == 0)
         answer.add("FizzBuzz");
      else if (i % 2 == 0)
         answer.add("Fizz");
      else if (i % 3 == 0)
         answer.add("Buzz");
      else
         answer.add(Integer.toString(i));
   }
   return answer;
} 
  1. Draw a Control Flow Graph for the fizzBuzz method Annotate the graph with all information (i.e., code on nodes, code on edges, defs, and uses). — Make sure that your graph is *valid*
  2. List all du-pairs, then derive du-paths (the du-paths then can be used as test requirements)

    In reality, all variables must be analyzed and taken into account when designing tests. Due to the class time constraints, we will analyze and complete this part for a variable answer only.

    DU-pairs DU-paths
       
  3. Apply All-Defs coverage to design tests

    In reality, all variables must be analyzed and taken into account when designing tests. Due to the class time constraints, we will analyze and complete this part for a variable answer only.

    Test requirements (DU-paths) Test paths Test cases (input values and expected output)
         
  4. Apply All-Uses coverage to design tests

    In reality, all variables must be analyzed and taken into account when designing tests. Due to the class time constraints, we will analyze and complete this part for a variable answer only.

    Test requirements (DU-paths) Test paths Test cases (input values and expected output)
         
  5. Apply All-DU-Paths coverage to design tests

    In reality, all variables must be analyzed and taken into account when designing tests. Due to the class time constraints, we will analyze and complete this part for a variable answer only.

    Test requirements (DU-paths) Test paths Test cases (input values and expected output)
         
    
            

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 15-Oct-2026 1pm, by 16-Oct-2026 1pm)
(-5 points) for 48 hours late (submitted after 16-Oct-2026 1pm, by 17-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 16-Oct-2026 1pm, by 17-Oct-2026 1pm)
(-5 points) for 48 hours late (submitted after 17-Oct-2026 1pm, by 18-Oct-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-06 13:46