Data-driven testing is a well-known concept and many different implementations exists.
- A mature API exists and the data format is fairly static.
- The test itself is simple.
- Big variation of input data.
- Easy to determine the expected output of processing the given input.
Data-driven testing is not the silver bullet which solves all problems, of course not. It's power comes from the simplicity of extending the test suite with new variants.
This means data-driven tests can be ideal for regression testing.
It also means it can be the perfect tool to quickly find and fix a bug in production. I.e., get a copy of the input data that caused the bug, add it to the test and the bug should be reproduced. Fix the bug and watch the test go green again.
TestNG has support for parameterizing tests by using a DataProvider. This makes it really easy to do small scale data-driven testing.
A simple example of using DataProvider can be found here: TestNG – Parameter Test (XML and @DataProvider), by mkyong