3 ms·
(well written) tests tend to fail (or fail to compile) if they're 'stale' though, so they force you to maintain them just like other code. (I'm not arguing aga
by p1necone 4y ago
(well written) tests tend to fail (or fail to compile) if they're 'stale' though, so they force you to maintain them just like other code.
(I'm not arguing against writing comments though - the 'they'll get stale' thing is not enough to make them not valuable)
- hbrn 4y agoI don't see a difference. If you write good tests and use a tool (CI) that detects them going stale, tests will never be stale. If you write good comments and use a tool (code review) that detects them going stale, comments will never be stale. In order for tests to not get stale, you need perfect (well written) tests. In order for comments to not get stale, you need perfect code reviews. Neither of those exist in real world: code reviews are done by humans, tests are written by humans.