What is parameterized testing?
Why Interviewers Ask This
Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Software Testing / TDD basics — a prerequisite for any developer role.
Answer
Parameterized testing (data-driven testing) runs the same test logic with multiple different input/output combinations, reducing code duplication. Instead of writing 10 similar tests with different values, write one test method that accepts parameters and run it with 10 datasets. Examples: pytest: @pytest.mark.parametrize("input,expected", [(1, 2), (0, 1), (-1, 0)]) def test_increment(input, expected): assert increment(input) == expected. JUnit 5: @ParameterizedTest @ValueSource(ints = {1, 5, 10}). NUnit: [TestCase(1, 2)] [TestCase(0, 1)] public void TestIncrement(int input, int expected). xUnit: [Theory] [InlineData(1, 2)]. Use for: boundary value testing, equivalence classes, data-driven test tables. Keeps tests DRY while testing many scenarios. Combine with external data sources (CSV, JSON) for very large test datasets.
Pro Tip
Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Software Testing / TDD answers easy to follow.