From the course: Agile Software Development: Clean Coding Practices

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

What's a "unit" test?

What's a "unit" test?

From the course: Agile Software Development: Clean Coding Practices

Start my 1-month free trial

What's a "unit" test?

- [Instructor] The phrase unit test can mean different things to different people, so it's important to take a few moments and discuss what unit test means for this course. For our purposes, a unit test is a test which focuses on a single component and isolation from other components in a software system. Because test code is still code, we need to pay attention to other clean code rules that we've discussed in this course. Avoid creating messy test code. There are some additional qualities that a clean unit test needs to have. Unit tests are fast, the faster the better. When your tests are slow, you're not going to want to run them. Each unit test runs in less than a second. And a full suite of unit tests should take no more than a couple of minutes. Unit tests are focused. Each unit test only has one reason to fail because it's only testing one specific detail at a time. This allows a test to point us in the right…

Contents