javascript-testing-best-practices icon indicating copy to clipboard operation
javascript-testing-best-practices copied to clipboard

Backend testing

Open iot-resister opened this issue 3 years ago • 2 comments

For example, consider an IoT application that ingests many events into a message-bus like Kafka/RabbitMQ, which then flow into some data-warehouse and are eventually queried by some analytics UI. Should we really spend 50% of our testing budget on writing unit tests for an application that is integration-centric and has almost no logic?

There's almost no unit testing here. Write a tiny bit of integration and e2e if its critical, if not forget it.. This still follows the pyramid. Its relative to amount of unit test (domain model/business logic) code required. You want ~100% of the behavior of business logic (unit) according to the pyramid. In this case 100% of zero is zero.

ref

iot-resister avatar Sep 16 '20 22:09 iot-resister

@iot-resister Welcome! Interesting topic.

First, It might be more than just a few integration tests - There can be multiple error flows on the intersection between the systems, resiliency testing - What should happen when one party (e.g. Kafka) is down, ensure the various API data retrieval options work and more. Finally, you might end with 30 integration tests, 5 E2E, 0 unit tests. How does this resemble a pyramid shape? How is it relative to the amount of unit tests? Where does the pyramid idea relate specifically to domain/biz-logic and not as a general testing strategy?

goldbergyoni avatar Sep 24 '20 16:09 goldbergyoni

p.s. I watched this video in the past, to which part/minute are you relating?

goldbergyoni avatar Sep 24 '20 16:09 goldbergyoni