ArticleslgStudy

computer science

Data-driven testing

Data-driven testing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Data-driven testing rather than just read about it. In short: Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing technique that uses a table of data that directs test execution by encoding input, expected output and test-environment settings. One advantage of DDT over other testing techniques is relative ease to cover an additional test case for the system under test by adding a line to a table instead of having to mod…

Key takeaways

  • Data-driven testing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Data-driven testing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Data-driven testing from memory before moving on to harder problems.

Reference excerpt

Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing technique that uses a table of data that directs test execution by encoding input, expected output and test-environment settings. One advantage of DDT over other testing techniques is relative ease to cover an additional test case for the system under test by adding a line to a table instead of having to modify test source code. Often, a table provides a complete set of stimulus input and expected outputs in each row of the table. Stimulus input values typically cover values that correspond to boundary or partition input spaces. DDT involves a framework that executes tests based on input data. The framework is a re-usable test asset that can reduce maintenance of a test codebase. DDT allows for anything that has a potential to change to be segregated from the framework and stored in an external asset. The framework might manage storage of tables and test results in a database such as data pool, DAO and ADO. An advanced framework might harvest data from a running system using a purpose-built tool (sniffer). The DDT framework can play back harvested data for regression testing. Automated test suites contain user interactions through the system's GUI, for repeatable testing. Each test begins with a copy of the "before" image reference database. The "user interactions" are replayed through the "new" GUI version and result in the "post test" database. The reference "post test" database is compared to the "post test" database, using a tool. Differences reveal probable regression. Navigation of the system under test's user interface, reading data sources, and logging test findings may be coded in the table. Keyword-driven testing is similar except that the logic for the test case itself is encoded as data values in the form of a set of "action words", and not embedded or "hard-coded" in the test script. The script is simply a "driver" (or delivery mechanism) for the data that is held in the data source.

See also Control table – Data table used to control program flow Keyword-driven testing – Software testing methodology Test automation framework – Use of purpose-built software to control test executionPages displaying short descriptions of redirect targets Test-driven development – Method of writing code Modularity-driven testing – Software testing technique Model-based testing – Application of model-based design

References

Worked examples

Example 1 — a first encounter with Data-driven testing

Start with the simplest possible case. Write down what Data-driven testing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Data-driven testing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Data-driven testing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Data-driven testing

In research
Data-driven testing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Data-driven testing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Data-driven testing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Software testing, so understanding it makes those chapters shorter.
In everyday life
Look for Data-driven testing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Data-driven testing” →

How to study Data-driven testing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Data-driven testing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Data-driven testing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Data-driven testing in simple terms?

Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing technique that uses a table of data that directs test execution by encoding input, expected output and test-environment settings. One advantage of DDT over other testing techniques is relat…

Why does Data-driven testing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Data-driven testing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Data-driven testing.

Tags

  • Software testing

Keep exploring