What is testing

What is Testing?

Testing is the process of running an algorithm or program with carefully chosen inputs in order to check whether it behaves correctly. It is not enough to run a program once and observe that it produces a reasonable-looking result. Testing requires deliberate, systematic checking across a range of inputs - including those designed to challenge the algorithm at its limits.

Testing applies at two stages of development. Algorithm testing happens during the design phase, before any code is written. Tracing through pseudocode with test values catches logical errors early, when they are cheapest to fix. Program testing happens once code has been written and checks that the implementation matches the intended design. Catching an error at the algorithm stage avoids rewriting code later.

Testing cannot prove that a program is completely free of errors - it can only show that no errors were found with the tests used. This is why the choice of test inputs matters so much. Tests that never challenge the algorithm at its boundaries will miss the errors most likely to be there.

 Key Takeaways

  • Testing is the process of running an algorithm or program with chosen inputs to check for incorrect behaviour - not just to confirm it works.
  • A good test provokes failure. Tests should be designed to find bugs, especially at boundaries and edge cases.
  • Testing applies to algorithms (pseudocode, at design stage) and programs (code, after implementation). Fixing errors at the design stage is cheaper than fixing them in finished code.
  • Testing can show that errors were found, but cannot prove that no errors exist - only that none were found with the tests used.