Whether you don't know anything about Android programming, IOS or not, you've certainly heard of unit tests. No ? Unit tests are automated tests to ensure that your application works properly, but not only. They are going to be useful for a lot of things and we will try to show you their importance here.
It's also a good way for us to choose a quality developer. This one will certainly spend more time coding but he will have taken the time to find all the possible scenarios of the code he writes.
How does developing an application work?
Once the development scenarios are well written and validated, we can start coding. Whether on Android, IOS or any other platform, we will proceed in the same way.
The TDD or Test Driven Development method
Literally test first then code. Contrary to what one might think or what the IT world has been doing for many years, the trend today is to write the tests first. Indeed, we go looking without having started to develop how to make our application fail.
Uncle bob is one of the big names in the world of modern computer development, his articles are of course in English and sometimes very long but it's often very interesting.
Unit tests for a mobile application, why?
There are several levels of tests:
- Graphical user interface functional tests (Does my registration form work well for example)
- Business unit tests (Can I register with an invalid email?)
- Integration tests (Is my application able to connect and chat with a remote server ?)
As you may think, it can take a long time to write all these tests. That's why it's essential to define a test strategy together before starting. If your application is a prototype or in order to last for several years, you will have to choose what you define as a critical function or not.
A stable and functional mobile application
These tests will be used to ensure the proper functioning of your application at each update.
Indeed, these tests will be launched before each new build (or compilation of your application before publication in the app store for example). This will ensure that everything works properly.
A new developer won't be afraid to take over the code without breaking everything
Other advantages of automated testing are that you can let another developer take over the code without breaking an application's entire operation. The computer code is the paradigm of the butterfly effect, we create a few bricks of code that discuss together, then 10, then 1000. The bigger or more complicated an application is, the greater the risk factor in changing a behavior that we break something elsewhere.
Many developers will even refuse to touch code that is out of focus.
More development time, therefore more expensive ?
This is usually the first reaction, however in the case where your product is not a prototype you will save money. Writing these tests can take as much time as developing the functionality but it will also save you all those manual tests. (So you will actually save money)
Imagine you want to ensure that your form works every time it is updated? Just restart the test suite, if it doesn't pass it means that there was an error on your mobile application.
For a relatively simple prototype, we'll get out of it by maintaining a basic testing strategy. However, if your application is critical, wants to be able to grow cleanly, we can only advise you to opt for an optimal testing strategy.
Remember to ask for your provider's testing strategy when you request a quote.
The lower the quotation, the more likely it is that there is no such strategy.