Unit Testing is the process of writing small, code-level tests that prove that the method did what the developer intended when the test was written. Well-written Unit Tests test only one specific aspect or path through a single method (from @TimOttinger see F.I.R.S.T. Unit Testing Principles). Since most methods have multiple paths through them, they need multiple tests.
Unit Testing is not a replacement for Exploratory Testing, nor does it put Testers out of work. Instead, a Unit Test is simply a tool to help a developer discover if they built what they intended to. If their intentions weren’t correct, a Unit Test won’t catch that so they have only a limited effect on quality. But a Unit Test is useful as a safety net by demonstrating whether a change in the code affects the test case. Running Unit Tests frequently (usually every 10 -15 minutes) will give quick feedback if changes have harmed the behaviour of some other part of the code.
- Code from Practical Unit Testing with JUnit and Mockito
- Database UnitTesting Framework for SQL Server
- Don’t Measure Unit Test Code Coverage
- F.I.R.S.T. Unit Testing Principles
- UnitTest (by Martin Fowler)
- Unit Testing (from the book Software Engineering at Google)
Unit Testing Books:
*Thank you for visiting the World's Largest Opinionated Agile Reference Library. This content is created and the links are curated through the lens of Agile Pain Relief Consulting's view of what is effective in the practice of Scrum and Agile. We don't accept submissions and emails to that effect are marked as spam. Book listings may use affiliate links that could result in a small commission received by us if you purchase, but they do not affect the price at all. From experience, this won't amount to anything more than a cup of coffee in a year.« Back to Glossary Index