Parameterized (data-driven) tests एक ही test logic को inputs और expected outputs के कई sets के साथ चलाते हैं — हर case के लिए test को duplicate करने से बचते हैं। ये कई scenarios (edge cases सहित) को संक्षेप में test करना आसान बनाते हैं।
समस्या: duplicated tests
Without parameterization, testing many input/output cases means COPYING the test:
test('add 2+3', () => expect(add(2,3)).toBe(5));
test('add 0+0', () => expect(add(0,0)).toBe(0));
test('add -1+1', () => expect(add(-1,1)).toBe(0));
→ lots of near-identical, repetitive tests (tedious, hard to maintain)
