Most of the applications being developed today have complex requirements. Hence, they need to be tested thoroughly and for each use-case, before they are ready to be deployed in the production server. We all know how important it is to perform unit testing on separate modules or “units of codes”.
However, even if a software component has successfully passed unit testing, it has little to no value if the component does not integrate well with the application, especially in an enterprise-level n-tier distributed application.
Integration testing addresses such problems by focusing on the integration of units of codes or software modules. They weed out all possible bugs that are introduced as a result of the integration of related software components.
Let’s consider a simple example. Suppose you have a third-party ticket reservation android application. On the home page, there is a signup and login button. You also have a premium plan that users can subscribe to so that they can avail themselves of lucrative offers.
Now, the signup/login page and the plan/subscription pages are two separate modules that are linked to each other. Only after the proper flow of data such as login credentials, etc., you can move from the login page to the subscription page. This is where the need for Android integration testing arises.
Android Integration testing will test whether these two modules are properly integrated with each other or not. It will try to expose the defects in the integration between these two modules and check for proper data communication between them. An example of such a test here would be, when user x logs in, he should see information related to himself only on successful login.
When you consider applications with complex functionalities, there can be tons of software modules developed by different programmers that interact and depend on each other. Even a slight defect in the interaction between any two modules can cause a chain of errors in the linked or dependent modules. That’s why it’s essential that we perform Android integration testing for all the critical modules in our application.
Android Integration Testing With Testsigma
Testsigma is a cloud-based automation testing tool that provides a unified platform for all kinds of testing requirements. It has features such as easy-to-create test cases in simple natural language, on-demand availability of 2000+ real test devices (Android, iOS, Browsers), parallel automated testing for large test suites, recorders for identifying UI identifiers, comprehensive test reports, etc.
Testsigma is surely the best tool to perform Android Integration testing for both small-scale as well as complex Android applications. The reasons include –
- You can easily record UI Identifiers automatically and create test cases on the go, using simple natural language.
- You can perform Android integration testing for all your software modules for more than 1000+ Android devices that are available on-demand hosted on the cloud.
- Testing the interface between overlapping modules becomes a lot easier due to the creation of reusable step groups.
Let’s consider the same example of the third-party ticket reservation system. With the Testsigma app, you can record identifiers for both the signup/login modules and the subscription modules through the automated UI recorders.
Using those UI identifiers, you can create simple test cases using natural language to check whether the flow of information between these modules takes place in the same way it is intended to.
For example, clicking on the login button should take you to the page where you are prompted to enter the details. And after entering the details, you should be taken to the subscription page.
The test cases required to perform the above-mentioned integration testing can be easily created with just a few steps. You can then create your test plan where you decide the test devices on which you want to perform your tests.
That’s it! Simply click on the run button to execute your test cases and wait for the result. Don’t want to wait for too long? You can also create a parallel testing plan for quick execution of test cases.
We will discuss a step-by-step procedure with an example later on in this article. Let’s first take a look at why we should and how we can perform Android integration testing.
Why Should We Perform Android Integration Testing?
Integration testing should be done right after performing Unit testing on each software module. Now, you might wonder that we have already tested each of these modules, so why to introduce a separate testing layer altogether. Here are the reasons why.
- Different modules are created by different programmers with different logic and understanding. Hence, it’s necessary to verify whether the entire software entity consisting of different modules works in unity.
- It’s quite common that the requirements might change during product development. Unit testing might not be performed on these new requirements and hence, integration testing becomes necessary.
- There are high chances of encountering errors in the interface between the software modules and databases.
- Modules interacting with third-party APIs and tools are more prone to errors. A change in the third-party API might cause your entire application to fail. Hence, integration testing is very useful to locate such points of failure.
Hence, it’s always better to be safe than sorry especially when dealing with android applications having complex functionalities. Because finding the right error-prone module in itself is a mammoth task in such applications.
Approaches For Android Integration Testing
There are multiple strategies to perform Android integration testing. These are –
1. Big Bang Approach: In this approach, all the modules are integrated together and then tested as a unit. You can’t use this strategy if you don’t have all your modules ready. It’s convenient for small applications. However, fault localization becomes a lot difficult when testing a large number of integrated modules.
For example, in our previous application, we can first integrate all the high-level modules such as login, signup, subscription, train-info, user-profile, etc., and then perform testing on all these units together.
2. Incremental Testing: In this approach, higher-level or lower-level modules (two or more) that are logically related are tested for their interaction first. Then, the number of dependent modules are increased incrementally one-by-one. It’s further divided into two categories –
i. Bottom-up Testing: Here, lower-level modules are tested first, and then we slowly move to higher-level modules. Locating faults becomes easier.
For example, in our railway reservation application, we can create low-level modules such as displaying train information, number of seats in each train, train -route information, etc. together and then integrate them, to create a larger unit of modules all related to each other. We can then perform testing on it. This will help us to find errors easier.
ii. Top-down Testing: Here, testing starts from higher-level modules, and then we slowly move to lower-level modules. In case, any higher-level modules are not yet ready, we use stubs as a replacement.
In our application, we can first integrate high-level modules such as user profile, login, signup, train-info, etc., and perform testing on them. In case we find any bug, we can dig down deep to lower-level modules until we fix all the bugs.
iii. Sandwich Testing: It’s a combination of both bottom-up and top-down approaches.
For example, we can start performing integration testing of higher-level modules such as login and signup along with lower modules such as user-profile, purchase history, etc. These are the bunches of related modules and performing testing on such integrations is easier and quicker.
Depending upon the type of your Android application and the stage of your development process, you need to decide on the right Android integration testing approach that you can use to fulfil your testing requirements.
Steps To Perform Android Integration Testing
Here’s a series of steps that you can follow to perform Android integration testing seamlessly.
1. Identify the unit interfaces
In this step, you need to decide what unit interfaces and the modules associated with those interfaces you want to perform testing on. In our example, the unit interface is “Login and Subscription Verification”. And the software modules that are associated with it are the Signup, Login, and Subscription modules.
2. Record the UI Identifiers and Examine the Interfaces
After you have identified the software modules and the interfaces that you want to perform testing on, you can now record the identifiers that will help you to perform your testing. In our example, the Login/SignUp button, Textboxes to enter email, password, etc. are such identifiers. After that, you need to gather information such as the indications suggesting the data transfer has been completed, etc.
3. Create Test Cases
After you have the list of UI identifiers, you can create test cases that will enable you to check the flow of information and whether the interface has been correctly integrated or not. In our example, some test cases include – clicking on the login/signup button, entering email and password in the respective text boxes, verifying the entered information, and the subscription plan, etc.
4. Create Test Plans
The next step is to create a test plan. Here, you need to select the test suites and the test devices. You need to decide on which Android devices you want to perform the tests on.
5. Execute the Tests
After creating the Test Plans, you can execute the tests. You can either run the tests on a single device at a time or parallelly on multiple devices together.
6. Analyze the Reports and Re-iterate
Take a close look at the test results, identify the modules that have the bugs, fix them, and re-iterate the test executions until all the bugs are fixed. Finally, document the test results and share them with the concerned authorities.
Integration Testing of an Application with Testsigma
Now that we have understood the Android integration testing flow, let’s perform integration testing on a sample application with Testsigma.
Before we start with the demonstration, you need to sign up with Testsigma and register yourself, if you have not done already, so that you can start accessing the application.
Try testsigma free for 30 days
We will use the WordPress APK to perform the integration testing. We will use the bottom-up approach for testing the integration between the modules.
Step 1. Identify Unit Interfaces and Modules.
We will check the integration between the login module and the plan module. Here’s the flow that we will check to ensure that both these modules are integrated properly.
i. We will use a reusable step group to test the login process which will include tapping the login button, entering details such as email ID, password, click on the Next button, verifying the text displayed, and tapping on the continue button.
ii. We will then verify that the UI element called Plan displays the text called Free and check the details of the Free Plan.
iii. We will then use a reusable step group to perform logout operations.
Step 2. Record the UI Identifiers.
Please note that before you begin recording UI Identifiers, you need to upload the APK file of the Android application. To do so, you can navigate to Test Development > Uploads and click on the Upload button.
You would also need to register a test agent if you wish to perform a hybrid test execution. You can follow this guide to do so.
You can either add the UI Identifiers manually by specifying details such as XPath, ID, Classes, etc. or use the Chrome recorder to record all the UI Identifiers automatically.
To capture UI Identifiers manually, you can navigate to Test Development > UI Identifiers and click on the add button. You can refer to the image below to do so.
After clicking on the create button, you can select the appropriate type such as class, ID, XPath, etc.
Besides this, you can also use the recorder option to record the UI Identifiers automatically.
You can select a physical device by registering your agent or a device hosted on the cloud.
You can then click on the Record button to start the inspector and select elements that you want.
You can refer to this guide to see how to capture UI Identifiers using the Mobile Inspector.
Step 3. Creating Test Cases.
Once you have all your UI Identifiers listed, it’s time to create a test data profile, and using the UI Identifiers and the Test Data, we will then create the test cases.
Creating Test Data profiles are important to store certain data such as login credentials that will help us to insert data while creating test cases.
For our example, we have created the following test data profile for login credentials.
You can refer to this guide to create your own test data profile.
The next step is to create Test Cases. Navigate to the following path – Test Development > Test Cases and click on the + Test Case button.
After you create a new test case, you will be asked to create test steps. You can use simple natural language to create new test steps with the help of UI Identifiers that we recorded earlier and the test data that we created. Let’s see how to do so.
You can refer to this guide to get a detailed description of how to create test cases in TestSigma. In the image below, you can find the final list of test steps for our example.
Please note that after you have created the test cases, you can go ahead and combine certain test cases together to create a test suite that you can use later on. Follow this guide to create a test suite using the test cases.
Step 4. Create a Test Plan
Testsigma allows you to create test plans where you can enter important details regarding the type of test environment you want to use, the testing types such as cross-browser, parallel, or customized, etc. Here, you can also select the test suites on which you want to perform the testing. Test Management becomes a piece-of-cake as it gives you a birds-eye view of all the important information related to your testing environment.
Hence, the next and most important step is to create a test plan for Android integration testing. Creating test plans with Testsigma is quite simple.
Navigate to Test Development > Test Plans and click on the + Test Plan button to create a new test plan.
Enter details such as name, description, Test lab type, etc. After that, in the Test Plan type option, you will get three options. You can go for parallel testing as well. In this example, we will create a custom test plan.
After that, click on the Add Test Device button to add test devices. You can enter the following details here.
Click on the create button to create the Test Plan. To get more details on how to create a test plan, you can follow this guide.
Step 5. Execute Test Plan and Analyse the results.
After you have created the Test Plan, you can click on the Run button to execute the test.
You can now check the results in the Run Results view.
You will get a detailed comprehensive test result with environment-specific details as well. This will help you to adopt a drill-down approach, analyze the failed test cases, debug them, and re-run the test cases until all the modules are integrated without any errors.
In this article, we skimmed through the topic of Android integration testing, discussed what it is and how is it done. We then discussed how you can leverage an automated tool like Testsigma to perform Android integration testing on the module interfaces of your Android applications.
We discussed tons of features that the Testsigma tool provides to make your Android integration testing experience a seamless one. So without any further wait, you should immediately sign up for a free trial with Testsigma if you already haven’t.