O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test-Driven Development (TDD) for Android

Video Description

2.5 Hours of Video Training

Continuous Delivery (CD) is an agile practice that's had a big impact on how many people think about developing software. It forced us to start thinking that software is only "done" when it is released. With more features reaching the done stage sooner, CD practices have enabled us to get early feedback from users and taught us a lot about testing, monitoring, and automating our delivery along the way. But mobile development has often been left behind. Or has it?

Testing is an important component of CD and shouldn't be taken for granted or ignored, especially when developing mobile applications. The process of setting up a testable environment and writing tests, however, can be a challenge. Implementing unit tests and following principles of test-driven development for mobile apps--whether native or hybrid--is often counterintuitive. To guarantee that each component in your mobile app works properly for the set of inputs you expect, it is important to test each component (or unit) of an architecture independently and to simulate different system states based on the supplied input to the test, while covering exotic cases in the process.

Description

In Test-Driven Development (TDD) for Android, ThoughtWorks Lead Consultant Cassie Shum takes a deep dive into the critical role of TDD in mobile development. This video quickly reviews Continuous Delivery best practices and the role of CD in mobile development. The video then focuses on the role of TDD, showcasing how to use tools for unit testing and UI testing by demonstrating with Android testing frameworks Robolectric and Espresso.

About the Instructor

Cassie Shum, a Lead Consultant with ThoughtWorks, has been leading and working primarily in a variety of mobile projects and other technologies, including Domain Driven design and Microservices. She has been involved in many different web and mobile applications for the past six years following continuous delivery practices. She is also one of the leaders in the initiative to organize the women’s group in ThoughtWorks, and is also involved in promoting more female speakers in technology.
Twitter: cassiend


Skill Level

  • Intermediate

Learning Objectives

  • Provides an overview of the role of agile development practices and CD in mobile development
  • Shows how to choose the most appropriate framework for your organization and architecture
  • Covers native and hybrid app development and how to choose and implement best tools whether you are building apps for iPhone or Android
  • Walks through real-world examples that illustrate trade-offs architects and developers need to address

Course Requirements

  • Android Studio or IntelliJ
  • Android SDK
  • Java

Who Should Take This Course?

  • Software developers and architects who are interested in applying CD practices to mobile development.
About LiveLessons Video Training

The LiveLessons Video Training series publishes hundreds of hands-on, expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. This professional and personal technology video series features world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, IBM Press, Pearson IT Certification, Prentice Hall, Sams, and Que. Topics include: IT Certification, Programming, Web Development, Mobile Development, Home and Office Technologies, Business and Management, and more. View all LiveLessons on InformIT at: http://www.informit.com/livelessons.

Table of Contents

  1. Introduction
    1. Test-Driven Development (TDD) for Android: Introduction 00:00:51
  2. Lesson 1: Continuous Delivery
    1. 1.1 Continuous delivery overview 00:03:22
    2. 1.2 Benefits of continuous delivery 00:03:48
    3. 1.3 Evolution of mobile development 00:05:36
  3. Lesson 2: TDD and the Testing Pyramid
    1. 2.1 Testing mobile applications 00:09:39
    2. 2.2 Continuous integration 00:04:17
    3. 2.3 The testing pyramid 00:05:16
    4. 2.4 A simple application: acceptance tests, integration tests, and unit tests 00:05:59
    5. 2.5 What is test-driven development? 00:09:43
    6. 2.6 Red, green, refactor 00:06:25
  4. Lesson 3: Android Testing Framework: Robolectric
    1. 3.1 When to use Robolectric 00:05:15
    2. 3.2 Understand the Robolectric project structure 00:04:01
    3. 3.3 Test the Robolectric framework from IDE or command line 00:11:40
    4. 3.4 Test-driven development with Robolectric 00:08:42
    5. 3.5 Test additional requirements with Robolectric 00:06:52
    6. 3.6 Red, green, refactor, and run the app 00:11:20
    7. 3.7 Run tests in command line and view test summary in browser 00:03:09
  5. Lesson 4: Android Testing Framework: Espresso
    1. 4.1 When to use Espresso 00:01:35
    2. 4.2 Understand the Espresso project structure 00:06:20
    3. 4.3 Test the Espresso framework from IDE or command line 00:07:25
    4. 4.4 Test-driven development with Espresso 00:08:52
    5. 4.5 Test additional requirements with Espresso 00:14:50
    6. 4.6 Unit test vs user journey test 00:04:41
    7. 4.7 Compare Robolectric and Espresso in the testing pyramid 00:04:51
  6. Summary
    1. Test-Driven Development (TDD) for Android: Summary 00:00:31