Jump to content

Unit testing

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Edaelon (talk | contribs) at 08:03, 7 May 2003 (Added draft for unit testing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Unit testing is a method of creating certain type of test program for your code module, preferably before the code module to be tested is implemented or even designed.

The idea is to write test cases for every function or method in the module to be tested so that each test case is separate from others if possible. After completion of the unit test it is easy to check if the module is working properly. Another nice benefit is that unit testing allows you to refactor code, knowing that you didn't break anything while refactoring.

Python is one of the programming languages featuring built-in module for unit testing.

See Pyunit for more information.