3 ms·
> Don't forget a very important thing: unit test are hindering any refactoring. People will resist it because it means they have to rewrite their tests. Well,
by rualca 5y ago
> Don't forget a very important thing: unit test are hindering any refactoring. People will resist it because it means they have to rewrite their tests.
Well, unit tests verify a contract. If a developer wants to change code but is incapable of respecting a contract (i.e., preserving old invariants or adding new ones that make sense) then he should not be messing with that code at all, shouldn't he?
In that sense alone, it's quite clear that unit tests pay off and add a lot of.value, namely in avoiding needless regressions from Rambo developers who want to change code without caring if it even works.
- Normal_gaussian 5y ago> unit tests verify a contract This is the most important thing. Rambo can delete all the unit tests he wants in his MR; our discussion will be about whether: - the contracts have changed. - the unit tests shouldn't have been there in the first place. - he's violating contracts