Testing Lab Exercises (WBT)

Draw Control-Flow Diagrams

Draw Control-Flow Diagrams

  1. Draw a control-flow diagram1 for the following method:
    • moveSecondJokerDownTwo
  2. Using your calculated values for cyclomatic complexity, identify values for the method parameters that will cover all the possible paths through the method. For example, if your cyclomatic complexity is 5, you should identify 5 sets of input values that will execute the 5 different paths through the method.
  3. Save your control-flow diagram (as PNG or JPEG) in your Solitaire/project_docs folder.

Hints

  • You can label your diamonds and rectangles with line numbers instead of copying code into the diagram.
  • The sets of input values will be helpful for the next step and will easily become test cases.

Footnote

  1. We suggest using draw.io for your diagrams.