Ever wondered what it would take to create an app faster with less code?
It should have a reliable or at least stable code with good device and network performance. The code should be easy to understand by anyone and easy to upgrade/add new feature. I know, this is not as easy as writing a quick paragraph.
Welcome to my world!
I have been developing mobile apps for the past 7 years and I have tried every option that’s out there to achieve above five points. Currently, I have settled down on few of these tools/principles.
Apple loves Model-View-Controller (MVC) pattern. However, this has its own issues. The biggest problem is that the View Controller gets bigger and bulkier with all the spaghetti code. This makes it harder to develop faster and fix issues.
I started testing Model-View-ViewModel (MVVM), commonly used by Xamarin, ReactCocoa/RxSwift. I like that the code becomes more Reactive but the funny part is now instead of the View Controller, the View Model becomes bigger and bulkier.
I have finally settled down on Clean Swift Architecture. The flow of control is always (VIP):
View Controller –> Interactor –> Presenter –> View Controller
- A VC initiates an interactor in perhaps viewDidLoad() call back. The interactor can perform some business logic.
- The interactor invokes the presenter to format the result to some primitive types.
- The presenter invokes the view controller to display the results on the screen.
More complex business logic can go to a worker component that is invoked from the interactor. The new and improved routing system breaks down the routing process into two phases: navigation and data passing. Last but not least, the request, response, and view model provide the data independence that is super important in isolating changes and writing robust unit tests.
I like Agile and lean software development methodology.
Mobile app development is very different from desktop and web development. Mobile devices have limited processing resources, view real estate, and the device and OS level fragmentation makes it very complex for a developer to build a strong and reliable app.
I started believing in shift-left testing. It is very promising, I should be testing my app starting Day 1 instead of during the release. For example, we can build a very beautiful house but it’s all useless if the foundation is not right.
This methodology sounds good. But, as startups and small teams, we have very limited resource and test capabilities. I have researched quite a few services out there and fell in love with TestGrid.io and their concept. TestGrid allows even a manual tester, or the entrepreneur, to write automation test cases using keyword driven test case writing. On top of it, they have a variety of real devices and generate daily reports for all the test cases. See the gif below for an overview.