Testing App
Are you written the entire code of a new app and the build it’s successful and done, great, but you’ve tested all components UI and their logics?
Testing require time-consuming but are essential for written a good code and can bring an improvement to the app’s performance reducing manual test.
In this article i’ll show you the basic to test an app.
Snapshot Test
UI testing plays a significant role before an application is released to production, the visual component it’s important for the interactions of the user and to meeting the design developed. Snapshot tests are a very useful tool whenever you want to make sure your UI does not change unexpectedly
when there are a change in the styles of a component and to prevent unexpected regression. A typical snapshot test case renders a UI component, takes a snapshot, then compares it to a reference snapshot file stored alongside the test. The test compares the current state of your application to the established snapshots stored in the file system. The image below show you the flow in a typical snapshot test in Jest framework
Get Claudio marzella’s stories in your inbox
Join Medium for free to get updates from this writer.
Unit Test
This type of test is focused on individual components, functions, modules called units, the purpose of unit testing is to validate that each unit of the software performs as designed. Units that have no dependencies are called isolated (solitary) units.
The Sociable unit tests fail if the dependencies of a sociable unit are also failing. The tested unit is not supposed to work if its dependencies don’t work, so a failing test in this case is a good sign.
The essential technique to achieve a successful unit test is “Mocking”, where code parts are replaced by dummy implementations that emulate real code. Mocks are especially useful when it’s expensive or impractical to include a dependency directly into our tests, for example, in cases where your code is making HTTP calls to an API or interacting with the database layer.
Component Test
Component testing, also known as program or module testing, is done after unit testing. In this type of testing those test objects can be tested independently as a component without integrating with other components e.g. modules, classes, objects, and programs. This testing is done by the development team. This kind of test is like unit testing with the difference that the developer uses real data instead of dummy (Mock) data for testing of the written code. There are two main types of component test:
- Component Testing in Small (CTIS) — when component testing is done in isolation with other components
- Component Testing in Large (CTIL) — when component testing is done without isolation with other components of the software





