Testing
Let’s say you have a perfect bug-free app you’re very proud of. Does it change over time? How many developers work within the same codebase? How familiar are they with this code? How do you ensure your code is still perfect? The answer is automated testing, and this workshop is all about it. Let’s take a deep dive into this fascinating world to boost your confidence from shipping to production!
a. Different types of tests (and the testing pyramid/trophy)
Explain common testing terminology. Introduce the testing pyramid and testing trophy as a depiction of the importance of certain types of testing and time-to-value ratio
b. Static analysis
Talk about Flow, TypeScript, ESLint, TSLint and show how certain types of tests can be replaced with these tools to give developers real-time feedback that’s faster than most of the tests.
c. Intro to Jest
Explain Jest as a platform, show what’s powerful about the library, what’s baked in, explain how it can be configured and extended to your needs.
d. Code Kata TDD
Creating a program based on solid requirements that can be easily converted to test cases. Solving problems one-by-one, we’ll end up with a fully working program that meets all expectations. This is a team-building exercise :).
e. Unit testing
Write unit tests for our app using Jest. Taking a solid ride through the app functionalities, and identify places we want to add tests to using code coverage.
f. Integration testing
Write integration tests for our app to test connections between our units/components for the functionality we’ve just covered in the previous topic.
g. End-to-end testing
Introduce Detox (React Native) / Cypress.io (web) to test in simulators, emulators and on real devices. Guide participants through the setup, identify core functionalities and cover them with e2e tests.
h. Snapshot testing
Explain the ideas behind snapshot testing, when to use it, and common pitfalls. Show how it serializes structured data to a string and how we can write our custom serializers.