Parameterized (data-driven) test รัน logic ของเทสต์เดียวกันด้วยชุดอินพุตและเอาต์พุตที่คาดหวังหลายชุด — หลีกเลี่ยงการทำซ้ำเทสต์สำหรับแต่ละกรณี มันทำให้ทดสอบสถานการณ์จำนวนมาก (รวมถึง edge case) ได้ง่ายและกระชับ
ปัญหา: เทสต์ที่ทำซ้ำ
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)
