Source: Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich ====== Data-driven testing ====== DDT is an approach to [[software_testing|testing]] in which one test function is executed multiple times with different sets of input data. This makes it easy to cover more cases and reduce code duplication.cases. ==== Strengths of DDT ==== - They eliminate duplication of tests with different input data. - They simplify the coverage expansion: you add a row of data, and you have a new test. - They increase the readability and maintainability of tests. ==== Best practices ==== - Try to keep the data next to the tests (CsvSource, InlineData) for simple cases. - For large sets, use separate CSV/JSON files. - Do not overload the test with unnecessary cases — it is better to divide it into logical groups. - In Go, use table-driven tests as a standard — it's readable and familiar.