logoalt Hacker News

bluGillyesterday at 9:55 PM3 repliesview on HN

Your tests are an assertion that 'no matter what this will never change'. If your interface can change then you are testing implementation details instead of the behavior users care about.

the above is really hard. A lot of tdd 'experts' don't understand is and teach fragile tests that are not worth having.


Replies

gchamonlivetoday at 4:17 AM

Sure if you are changing your interfaces a lot you either are leaking abstractions or you aren't designing your interfaces well.

But things evolve with time. Not only your software is required to do things it wasn't originally designed to do, but your understanding of the domain evolve, and what once was fine becomes obsolete or insufficient.

8notetoday at 12:35 AM

https://www.hyrumslaw.com/

your implementation is your interface. its a bit naive or hating-your-users to assume your tests are what your users care about. theyre dealing with everything, regardless of what youve tested or not.

show 1 reply
switchbakyesterday at 11:56 PM

Refactoring is changing the design of the code without affecting the behaviour.

You can change an interface and not change the behaviour.

I have rarely heard such a rigid interpretation such as this.