3 ms·
idk picking a real-world example that breaks the code seems like a good test case to me
by saagarjha 3y ago
idk picking a real-world example that breaks the code seems like a good test case to me
- benlivengood 3y agoIt is a good example for an initial bug report but, once the code has been fixed to handle that failure case, minimal examples are the correct lasting tests to live with the code forever. Additionally, a complex example may require multiple conditions to fail and if those aren't split into multiple tests then subtle bugs can be reintroduced later because that complex test doesn't cover all potential failure conditions. If there need to be test cases for multiple related bugs then they need to be minimal to demonstrate the failure condition combinations they are testing for.