

"Working software over comprehensive documentation" is one of the four core values of the Agile Manifesto.

System testing - ensuring that your code can run in the environment where it will be deployedĪcceptance testing - validating that the software you have built truly addresses users' needs and solves their problems Integration testing - confirming that your units are working together to produce the expected output Unit testing - verifying that your code is working at its most basic level, the unit Here is an overview of the four levels of software testing, along with who is responsible for each: Detecting defects in the code early helps the development team save time and resources - plus bugs can be harder to find or isolate in later testing stages. Other stages typically include integration, system, and acceptance testing. Sometimes referred to as component testing, unit testing is the most granular level of software testing. For this reason, unit testing gives you confidence that your function will continue to operate correctly, even when other pieces of the code are changed during the development process. You are showing that your function will produce the desired outputs or perform the way you expect. The test could also assert that the function raises an error when you input a number as an argument.Īs the example above illustrates, the purpose of unit testing is to confirm that your code is working correctly. Your unit test would assert that the code generates a capital letter after you input the corresponding lowercase letter. Usually developers test each unit against potential scenarios that might occur when users interact with the software.Ĭonsider a function that capitalizes a string of letters in a text-editing program. A unit is the smallest portion of code (typically a function or method of an object) that can be isolated and tested independently. Unit testing refers to verifying the behavior of code at its most foundational level - the unit.
