expect(tests).toHave('value')

By Jakob Hilden

Talk Abstract

What makes a good test suite? How do you make sure your tests are adding the most possible value for the cost they produce? This talk will give you advice for thinking about cost and value of your different tests, and allow you to focus energy where it has the biggest impact for your product.

Talk Description

The talk tries to take a systematic look at how exactly tests are adding value to our products, and also how much cost they produce. How does the added value and the produced costs differ between different types of test (e.g. integration vs. unit tests)? Where should we focus our energy to have the biggest impact?

Finally, the theoretical learnings are showcased with the testing approach we used in recent React (Native) projects. It involves integration testing with the awesome react-testing-library, but also looking at which role other tools (like eslint, prettier, and storybook/storyshots) play for the “test coverage” of a React project. I will describe what types of tests we write to cover different aspects of our React code and especially which tests we do not write.

Notes

I have professionally developed software for 10+ years and am a big proponent of writing tests for almost just as long. However, I tend to look at things not so much from a software craftmanship best practices perspective, but rather from an impact perspective. In everything I do I always try to have the most possible impact on the product. This becomes especially important when working as a consultant for smaller startups with limited resources and time horizons.

There is a lot of literature/resources about how to write all kinds of tests, but not so much about how to prioritize between different types. This is a gap I want to fill with this talk.

As hinted at in the description the talk has 2 parts: the theoretical part should take up ~20 minutes and the practical example ~10 minutes. The theoretical part should be applicable to pretty much all programming languages and frameworks. Of course the more testing experience you have, the more you will be able to related to the topics discussed, but generally the talks should be relevant to all audience levels. The practical part is based on the testing approach that we implemented for a big React project that I have been working on for the last year. But again, most of the guidelines and many of the tools used would also fit for other JS projects/frameworks (e.g. Vue).