Unit testing

Unit testing verifies the functionality of a specific section of code. In object-oriented programming, a unit often refers to the entire class, although it could also refer to each particular method. Unit testing aims to eliminate the development defects before the code is promoted to QA.

While unit testing is useful to detect code defects, it's primary aim is not debugging. Unit tests, usually, help improve the code quality by forcing certain coding standards. They also significantly improve regression testing by making it easy to verify that the new code did not introduce defects to existing features.

In unit testing, each test case is independent of others. Unit testing tools, typically, use method stubs and mock objects to ...

Get Serverless computing in Azure with .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.