Concepts / Debugging Techniques

Debugging Techniques

The software development process has five phases: What (Analysis), Do It (Implementation), Test (Testing and Debugging), Use (Operation or Deployment), and Maintain (Refinement).

  • Programming

From Idea to Working Program

Writing software is not a single action. It is a structured journey from an idea to a working program that solves a real problem. A clear development process helps programmers avoid building the wrong thing, finding important bugs too late, or creating software that is difficult to maintain or extend.

The software development process has five phases: What, Do It, Test, Use, and Maintain. The names also describe their more formal roles: Analysis, Implementation, Testing and Debugging, Operation or Deployment, and Refinement.

The Five Development Phases

planbuildverifylearn and refineWhatAnalysisDo ItImplementationTestTesting and DebuggingUseOperation or DeploymentMaintainRefinement
What happens next as a project moves through What, Do It, Test, Use, and Maintain, and how do these phases connect?
PhaseFormal roleMain question
WhatAnalysisWhat should the program do?
Do ItImplementationHow will the program be built?
TestTesting and DebuggingDoes the program work correctly?
UseOperation or DeploymentDoes the program work when it is used?
MaintainRefinementWhat should be improved or changed?

The five phases and the purpose of each phase

What is the analysis phase. You determine what the program should do before building it. Do It is implementation: you create the program. Test includes testing and debugging, where you run the program with test data to check for errors and correct problems. Use is operation or deployment, where the program is used on real data to verify that it works in its intended setting. Maintain is refinement, where you improve the program based on what you learn.

The Do It-Test-Use Cycle

buildcorrectexpandimplement againDo ItImplement a simple versionTestTest and debugUseVerify it worksNext featureRepeat the cycle
How does a program move from implementing a feature to testing it, using it, and then repeating the cycle for the next feature?

The recommended practical approach is iterative. Instead of attempting to build the entire program perfectly in one attempt, build a simple version first. Test it thoroughly, verify that it works, and then add a feature. After adding the feature, test and use the expanded version again.

Why start with a simple version?

A programmer wants to build a program with several features. Should all features be built before testing begins?

Start small: Build only a simple version so the basic approach can be checked before more time is invested.

Test thoroughly: A simple version is easier to test thoroughly, making it easier to find and fix fundamental problems early.

Verify the foundation: Using the working version creates a stable foundation for later features.

Add and repeat: Add another feature, then repeat implementation, testing, and use rather than postponing all verification until the end.

The iterative approach reduces risk because problems are discovered while the program is still small and easier to change.

Adding Features Incrementally

implementdebugadd next featurecontinue learningFeature 1Simple versionTestFind and fix problemsUseVerify correctnessFeature 2Expand the programMaintainRefine the result
How does each new feature pass through implementation, testing, use, and refinement without requiring the entire program to be built at once?

Incremental feature addition means that the program grows through verified steps. A programmer implements a simple feature, tests and debugs it, uses it to verify correctness, and then adds the next feature. The entire program does not need to be completed before useful checking begins.

Starting with a simple version reduces risk in several ways: it validates the basic approach before complex work, makes thorough testing easier, catches fundamental problems early, and limits the time invested if the approach needs to change.

Planning a Simple Project

definebuildcheckrefineWhatDefine a task-list programDo ItBuild one task featureTestCheck task behaviorUseTry real tasksMaintainRefine with new features
How would a specific project idea map to the What, Do It, Test, Use, and Maintain phases?

A task-list program

Plan a simple program that helps a user work with a list of tasks.

What: Define the purpose of the program: it should support a basic task-list activity. This is the analysis phase.

Do It: Build a simple first version with one essential task-list feature. This is the implementation phase.

Test: Run the simple version with test data, check for errors, and debug problems. This is the testing and debugging phase.

Use: Use the program with real task information to verify that the basic approach works in its intended setting.

Maintain: Refine the program based on what was learned during use, then continue the iterative cycle when adding another feature.

The project begins with a defined purpose and a small working version. Each later improvement is added after the current version has been tested and used.

This planning method can be applied to a Python script or another small program. Think about what the script should do, write a simple version, run it with test data, use it on real data, and refine it based on what you learn. The example is intentionally small because the process is easier to follow when the first version has a limited purpose.

Mistakes That Delay Debugging

  • Building the entire program before testing it

    Problems are discovered late, when it is harder to identify which part of the large program caused them.

    Fix: Build a simple version, test it thoroughly, use it to verify correctness, and then add features incrementally.

  • Treating testing as a final activity only

    Fundamental problems can remain hidden while more work is built on top of them.

    Fix: Use Test as a regular part of the Do It-Test-Use cycle.

  • Skipping the What phase

    The programmer risks building the wrong thing or choosing an approach that needs major correction later.

    Fix: Start with analysis: define the intended purpose before implementation.

  • Treating Use as identical to Test

    Testing checks the program with test data, while Use verifies that it works in its intended setting.

    Fix: Include both testing and use before refining the program.

  • Ignoring Maintain after the first working version

    The development process includes refinement based on what is learned from using the program.

    Fix: Treat the working version as a foundation that can be improved and extended.

A Planning Check

MEDIUM

Choose a small programming project and write one planning statement for each phase: What, Do It, Test, Use, and Maintain. Then identify the first simple version you would build and the next feature you would add after verifying that version works.

Hints
  • Keep the first version limited to one essential purpose.
  • Separate test data from the real use of the program.
  • Describe Maintain as a refinement or a later feature based on what you learn.

A strong plan makes the next action clear: define the purpose, implement a small version, test and debug it, use it to verify correctness, and refine it before repeating the cycle.

Key Takeaways

  • The five software development phases are What or Analysis, Do It or Implementation, Test or Testing and Debugging, Use or Operation or Deployment, and Maintain or Refinement.
  • The recommended approach is iterative: build a simple version, test it thoroughly, verify that it works, and then add features.
  • Starting small reduces risk because it validates the core approach and exposes fundamental problems earlier.
  • Each new feature should pass through implementation, testing, use, and refinement rather than being added to an unverified program.
  • The five phases provide a practical planning structure for both small scripts and larger software projects.