How to Create Test Cases For Android Application

test cases for android application

A test case is a set of test inputs, their implementation conditions and expected results that are developed keeping a particular outcome in focus. In simple words, a test case is a set of conditions under which a tester checks in a particular system to determine if it meets the specific test requirements and functions properly.

Developing test cases is also helpful in determining the issues, requirements and design of a particular application being tested.
Test cases are categorized into two, which include formal and informal test cases. A formal test case includes a well-defined input and an expected output that is written before the execution of a test.
The aim behind writing an input beforehand is to test a precondition and that of output is to test a post condition. To test an application for all the requirements, there are at least one positive and one negative test case that is created for each requirement.
In case any of these requirements has a sub-requirement, then each sub-requirement will also have at least two test cases. Informal test cases are used when there are no formal requirements for a test.

These are written on the basis of the accepted normal operation of the programs of a similar class. To conduct these tests, imaginary situations are used to enable a tester to think about different probabilities in a complex situation.
However, these are not written in detail, these test cases can be as simple as a diagram or a description written in prose.
How to Write a typical Test Case?
Generally, there are different types of test management tools that are used by the companies to determine the elements that are to be included in a test case. This, in turn, leads to an inclusion of a different set of elements in each test. But, there are certain elements that are common in almost every test case as mentioned below:

  • Test suite ID
  • Test case ID
  • Test case summary
  • Related requirement
  • Prerequisites of conducting the test
  • Procedure to conduct the test
  • Test data or links to the same
  • Expected result
  • Actual result
  • Status of the test
  • Comments, if any
  • Creator and date of creation of the test case
  • Name of the executor
  • Date of execution
  • Test environment

Android Testing

Android is the most popular mobile operating system in the world with its number of varied versions available in the market. Like any other software, it is important to test an android apps rigorously to avoid any sort of flaws in its functioning such as, installation failure, crash during execution, scaling issues, layout problems, hang issue and issue with its landscape/portrait mode.
Levels of Writing Test Cases for Android Testing
 Writing test cases is important to ensure the optimum functioning of any application. The test cases that are written by a team are typically categorized as per different levels. This is done to ensure that there are no duplicate efforts of a team being invested in a single function.
The levels of writing test cases are:

  • Level 1: This level includes the writing of test cases that are based on the available information about the product’s specification and user documentation
  • Level 2: Considered to be a practical stage, this level includes writing of test cases on the basis of actual functional and system flow of the application
  • Level 3: At this level, some test cases are grouped together to write a test procedure. Test procedure refers to a group of small test cases and can include a maximum of 10 test cases
  • Level 4: The process is automated at this level. This helps in minimizing the human interaction with the system, which enables the QA to focus only on currently updated functionalities to test

Tips to Write Test Cases for Android Application

Writing a good test case is easy. However, it just requires an individual’s hard work, determination and clear focus. Some of the simple tips to write an effective test case for Android application include:

  • Test cases should be written in such a way that they allow a person to test only one feature at a time
  • One should not overlap or complicate test cases
  • Cover all the positive and negative probabilities of the test outcomes
  • Write in simple language with exact and accurate names of forms, fields, etc.
  • Android developers should make sure that they continue to create test cases when the application code is still in the process of writing
  • Test cases should be stores in version control along with source code
  • The focus should also be on continuous integration of the new test cases
  • Tests should be run every time the code is changed
  • Avoid using emulators and rooted devices

Apart from these, it is also important that the test cases are accurate and meet the exact purpose of conducting a test. These should also be free from any sort of unnecessary information and be capable of being reused.

Conducting a test on an Android application is essential as this is one crucial step that can decide the fate of the entire application. If conducted properly, one can fix all the bugs and launch a superb quality product in the market. Therefore, make sure that launch of your next product is preceded by its thorough testing so as to ensure a superb quality.