DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Why Do You Need to Unit Test If You Have a QA Team? (Part 2)

Why Do You Need to Unit Test If You Have a QA Team? (Part 2)

Both QA and unit testing are essential to build quality software; see how QA, unit testing, and test-driven development work together for a strong testing strategy.

Leah Grantz user avatar by
Leah Grantz
·
Aug. 03, 18 · Opinion
Like (2)
Save
Tweet
Share
12.36K Views

Join the DZone community and get the full member experience.

Join For Free

In our previous post, we covered all the bases. In this part, we dig deeper and identify what the real differences are in practice. Let's continue!

Real-Life Features

Let's assume that we have a customer account feature in our application. Users modify things on their account, like their name, current phone number, credit card information, or their system avatar. Somewhere in the system, there must be a "save account information" module.

The QA team works with the business stakeholders and the developers to outline a suite of story tests for this "save account information" feature. Story tests are part of an overall test plan for the feature.

A test plan is one technique that a QA team uses to ensure that every feature is verified. A test plan acts as a guide or checklist for this part of the quality assurance process.

An Example Test

A simple example of a story test might be "The save account module verifies that the account record contains an account holder name so the account holder can be identified by name." For most features, there will be many tests. Each one needs to contain three things: an action, a result, and a "why." Our example test tells us the action is verifying upon save. The result is that the save requires the account holder name. The "why," which is "can be identified by name," places the test in context. Remember, these tests start out in plain English; they need to be understandable. Therefore, they might not rigidly conform to any format.

So in planning for this feature, we want to create story tests; plan for exploratory testing; possibly create test scripts; schedule, execute, and report on user acceptance testing; and ensure that we use unit tests where we need them.

How QA and Unit Test Creators Work Together

The QA team works across the entire development group. They interact with the stakeholders, users, product team, architects, developers, DevOps team, system administrators, help desk, technical writers-pretty much everyone involved in defining, delivering, and using the software.

The QA team may help the developers understand the requirements or the quality goals with respect to automated unit tests. Developers may help the QA team understand the system components so they can define or build other kinds of tests. The two groups must work together to gain the maximum effect of quality assurance.

Closest to the Source Wins

Unit testing is best done by the people developing the units. I strongly advocate for test-driven development (TDD); in fact, I generally refuse to work without it. Unit tests are a consequence of TDD. A disciplined team using TDD to build software will get both testable and tested software as a side effect of the TDD process.

If you choose not to use TDD, here are some issues to consider.

"Test after" approaches include having the developers build their own unit tests and having other developers build the unit tests. Both of these approaches have serious flaws.

Having the developers build tests after the code is "code complete" does nothing to ensure the testability of the system. Often, it requires changes in the system to make it more testable. When it's too difficult to create tests, developers skip or exclude them.

Having the QA team (or anyone else) build tests after the code is code complete has the same flaws as having the developers do test after. Because the QA team doesn't spend all of their time writing code, they may also struggle to keep up with the developers or have difficulty understanding the code.

The distribution of labor here does not pay off.

What Should You Do?

Now that we've discussed how unit tests and the QA team are related, here's some advice on using both to deliver high-quality software. First, empower the QA team to participate across the entire development process. Their job is to ensure that the right thing is built and that it's built well.

Second, look closely at how unit testing is being done. Ask your developers to explore TDD. Take a very serious look at TDD. Look at how it affects the way your software is built. Talk to your QA team about unit testing. They'll have some strong opinions about its utility.

Summing Up

I hope that this has clarified what a QA team does for your organization. I also hope you're a little clearer on what a unit test is, though that's a very broad topic and I've only skimmed the surface here.

What's most important to take away is that the existence of the unit test is mandatory, but the responsibility for its creation is on the developers. The QA team is there to provide guidance and support for the developers in this sense, not to create them.

unit test Question answering teams

Published at DZone with permission of Leah Grantz, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Best Use Java Records as DTOs in Spring Boot 3
  • AWS CodeCommit and GitKraken Basics: Essential Skills for Every Developer
  • Test Execution Tutorial: A Comprehensive Guide With Examples and Best Practices
  • Building a RESTful API With AWS Lambda and Express

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: