Agenda About Testability and why we need it Adding new small test into the low testability code Building a stable product with high testability How to make more testable an app on the E2E level
Developing vs Testing There is a tendency to focus on small details during development: Incomplete logic Effect on other components DB becomes locked for a long period Cannot think about what will bring great value to the user Testing is an effective approach for various concerns, big and small
Difficulity of E2E Automation Limited operating point – everything needs to be operated through UI Functions cannot be split – cannot split functions which is not useful for the user
Why does this icecream occur? Lack of understanding of testing Doesn’t know testing other than acceptance testing “Unit test? What is that? Can you eat it?” Misunderstanding of refactoring Starts off prioritizing implementation without any automated testing “We can just refactor it later, right? :D”
Functional Integration Unit Integration Unit Use Case External Integration Performance / Security Use Case External Integration Performance / Security UI Integration / Backend API Big Cone
Example: A simple new user registration form 1. Display an error if a required field is empty 2. Display an error if the email address does not contain “@” 3. [Submit] button cannot be clicked if there is an error 4. Email addresses that are already registered cannot be registered 5. Registration is complete when the user clicks the link in the new registration email
UI Integration Test Use lightweight & flexible browser automation tool Puppeteer(https://pptr.dev/) Cypress(https://www.cypress.io/) Use mock instead of the real backend MockServer(https://www.mock-server.com/) PollyJS(https://netflix.github.io/pollyjs/#/)
Other tools for testing backend APIs Karate(https://github.com/intuit/karate) Tavern(https://github.com/taverntesting/tavern) Postman(https://www.postman.com/)
Cone To Cup Integration Unit Use Case External Integration Performance / Security UI Component / Backend API Integration Unit Use Case External Integration Performance / Security UI Integration / Backend API
Automate test preparation Add APIs for preparing test data & preconditions Combinate those APIs with a process automation tool n8n(nodemation) (https://n8n.io/)
Utilize the meaning within a structure const modal = label => locate('.modal').withText(label) within(modal('Modal title'), () => { I.see('Modal body text goes here.') I.click('Save changes') }) https://getbootstrap.com/docs/4.0/components/modal/
Conclusion: Larger cup, more icecream Have more tests focusing on targeted concern by effectively using the existing interface and mock. Remake applications protected by the test so that they are even easier to test. Maximize the product’s appeal by testing products high in internal quality.