Hacker News new | ask | show | jobs
by ashishb 410 days ago
> Breaking changes in dependencies end up in production only if you don't have tests.

That's true. However, you have now replaced the work of a compiler with testing.

2 comments

Compilers dont test, or rather, they test a very specific and narrow set of things relative to what youd want to test to maintain a working program
Refactoring from a function returning a string to another returning a string, and all compiles, yet without tests nothing works in production because it’s not the same string.

On top of that, sometimes mocking in tests also hide the string breaking change you don’t yet know about.

On top of my head, I saw this happen with a base64 string padded vs unpadded, or emojis making their way through when they did not before, etc.

So yeah, the compiler tells you which pieces of your jigsaw apparently fit together, but tests show you if you get the right picture on the jigsaw at the end (or on some regions).

Isn't it a shame that we're only allowed to have one or the other.