Main content
There are a lot of ways to test an application, no matter what you're using to build your applications. But where is the necessity to implement one of these testing methods? Imagine, you're coding a lot of components on a React application, with an e-commerce structure, but the app retrieves items from an API, and you need to set up a business logic on a storefront.
Sounds huge right? Because there are a lot of things to do there, just take into consideration what could be happening if one of those components broke up when you push up the version changes or the app on the deployment.
You need to make a rollback, check out what is wrong and try to fix it, it should take a lot of time, including when you add new features of refactors to this component, this issue could be happening, again and again, every time you make changes on the application.
But we have here a couple of ways to solve this issue using unit testing, I'm going to explain briefly each way because there is no point in talking about just one of those, all the ways offer a different way to manage the testing of our application and avoid this to broke on any process.
Unit Testing
This type of testing means, trying to test development features, and avoiding external dependencies, it means that you can test it on its own, without whether databases or third-party services.
So for this is called "unit", because of the way to use it, testing every part of the application, one by one, to let the developer, merge new features or fixes, without causing any issues in any environment.
Integration Testing
When we are combining pieces of code, with other features in a complete environment, in the middle of the process, we could take down the app if the application does not compile right.
We need, first of all, to be sure the new code is working, and avoid this code to affect the rest of the workflows.
More over, we need to take into consideration that not all the environments, necessarily, work equally, because we could be using env variables, or different settings to run the app, so this way was made to fix this issue.
E2E Testing
There is a trend in testing ways, so good as the others, like end-to-end testing, because, it refers to how to test an application from the beginning to the end of the process, or processes.
So the goal is, to test all steps to reach a final action, on the final user way through, using this testing way to try the whole application features.
On the other hand, this could work like a macro unit testing workflow because you can split it into many end-to-end testings, using a testing core to handle it in the cleanest way, if you love to use your fave folder structure or something like that, to manage your code files.
Subscribe to my newsletter
Subscribe to my newsletter and never miss my upcoming articles