Unit Test

You are here:
Estimated reading time: 1 min

A unit test is an automated test that verifies a small part of code, also called a unit, quickly and in isolation. The purpose of unit tests is to evaluate the behavior of these units.

It is important to be aware of what exactly counts as a unit and how to isolate them. A unit can be a class or a collection of classes that reflect the behavior of the system, no matter how granular. By isolation, it is meant that the unit tests act independently of each other by detaching certain dependencies with stubs and mocks. Dependencies which should be isolated are those that are shared among the unit tests and those that behave in a non-deterministic way, such as the current date or time.

For writing and executing unit tests, it is best practice to use unit testing frameworks as well as mocking frameworks for creating mocks and stubs.

Was this article helpful?
Dislike 0
Views: 150

Continue reading

Previous: The Testing Pyramide

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Privacy Settings saved!
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

GetResponse, Google Analytics

We use Google Analytics for marketing purposes. You can disable these cookies.
  • __utmz
  • __utma
  • _ga
  • _gat

We use GetResponse for marketing purposes. This service cannot be disabled, otherwise the website functions will be limited.

Decline all Services
Accept all Services
Get Free Access Now to
9 eBooks!
All about Automated Software Testing
Proven experts
Learn to save up to 75% of your test efforts
Get Free Access Now!
Get Access Now! & Save 50%
Personal Trainer FREE Nutrition Custom Workout App
Get Access Now!
eBook Download
Enter your details to get your free ebook!
All about Automated Software Testing
Download Free Ebook
Lorem ipsum dolor sit amet, consectetur adipiscing