4 ms·
I copy and paste code all the time, but almost only for tests. I don't think tests should be abstracted too much. I don't appreciate having to work to understan
by juliangregorian 11y ago
I copy and paste code all the time, but almost only for tests. I don't think tests should be abstracted too much. I don't appreciate having to work to understand what a test is doing, and when the test gets too long it's a sign you're testing at the wrong level.
- nothrabannosir 11y agoAdditionally, one of the biggest problems with copying code is that it will break when the two versions get out of sync. Test code inherently protects you against this, by virtue of having 100% test coverage, itself.
- rlpb 11y ago> Test code inherently protects you against this, by virtue of having 100% test coverage, itself. Not necessarily. A false negative bug in one copy of a test will remain even when fixed in a different copy.