scalaio logo

The Scala event in France!

November 4th, 2022 - Paris, France
Jules Ivanic - Conduktor
Jules Ivanic
Product Engineer, Senior Software Engineer, Functional Programmer. I code with Scala for more than 8 years and with the FP style for more than 5 years. I'm currently a Tech Lead at Conduktor, leading the development of one of the products of the company. I'm a French citizen and an Australian permanent resident. I live in Margaret River, WA. A small town in the middle of nowhere known internationally for its world-class wine and its world-class waves.
Talk
Cost-effective and easy to maintain GraphQL API integration tests with zio-test and Caliban
Talk (45 minutes) | Intermediate
Production-ready software requires testing before it goes into production. As the discipline of software development matured, software testing approaches have matured too. Instead of having myriads of manual software testers, development teams have moved towards automating the biggest portion of their testing efforts. Automating their tests allows teams to know whether their software is broken in a matter of seconds and minutes instead of days and weeks. The drastically shortened feedback loop fuelled by automated tests goes hand in hand with agile development practices, continuous delivery and DevOps culture. Having an effective software testing approach allows teams to move fast and with confidence. If you want to get serious about automated tests for your software, there is one key concept you should know about: the test pyramid. Mike Cohn came up with this concept in his book Succeeding with Agile. It's a great visual metaphor telling you to think about different layers of testing. It also tells you how much testing to do on each layer. Stick to the pyramid shape to come up with a healthy, fast and maintainable test suite: Write lots of small and fast unit tests. Write some more coarse-grained tests and very few high-level tests that test your application from end to end. Watch out that you don't end up with a test ice-cream cone that will be a nightmare to maintain and takes way too long to run. In this talk, I'd like to introduce you to the practices helping our team to keep our integration tests suite, or Service Tests suite, a bliss to maintain. These practices can be summarized into 3 main points: - Write your integration tests alongside your app code - Use the same tools that you're using to write your app code and unit tests - Generate as much code as possible We'll see in this talk how Scala, zio-test and Caliban are, each with their own capabilities, helping us in this difficult task of writing and maintaining a production-ready software integration tests suite.