Writing test cases will take time initially, but once developers get used to it, it will make their lives easier in later stages. We, as developers, tend to integrate the API’s and then do the testing to check for response and UI updates. If there is any issue with API response, this process is repeated. Test cases come in handy as a means of avoiding this repetitive testing.
For example, to test a newly created API in fifth screen in navigation stack, it takes time to run the application, navigate to the respective screen and do a manual test to see if everything is working correctly. If something goes wrong, we have to repeat that process several times. Instead, if we have written a test case for the API, we can directly run that test case instead of executing the whole appm. Writing unit tests will take more time at the beginning, but it will save time later during testing or debugging.
Additionally, using test cases allows us to cover error cases like server errors, which are not possible to produce in manual testing.
In the coming article, we will learn how to Mock a Network Layer.
If you like this article, give some claps and follow me on Medium.
How Spreadsheets are Bad for Business eBook
Did you know that 88% of spreadsheets contain errors? While spreadsheets can be an effective tool for businesses, they propose serious risks. Our free eBook outlines the pros and cons of using spreadsheets to run your mission-critical operations. Download the ebook and start automating your unique workflows.
Pros of Spreadsheets
Cons of Spreadsheets (It's not what you think)
Next Step Solutions and How to Get Started
Bonus Case Study
Thank you! Enjoy our Healthcare Case Study!
Oops! Something went wrong while processing your request. Please try again or Contact Us for assistance.