Re:The bunny theory of code
by juliangregorian on Monday May 18, 2015 @09:01AM
(#9564146)
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.
[ Parent
| on HN ]
Re:The bunny theory of code
by nothrabannosir on Monday May 18, 2015 @10:19AM
(#9564568)
Additionally, 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.
> 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.