2.Testing : writing test before implementing code make it easier to track error or issues on each components early. use testing framework like jest(for JavaScript), JUnit(for java) etc.
also write test like, Unit testing, End to End testing, integration test, coverage test.
2 SECRETS OF A TESTABLE UI ARCHITECTURE (Frontend Devs.)
Testable UI architecture is crucial for building a reliable and maintainable user interface in a software application.
Here are 2 most important principles to follow for building a testable UI architecture ๐๐
1. Seperation of concern (SOC) : this has to do with dividing or breaking down the UI into components, wearby each component has its specific responsibility. for instance you have components like PRODUCTLIST, SHOPPING CART, CHECKOUT FORM PRODUCT DETAILS etc.
3. Automated testing and CI/CD : this has to do with testing each components, ensuring that they work properly and the task been given to them are what they are to do. For example if you a form that accept only email, then it should be only email address that can be inputed.
2. Consistency and Design System: on this part your colors, font, typography, spacing etc has be consistent throughout the application. and also ensure that the reused component looks alike and didn't change it structure accross the application .
1. Modularity and Componentization: this has to do with breaking down the UI into smaller modules or components that can be reused across the application.
For example a button, card, form can be a component that can be reused in different in the application.