2 ms·
> Now your code is easier to refactor Unless you need to change the design of the interface in any way -- then it's harder. Tests lock a particular interface
by wvenable 4y ago
> Now your code is easier to refactor
Unless you need to change the design of the interface in any way -- then it's harder. Tests lock a particular interface in place -- which is great if you have a well defined interface. But if you're trying to figure out that interface then you've prematurely locked yourself in.
- sirsinsalot 4y agoTrue, easier to refactor within the interface. I'd argue if your interface changes and it's a chore to refactor or rewrite the test then there's other tech debt issues going on.
- wvenable 4y agoIn my opinion, a lot tech debt comes from not changing the interfaces when they need to be changed. Tests fix your design so if your design is broken you're going to live with that. But when I'm developing something new, I will frequently change the interface until I get something to be what I want to it be.