Data Driven Testing - TestlumFramework/Testlum GitHub Wiki

Data Driven Testing

Any modern software, including web-based applications, is tested for errors. The speed of identifying these errors depends not only on the tools, the number of testers and their experience, but also on the chosen approach. This is what we will talk about.

This is data-driven testing. With this approach, test data is stored separately from test cases, for example, in a file or a database. This separation logically simplifies the tests.

Data-driven testing is used in those projects where you need to test individual applications in multiple environments with large data sets and stable test cases. Typically, the following operations are performed during DDT:

  • extracting part of the test data from the storage
  • data entry in the application form
  • checking the results
  • continuing testing with the next set of inputs.

This method allows a QA specialist to prepare a set of test data at the early stages of development to test the functionality and logic of your project.

To create a dataset, the tester only needs to create a file with the required extension and put it in the data folder (storage for test data).

Migration to any of the databases is easy to do with the global tag migrate.

<migrate comment="Add data set for database" alias="ALIAS" name="MYSQL">
    <data>site_sample_init_data.sql</data>
</migrate>

Working with other databases

You can configure migration for any other database. Postgres is selected by default. To change the default value, you need to rewrite the name field, which is not visible by default.

Possible databases for migration:

  • Postgres
  • MySql
  • Redis
  • Oracle
  • MongoDB
  • Dynamo
  • Clickhouse

After the data has been uploaded to the selected database, the QA specialist can create effective test cases, perform data-based testing, and use HTTP, and SQL queries to interact with the system. This method covers all sections of the code and the system as a whole with tests, allowing you to effectively create integration tests and conduct high-quality regression of the product.

Data-driven testing is also great for WEB testing. It allows you to track down a large number of bugs at an early stage of development. Especially effective for:

  • Detection of functionality bugs;
  • Detection of unhandled exceptions when interacting with the interface;
  • Detection of loss or distortion of data transmitted through interface elements.

Files available for migration:

  • sql
  • csv
  • xlsx
  • partiql
  • bson
⚠️ **GitHub.com Fallback** ⚠️