A unit test looks at a small section of the overall computer program. A system test checks that the whole program works.
As units of the program are created and developed, they are then tested and slowly integrated into a much larger working piece of code to make the computer system. Units are sets of code made up of one or more module.
As each new part of the system is completed, it is tested to make sure that it works properly - otherwise other parts of the system that will rely on it could fail. This is called unit testing. If the new part of the system works, it can be used by other parts of the system.
A unit test is usually undertaken early on in the development cycle. One benefit of unit testing is that it helps you to discover problems early when the problems are small. Some programming languages, including Java, Python and Ruby, have built-in features to support unit testing.
During a unit test, testing will make use of different values of data and different types of operating conditions.
Once you reach a point in the development cycle when a number of units are ready and tested, a system test can take place. The purpose of a system test is to ensure that all the individually-developed units of software work together as intended.
When problems are found in a system test, it might indicate that more unit development is required. Once this is complete, more unit tests and system tests will be necessary.
One benefit of system testing is that it helps you to discover problems or inconsistencies between the software units that are intended to work together.