Try : Insurtech, Application Development










Dev Ops(2)

Enterprise Solution(20)




AI in Insurance(27)


Product Innovation(36)


Augmented Reality(7)

Customer Journey(7)


User Experience(21)

Artificial Intelligence(95)



Cognitive Computing(7)

Computer Vision(6)

Data Science(14)


Intelligent Automation(25)

Machine Learning(43)

Natural Language Processing(10)




Telehealth Care(1)

A Beginner’s Guide to Types of Testing in Swift

3 minutes, 33 seconds read

It’s very human to skip tests. But, while developing enterprise apps, testing is something that should never be compromised. If you don’t test, there will be no way to find out the application performance and determine user experiences.

Testing is a must! You might already know that you should write tests for your code and UI, but you might not know — how? I’ll walk you through types of tests that developers usually perform on Swift programming language in order to help you deliver a supreme-quality app to your user. 

Whether you’re building a new application or expanding the existing app, you might want to test it on the go. Testing in swift is as simple as building the app itself. (For your information, the Xcode also tests the application). All you need is test cases and an idea about where code usually goes wrong. 

But first, it’s necessary to find out what to test.

Developing an App? What to Test?

Start with the basics. You must write mandatory tests if you plan to expand the application.

Tests usually cover the following issues.

  1. Core functionality: Model classes and methods and their interactions with the controller
  2. The most common UI workflows
  3. Boundary conditions
  4. Bug fixes

Let’s take a quick look at the types of testing while developing an app in Swift.

#1 Unit testing using Xcode

It is a process of creating small functionality-based tests for a particular unit of code, which will eventually ensure that all other units will pass the test.

The Test navigator provides the easiest way to work with tests; you’ll use it to create test targets and run tests against your app.

#2 UI Testing 

UI testing is useful for testing interactions with the User interface. In UI testing, the developer needs to find the app’s UI objects through queries, synthesizing events. Tester has to then send the events to those objects. The API lets you examine the UI object’s properties and state which you can compare against the expected state.

#3 Performance Testing

A performance test uses a block of code that you want to evaluate. It is then run 10 times to collect the average execution time and the standard deviation for the runs. The average of these individual measurements (of the test run) are compared against the from a benchmark value to evaluate the success/failure of the project.

It’s very simple to write a performance test: You just place the code you want to measure into the closure of the measure().

Bonus – Code Coverage

The code coverage tool tells you about the parts of code that were actually executed during your tests. This way, you’ll know the parts of the app code that aren’t yet tested.

You can enable code coverage by editing the scheme’s Test action. Post this, check the Gather coverage for check box under the Options tab:

Code Coverage - Swift


  1. Run all tests (Command-U)
  2. Open the Report navigator (Command-9)
  3. Select Coverage under the top item in that list (image below):
Report Navigator

You can see the list of functions and closures in SearchViewController.swift by clicking the disclosure triangle:

Search View Controller

Scroll down to updateSearchResults(_:) to see that coverage is 87.9%.

Click the arrow button for this function to open the source file to the function. As you hover over the coverage annotations in the right sidebar, sections of code highlight green or red:

Code Coverage Annotations - Testing in Swift

The coverage annotations show how many times a test hits each code section. Sections that weren’t called are highlighted in red. This implies — the for-loop ran 3 times, but nothing in the error paths were executed.

You can also increase the coverage of this function by duplicating abbaData.json, then edit it so it causes the different errors. For example, change “results” to “result” for a test that hits print(“Results key not found in dictionary”).

We help enterprises mitigate technical & business risk by securing vulnerable blind spots. Check out our testing services.

For your specific requirements, please feel free to drop us a word at hello@mantralabsglobal.com

About the author:

Anand Nanavaty is a Software Engineer with Mantra Labs. He has been deeply involved in mobile app development for the company’s B2B clients. Apart from coding, testing and experimenting with different application development frameworks, Anand loves travelling, trekking, mountaineering, sports (especially cricket), watching movies and sometimes making short films. 

Further reading:

For in-depth understanding of testing in Swift, you can refer to — Writing Test Classes and Methods


Knowledge thats worth delivered in your inbox

How to increase patient engagement on a healthcare app?

By :
4 minutes, 9 seconds read

Patient facing mobile apps have emerged as a viable alternative to interact with patients and help them execute several tasks related to healthcare without reaching the hospital. Patients are now increasingly glued to these healthcare apps and their time spent on mobile devices has increased significantly. From communication and information to executing business through mobile apps have become a common thing.

Still, there is a lot of gap in the healthcare market. Marketers are struggling to gauge the true value of mobile apps for the bottom line of healthcare organizations. Especially in terms of the value of the app viz-viz the efforts, cost, and time it would take to become a useful and engaging healthcare app for the patient.

To help you increase the patient engagement on a healthcare app, here are a few crucial ways that you need to know. It will not only increase the engagement but will also help you meet your organizational goals at a faster pace.

1. Reduce Readmissions

Healthcare provider’s biggest pain point these days is to avoid readmission of preventable cases. It is crucial for healthcare organizations to reduce this number to enhance patient outcome and improve their revenue growth. Customized healthcare applications can assist hospitals in reducing the number of readmissions.

Here is how:

  • Offer personalized post-release information and instructions
  • Reminder for regular follow-up visits
  • Enforce stricter adherence to post-release prescription and regiment
  • Easier access to healthcare resources and information
  • Lesser cost and time of reaching out
  • Greater engagement to reduce readmission rates

2. Encourage Patients to Proactively Manage Their Health

Encouraging the patient to become proactive in managing their own health can help in improving the outcome and also enhance the reputation of your hospital. With easier access to the required resources and tools, patients are more likely to stay in touch with healthcare professionals and practice the wellness regimen. A properly optimized mobile app can deliver a better wellness experience to the patient and a greater sense of satisfaction.

Here is how an app can help the patient in managing their health proactively:

  • Keeps the patient informed and connected with relevant services
  • Encourages regular health tracking
  • Helps in developing healthy habits and exercises
  • Promotion of health education by streaming informations

3. Improve Trust and Build Relationships

Establishing trust between the patient and doctor is one of the difficult things that hospitals face. Due to long wait times, complex processes, or lack of communication between healthcare team; patients are not willing to attend healthcare appointments.

However, when you give all the relevant tools and information in the smartphone of the patient and empower them, the trust develops between the two parties and the patient proactively takes charge of their treatment. Hospitals can also gain competitive advantage by streamlining patient referrals and building stronger relationships with physicians.

Here is how apps can help:

  • You can provide access to a larger pool of specialists 
  • Help in easily accessing credentials, studies, and information from the mobile app
  • Recommend, network, and connect
  • Improve efficiency and workflow

4. Boost Brand Image and Reputation

Today patients can not be treated less than consumers. Hospitals are competing with each other to provide better care facilities and infrastructure at affordable prices. Hence, it has become crucial to achieve patient satisfaction and engagement. Through mobile apps, hospitals can make the existing information easily accessible along with brand awareness features including social media, photo galleries, virtual tours, and more.

Here is how mobile app can help:

  • Easier access to communication and information
  • Intuitive presentation of the hospital through immersive galleries
  • Stream ER wait time and other relevant information
  • Greater social media engagement

What more factors can increase engagement?

Several patients come to healthcare app once and then dump them after a few logins. One of the major reasons for such low engagement rates is that either the app is difficult to navigate or it is not immersive for the patient.

Consider these few points to make your app more engaging:

  • Customize the app as per the patient group. An app can appear differently to a child and an old age person. Develop an app that is easy to use for all users. Sit with your QA engineers to validate the functionality of your application thoroughly.
  • Build an app that is scalable and can be evolved over a period of time. Leave the possibility of enhancements and customizations that you would need in the future to keep the application viable.
  • It is a no brainer to give multiple options to your patients. Develop a cross-platform application that is compatible with both iOS and Android platforms and offers a rich user experience.

Wrapping Up

With the COVID-19 pandemic, people are more worried about visiting hospitals. Social distancing has become the norm and patients are more inclined towards telemedicine for their treatment. In such a tricky situation, it has become more crucial for hospitals to provide a robust, secure, and engaging mobile app to patients to interact with doctors, access information, and stay connected with the healthcare system.

About the Author

Erna Clayton is a techie with over 12 years of experience in several technological domains including quality assurance and software testing. In her free time, she loves travelling and writing on technology.

Further Readings:

  1. Building Consumer Trust in the Digital Healthcare Era
  2. HealthTech 101: How are Healthcare Technologies Reinventing Patient Care
  3. Virtual health: Delivering care through technology
  4. How Mobile Micro-Health Insurance can unlock ‘Digital for Bharat’?

Knowledge thats worth delivered in your inbox

Loading More Posts ...
Go Top

May i help you?

bot shadow