Why Do You Need to Unit Test If You Have a QA Team?
This introduction to the need for unit testing shows the difference between unit testing and QA, and why you need people dedicated to both.
Join the DZone community and get the full member experience.Join For Free
You might be wondering about unit testing and your QA team. Why would you need to unit test if you have a whole team dedicated to checking for problems?
I think this relates to understanding the function and purpose of a QA team, as well as the utility of unit tests.
In this post, I'm going to present definitions for the terms "QA team" and "unit testing." Then I'll discuss what you should do with them through an example. In the end, I hope you'll understand how the QA team and unit tests are related-and how both are important parts of developing high-quality software.
The Short Answer
Quality is more than just implementing a few tests to ensure that things work. It encompasses the focus of the application, what features it contains, and how the features interact with each other. Quality means the application satisfies the business need. And it's also about how well the system is constructed. Will it be easy to change in the future? Is the code understandable? Is the business logic or math validated and tested?
A strong development team builds rock-solid and well-tested software with plenty of unit tests. A QA team ensures that the software focuses on the correct business needs and meets the users' requirements. Together, the development team and the QA team can help the organization as a whole to provide solutions to users.
The QA team cannot function in isolation and achieve their goal. Furthermore, developers are far too busy dealing with the thousands of details in a software system to thoughtfully consider every aspect of the business situation. The QA team and the developers need to work together to create quality software.
Now you have the short answer. But let's explore why this is true by laying a foundation of information about what QA and unit tests are.
What Does a QA Team Do?
A QA team's purpose is to oversee and coordinate the assurance of quality of the software product. Quality assurance means we're building the quality into the system at every point, not just checking for it when we're done.
Your QA team should be doing two important things. First, they should make sure that you're building the right thing. The QA team should constantly be asking the question, "Are we building software that will have a positive impact on the business?" Related to that are questions like, "How does this help the business make or save money?" and, "Is this platform or technology the most effective approach to solving the problem at hand?"
The QA team also works to make sure you're building the software correctly. Therefore, verification by a variety of means is certainly part of what QA does. However, QA is not limited to testing the system. In fact, it's probably best if the QA team's role is to make sure the system is tested, not to do all the testing.
What Is Unit Testing?
Unit testing has many and varied definitions. For this discussion, let's keep things simple and say that unit testing means testing individual components of a software system, in isolation. Unit tests tell us that the system has been built correctly.
Manual unit testing is a very dangerous approach to quality assurance. Humans suffer from fatigue and lack the discipline to execute hundreds-let alone thousands-of tests with anything approaching consistency. Manual testing is also time intensive and can delay the delivery of a system for weeks or months.
Automated unit tests are generally simple, executable pieces of code that verify the behavior of another piece of code. Because modern software systems can contain hundreds of features, it's not uncommon for there to be thousands of unit tests. In some cases, there might be tens of thousands. Automated unit tests execute very quickly and as often as desired.
Published at DZone with permission of Erik Dietrich, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.