Skip to content

Testing and Debugging

mike-snhu edited this page Aug 15, 2026 · 2 revisions

Testing and Debugging

Python testing and debugging are optional practice for the Module Three Assignment. The graded deliverables are the flowchart and pseudocode.

If you complete the optional Python program, testing helps you check whether the program actually follows your design.

Start With Manual Tests

Run the optional program and try values that exercise different paths.

Boundary values are especially useful. In this assignment, 40 hours is the point where the pay rule changes for additional hours.

The provided SRS includes four numeric acceptance cases you can use for practice.

Run the Provided Practice Tests

From the repository root:

python3 tests/test_paycheck_calculator.py

The tests run your program with several values and look for the expected numeric paycheck in its output.

They do not require one exact prompt or currency format because the assignment does not specify exact wording for the optional Python implementation.

Debugging Is Comparison

When a test fails, compare four things:

  1. Requirement — what should happen?
  2. Flowchart — what did you design?
  3. Pseudocode — what did you design in text form?
  4. Python — what did you implement?

Find the first place where they disagree. Fix one problem, then test again.

If the design is wrong, update the design first. If the design is correct but the program differs, update the program.

A Failed Test Is Information

A failed test tells you that the observed result does not match the expected result for that case. Read the failure message and use the input value to reproduce the problem manually.

You do not need to understand every line of the provided test script to benefit from its results.

Clone this wiki locally