Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In our analysis, we figured out that the most frequent category of bugs caught by End-to-End tests was schema violations.

Schema violations are pretty much just type errors.

Fortunately these can be prevented automatically and with 100% confidence without writing even a single test.



Types are compile checks, they have nothing to do with contracts, having contracts for messages that will transit over a queue are still useful even if you are using a typed language.


Not in all environments, e.g. clojure.spec, or with MyPy reflection etc.


clojure.spec is not a type system. Still, my point is, just using a typed language won't remove the need for contracts, you would still need to roll up something like Nubank did even if it means using MyPy reflection features.

For example, imagine you have two services that communicates through a message queue. Service A produces X as a string, but Service B consumes X as an integer. You can type that, both services would compile, but it would break as soon as you tried to consume that message. And yes, you can build something using MyPy reflection or whatever, but you have to build it anyway.


Hm? Give the message a type. Service A or B would fail to compile, depending on whether the static type of X is a string or an integer.


AFAIK, kafka messages doesn't have "types", and even if they did, you would be relying on an external system, not your type system. If you are not convinced, test it by yourself, create two services and a kafka topic and produce a message from one service to another with different types on each service.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: