We use analytics to count visits and form use. It is on unless you reject it. We show no ads on this site.

Glossary

Data-driven testing

Published . Last updated . Published by Zapple.Tech, founded by the founders of CodeceptJS and Codeception, open-source testing frameworks.

Also called
DDT, parameterized testing, data driven testing
Published
Updated
Definition

Data-driven testing runs one test over many sets of input and expected values kept apart from the test logic. You write the check once and add cases as rows of data. It pays off when one flow must work for many inputs, such as prices, locales or user roles, and it is overkill for a handful of cases.

How does data-driven testing compare with keyword-driven and behavior-driven testing?

They answer different questions. Data-driven testing varies the values. Keyword-driven testing varies the steps. Behavior-driven testing varies who can read and write the case.

Data-driven Keyword-driven Behavior-driven
What varies The input and expected values The sequence of named actions The scenario, written in plain language
Who can add a case Anyone who can edit a data row Anyone who knows the keywords Business and QA, if they share the language
Maintenance cost Low for the data, one place for the logic The keyword library needs an owner The step wording needs an owner
Where it misleads Many rows can hide one weak check A sprawling library nobody trusts Scenarios nobody reads

The last three rows are our judgement from practice.

The Robot Framework user guide describes all three. Of the data-driven style it says the approach is “very useful when there is a need to test the same scenario with different input and/or output data.” Workflow tests in its keyword-driven style are “constructed from several keywords and their possible arguments.” Our explainer on behavior-driven development covers the third.

Data-driven testing: one test, written once, runs over many rows of input and expected values, here user roles, and gives one result per row; a case is added by adding a row

When does data-driven testing pay off, and when is it overkill?

It pays off when one flow must hold for many inputs. Think of a price calculation across tax rules, a form across locales, or one screen across user roles. Writing a test per case would repeat the logic and multiply the upkeep.

Common test tools support it out of the box. The Playwright documentation says you can parameterize tests on a test level or on a project level. pytest states that its parametrize marker “allows one to define multiple sets of arguments and fixtures at the test function or class.” The JUnit User Guide says parameterized tests “make it possible to run a test method multiple times with different arguments.” In Cucumber, the Scenario Outline keyword “can be used to run the same Scenario multiple times, with different combinations of values.”

It is overkill when you have three or four cases. A table adds a file to maintain and a layer of indirection for little gain. It is also the wrong tool when cases differ in steps, not values, because forcing them into one table makes the test logic full of conditions. In both cases, write plain tests. If the suite structure itself needs rework, see our custom framework development service. For the wider choice, see how to build a test automation strategy and five strategy mistakes to avoid.

What goes wrong with data-driven suites?

These are practitioner judgement, not measurements.

  • One failing row hides in a long run. A report that says “test failed” without the row that failed wastes the time the table was meant to save. Insist that each row reports under its own name.
  • Data files nobody owns. Rows go stale when the product changes. Name an owner for each file and review it like code.
  • Slow suites. Hundreds of rows through a browser take hours. Run wide tables at the API level, where each row is cheap. See API test automation.
  • Rows that test the same thing. Many near-identical values add run time, not coverage. Choose values by boundary and rule, not by volume.

Where the data comes from is a separate subject. A table in the repository is the simplest start. Our tool comparison covers the unit test tools you would run it with.

What does Zapple.Tech do about it?

If you are not sure whether your suite needs data-driven tests, start with the evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the QA audit and assessment page.

Tell us about your suite in the form below.

  • Regression testing

    Regression testing confirms that a change, including a defect fix, has caused no adverse consequences. The same checks are run many times, which makes it a strong candidate for automation. Our regression testing services build an automated regression suite in your repository that runs in your CI before every release, with every red run triaged.

  • API testing

    API testing checks a service directly through its interface rather than through a screen. Tests send requests to endpoints and verify responses, business rules, data and access rules. Our API testing services write automated API tests in your repository, covering contracts and back-end rules, and run them in your CI on every change.

  • Page object model

    The page object model (POM) is a design pattern for UI test automation in which each page or part of an application is represented by a class that holds its locators and the actions a user can take there. Tests call those methods instead of repeating selectors, so a change in the interface is fixed in one place.

  • Behavior-driven development

    Behavior-driven development (BDD) is a way of working in which developers, testers and business people agree how software should behave by writing concrete examples in plain language, usually as Given/When/Then scenarios, and then automate those examples as tests. The conversation comes first; Gherkin and Cucumber are its notation and tooling, not BDD itself.

  • Test data management

    Test data management is how a team creates, protects, shares and refreshes the data its tests run on. Done well, tests get realistic data on demand and no real customer data sits in test systems. Done badly, releases wait for environments and tests fail for reasons that have nothing to do with the code.

All terms in the glossary

Service

Custom test framework development

Test automation framework development: a framework set up or reworked for your stack, repository and CI, from the founders of CodeceptJS and Codeception.

See the service

Questions about data-driven testing

What is data-driven testing?

Data-driven testing is a way of writing automated tests in which one test logic runs over many rows of input and expected results kept separate from the code. Adding a case means adding a row, not writing a new test. It suits flows where the steps stay the same and only the values change.

What is the difference between data-driven and keyword-driven testing?

Data-driven testing varies the values and keeps the steps fixed. Keyword-driven testing builds each test from named actions, so the steps themselves can differ between tests. The two combine well, with a keyword-built flow run over a table of data.

What is the difference between data-driven testing and behavior-driven development?

Behavior-driven development is a way of agreeing and writing down expected behavior in plain language, usually as given, when, then scenarios. Data-driven testing is a way of running one test over many values. A scenario template in a behavior-driven tool is one place where the two meet.

Where should the test data for data-driven tests live?

Keep it in your repository, next to the tests, in a plain format a reviewer can read, such as a table file. Give each file an owner. Data from production or a shared database makes results change without a code change, so use it only with a clear refresh process.

Request a QA audit quote

Tell us what you ship and what worries you.

What happens after you send this

  1. You send the form: your situation and what you need tested, then your name and work email.
  2. Within one business day, we reply with a suggested first step, its scope, timeline and a quote.
  • Fixed scope
  • You decide after each step
  • The tests live in your repository
  • An NDA signed before access

“They helped us to close the positions and consult our team how to proceed further. High-quality quick feedbacks with the deep checking of the required tasks, professional approach, great understanding of the company's technologies and product, detailed reports.”

Kristina Lavrentieva, Manager at keepgo.com, Israel
  • Rated 4.9 out of 5 on Clutch, from 7 client reviews
  • 42 completed test automation and infrastructure projects
  • Founded by the founders of CodeceptJS and Codeception, open-source testing frameworks

Request a QA audit quote

    What is closest to your situation?
    Optional. The product, the platforms, how often you release, what broke last.

    You decide after our reply whether to go ahead.

    Prefer to talk first? Book a call

    One-week QA audit · written report

    Request a QA audit quote