eucalypto / learn

These are projects that help me learn
0 stars 0 forks source link

TO-DO Notes App (Advanced Android Kotlin Testing Codelab) #25

Open eucalypto opened 3 years ago

eucalypto commented 3 years ago

TO-DO Notes App - from Advanced Android Kotlin Testing Codelab

Project Files


Whole course overview: https://developer.android.com/codelabs/advanced-android-kotlin-training-welcome#1

Original repository: https://github.com/googlecodelabs/android-testing

eucalypto commented 3 years ago

Whole course overview: https://developer.android.com/codelabs/advanced-android-kotlin-training-welcome#1

Lesson 5: Testing and Dependency Injection

The Android Testing lesson includes three codelabs:

89c42ff65cdbd4e9.png

Testing Basics

This codelabs covers the basics of running and writing tests for Android. It includes Test Driven Development, source sets, Robolectric, AndroidX, and testing ViewModels and LiveData.

Dependency Injection and Test Doubles

This codelab covers how to implement manual dependency injection and use test doubles on Android. It includes setting up manual dependency injection, creating fakes, creating mocks, creating ServiceLocators, instrumentation tests for Fragments, testing Navigation, and basic Espresso testing.

Survey of Testing Topics

This final codelabs covers testing specific types of code, including:

eucalypto commented 3 years ago

Advanced Android in Kotlin 05.1: Testing Basics

1. Welcome

This codelab is part of the Advanced Android in Kotlin course. You'll get the most value out of this course if you work through the codelabs in sequence, but it is not mandatory. All the course codelabs are listed on the Advanced Android in Kotlin codelabs landing page.

Introduction

When you implemented the first feature of your first app, you likely ran the code to verify that it worked as expected. You performed a test, albeit a manual test. As you continued to add and update features, you probably also continued to run your code and verify it works. But doing this manually every time is tiring, prone to mistakes, and does not scale.

Computers are great at scaling and automation! So developers at companies large and small write automated tests, which are tests that are run by software and do not require you to manually operate the app to verify the code works.

What you'll learn in this series of codelabs is how to create a collection of tests (known as a testing suite) for a real-world app.

This first codelab covers the basics of testing on Android, you'll write your first tests and learn how to test LiveData and ViewModels.

What you should already know

You should be familiar with:

What you'll learn

You'll learn about the following topics:

You'll learn about the following libraries and code concepts:

What you'll do