Method constructed with special test syntax to describe the expected outcomes of given method inputs. A unit test will call a method or function with inputs that have known, expected return values. Any changes to the method which cause its return values to conflict with the known, expected return values will cause an exception. This exception signals that this method must be corrected; no further testing is necessary if the corrections then make the method return the known, expected return values.
A test of software at the lowest level of modularity; a test of an individual class or method as opposed to a test of a system consisting of many interacting classes. Software development methodologies such as Extreme Programming (XP) and Test-Driven Development emphasize the development of software and unit tests as one process, or go even further, encouraging programmers to write tests before writing the software.