Book Image

Testing and securing android studio applications

Book Image

Testing and securing android studio applications

Overview of this book

Table of Contents (18 chapters)
Testing and Securing Android Studio Applications
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Testing activities


There are two possible modes of testing activities:

  • Functional testing: In functional testing, the activity being tested is created using the system infrastructure. The test code can communicate with the Android system, send events to the UI, or launch another activity.

  • Unit testing: In unit testing, the activity being tested is created with minimal connection to the system infrastructure. The activity is tested in isolation.

In this chapter, we will explore the Android testing API to learn about the classes and methods that will help you test the activities of your application.

The test case classes

The Android testing API is based on JUnit. Android JUnit extensions are included in the android.test package. The following figure presents the main classes that are involved when testing activities:

Let's learn more about these classes:

  • TestCase: This JUnit class belongs to the junit.framework. The TestCase package represents a general test case. This class is extended by the...