There are two types of testing: behavioral and structural. Structural testing often takes the form of a review in which a group of people inspects the source code line by line.
Behavioral testing focuses on system behavior rather than system structure. Each function/method has an associated function test that feeds the function a set of inputs, and then compares the outputs with the expected outputs. The expected outputs are provided by a table called an oracle. The test fails if one or more of the actual outputs differs significantly from the expected output.
Running a class test runs the function tests for each method. The class test fails if any of the method tests fails.
Running a subsystem test runs the class tests for each class in the subsystem. The subsystem test fails if any of the class tests fail.
Running a system test runs each subsystem test. The system test fails if any of the subsystem tests fail.
Testing frameworks are often used to automate the organization and running of tests.
Structural testing reveals many more bugs than functional testing.
Functional testing is good for regression testing.