Glossary of Unit Testing and Related Terms

Learn the most important unit testing terms used in the software engineering industry.

We'll cover the following

Introduction

In this lesson, you’ll learn the most important unit testing terms used in the software engineering industry. Furthermore, you’ll learn some broader terms that relate to unit testing. For example, although dependency injection is not a concept unique to unit testing, it is relevant because it makes unit testing easier. These various terms have been covered in detail throughout the course lessons and are outlined in this lesson.

Unit test terms

The following are the most common terms found in unit testing. The following outlines the name and definition of each term. There are sometimes various other names for the terms presented below. In such a case, we’ll include these terms as well.

Term Definition
Software testing Software testing is the process of verifying that software does what it is intended to do.
Test case A test case is a set of operations that a system is set to perform to determine whether the system satisfies the requirements and whether it functions correctly.
Manual testing Manual testing is a type of software testing where a person manually executes test cases without using any automation tools.
Tester The person who executes manual tests is known as a tester and can be the developer or another member of the team, such as a dedicated tester.
Software regression Software regression is the term used to describe a scenario where, due to the introduction of a bug, a feature that is working in a given release stops working in the next release.
Feature addition A feature addition is a code change that adds a piece of software functionality.
Software bug A software bug, otherwise known as a bug, defect, or issue is an erroneous execution that causes the software’s behavior to diverge from its expected performance (as required by the end user) and is usually introduced due to an error during the software development lifecycle.
Refactoring Refactoring is the act of improving the structure of the software’s source code while continuing to meet the original specifications.
Optimization Optimization is the act of changing software to enhance the effectiveness and efficiency of resource utilization.
Regression testing ​​Regression testing is a software engineering practice that ensures an application continues to function to specification after any code change that may arise from optimization, refactoring, bug resolution, or feature addition.
Regression tests Regression testing is composed of one or more regression tests.
Automated testing Automated testing, otherwise known as test automation, is a software testing practice whereby code, usually written using a chosen software testing framework, is run to test application code.
Application code Application code is code that executes to fulfill user requirements or specifications.
Test code Test code is code that is written to test application code.
Unit tests Unit tests verify the individual isolated parts of the software product.
Integration tests Integration tests verify that various components of the software product work together as intended including calls to and responses from APIs and integration with databases.
End-to-end tests End-to-end tests utilize a helper robot or code to navigate around the software application from initial input to final output to verify that it functions as expected.
Unit testing Unit testing is where pieces of software are tested with the purpose of validating that each piece of the software performs as expected.
Unit of software A unit of software is any piece of code that, in a procedural language, may consist of a function or functions, or, in an object-oriented language, of a class and its nested classes, and is designed to accomplish one certain clearly identifiable task.
SUnit An SUnit is a historical unit test framework that was used to test software developed in the Smalltalk programming language.
xUnit An xUnit framework is a unit test framework that derives its structure and functionality from Smalltalk’s SUnit.
NUnit NUnit is an open-source unit testing framework for the .NET Framework and for Mono.
Arrange This is the first step in the AAA pattern, corresponding to accepting input. Here, we set up the test case. This includes preparing the input for the method which we would like to test. It could include instantiating relevant application code classes and initializing their values.
Act This is the second step in the AAA pattern, corresponding to processing inputs. Here, we invoke the methods that we are testing. This typically involves calling a method that in turn could do various other things.
Assert This is the third step of the AAA pattern, corresponding to providing output. Assert verifies the expected outcome of the method within the application code being tested. The outcome of an assertion is either pass, fail, or ignore.
General test case A general test case, or general case, is when the code executes data that is arranged such that no value is on the edge or periphery of all its possible values.
Equivalence partitioning Equivalence partitioning is the act of dividing all inputs into groups based on expected outcomes, such that there is a set of shared, meaningful characteristics among all the expected outcomes of a group.
Equivalence classes The result of equivalence partitioning is a set of equivalence classes.
Edge case An edge case is input data with values hovering over some extreme, boundary, or condition.
Corner case A corner case is when multiple inputs simultaneously take on extreme values.
Positive test A positive test case tests whether the code acts as it should.
Negative test The software specification may prohibit certain actions in certain conditions, or such prohibitions may be a logical consequence of the explicitly stated specification. A negative test checks whether these prohibitions are respected or whether they are violated.
Test coverage Test coverage is a measure of the degree to which the application code is executed when test code is run.
Branch coverage Branch coverage is the ratio of the number of executed branches in an application’s code to the total number of branches in the code.
Code coverage tool A code coverage tool runs all test cases and indicates code coverage and branch coverage.
Statement coverage Statement coverage is the ratio of the number of executed statements in an application code to the total number of statements.
White-box White-box testing tests the internals of the application code.
Assertion An assertion is a statement that compares an actual value to some expected value and returns the result of that comparison.
Classic assertions Classic assertions are standard assertions that do not use the fluent syntax.
Constraint assertions With constraint assertions, assertions are built by chaining various components. They are otherwise known as fluent assertions.
Value equality The values that are contained by two variables are equal.
Reference equality This is applicable to reference types where equality means the variables refer to the same object in memory.
Code pollution Code pollution is introduced when the application code grows due to unit testing.
Regular expressions Regular expressions offer a wide variety of pattern matching operators so that equality assertions can act flexibly.
Type If two objects are of the same type, it means that they are instances of the same class.
Is-a relationship ObjectA is-a ObjectB if it inherits ObjectB directly or indirectly.
Floating-point Floating-point numbers are a data type that represent real numbers in machine architecture.
Exception An exception is something a called method raises to its caller when a certain set of conditions is met.
Exception handling Exception handling is the process of responding to raised exceptions.
Normal test cases Normal test cases are test cases that test for behavior that does not throw exceptions.
Exception test cases Exception test cases are test cases that test for scenarios where exceptions are thrown.
Test case setup Test case setup is the process of arranging data in such a way that it may be arranged once and consequently used by various test cases.
Parameterized tests Parameterized tests cater for testing the same behavior with a different array of inputs/outputs.
Test fixture A test fixture is a class that is marked as containing test methods and can be used to parameterize the setup method.
Test process approach This is the process and order in which test code is written, for example, writing test code before or after application code.
Test after development The test after development approach is defined as writing the test code after the application code.
White-box testing White-box testing (also known as clear, glass box, or structural testing) is a testing technique that evaluates the code and the internal structure of a software unit.
Gray-box testing Gray-box testing is a combination of white-box testing and black-box testing.
Black-box testing Black-box testing involves testing (including unit testing) application code with no prior knowledge of its internal implementation.
Test-driven development Test-driven development (TDD) entails writing the test code before the application code.
Dependency A dependency is a class or object that another class or object relies on.
External dependencies External dependencies are dependencies that rely on classes that interact with external resources.
Tightly coupled dependency Tightly coupled dependencies are dependencies where a group of classes are highly dependent on one another.
Loosely coupled dependency Loosely coupled dependencies are dependencies that are achieved using a design that promotes the single-responsibility and separation of concerns.
Fake object A fake object is an object that is sufficiently implemented to enable testing another object that depends on it.
Dependency injection Dependency injection is a technique in which an object receives other objects that it depends on, called dependencies.
Dependency injection container A dependency injection container is an object that knows how to instantiate and configure objects.
Mocking framework A mocking framework is a library that easily creates and configures mock objects.

Conclusion

Most of the unit testing terms presented above apply to principles in unit testing. This means that their usage or meaning is equally applicable to other unit test frameworks outside the .NET framework. As such, your knowledge and understanding of these terms is useful in any tech stack environment you may find yourself in.

Get hands-on with 1400+ tech skills courses.