2

Test-Driven Development in Android [SUBSCRIBER]

 1 year ago
source link: https://www.kodeco.com/29746623-test-driven-development-in-android
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Test-Driven Development in AndroidGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupShapeGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroup

Kodeco is the new raywenderlich.com. Read about our changes here.

Kodeco is the new raywenderlich.com

We're excited to introduce our new name, and our new look and feel, with all of the same content you know and love!

Read the full story

This course is available as part of the kodeco.com Professional subscription. To learn more click here

Home Test-Driven Development in Android
domain-android-793ce8745970e3fee80e798cb3371b5ec31d3d2678867c3b6f7bb23bb16a7be9.svg
original.png
media-course-android-f507e1136da0a1d634e8be2a45c86f9b374d4f6e4ecdf867ad73d4bac611b26e.svg

Home Test-Driven Development in Android

Pro

Test-Driven Development in Android

Jan 24 2023, Kotlin 1.6, Android 12, AS Bumblebee 2021.1.1

In this course, you are going to learn how to create scalable and maintainable apps by applying several testing methodologies like the Red-Green-Refactor steps and frameworks such as JUnit and Mockito. You will also learn about SOLID principles, design patterns and the best architectures for testing.

By Aldo Olivares.

Who is this for?

This course is intended for intermediate and advanced level Android Developers that have a good background in Android Development, Kotlin and Software Development. Experience with testing libraries such as Mockito and JUnit is recommended but not required.

Covered concepts

  • Android App Architectures
  • Red-Green-Refactoring
  • The Testing Pyramid
  • Mockito & Junit
  • Espresso
  • Testing the Network layer
  • Testing the Persistance layer
  • Testing the UI

Part 1: Unit Tests

In this episode you are going to learn what test-driven development is and its advantages over traditional development practices.

A very important part of test-driven development are the Red-Green-Refactor steps. In this episode you will learn what they are and how to use them regardless of the development platform you are using.

In this episode I am going to give you a short introduction to Software Testing and its importance.

JUnit is a powerful java framework that allows you to perform unit testing in your Android project. In this episode you are going to set up JUnit and create your first unit test.

In this lesson we are going to create our first unit tests with TDD using JUnit.

Continuing from the previous episode, we are going to create more unit tests using JUnit.

Tired of writing the same code in different tests? In this episode you are going to learn how to use annotations to execute code automatically before each test is run.

In this episode you’re going to test your Answer and Question classes with Mockito and JUnit.

The last step of the Red-Green-Refactor steps is to, well, refactor your code. This time you will refactor the code of your cocktail app and verify that it is still working as expected by executing all of your tests at once.

Part 2: Integration Tests

A very important part of test-driven development are the Red-Green-Refactor steps. In this episode you will learn what they are and how to use them regardless of the development platform you are using.

Here we are going to create a test class for all of our integration tests.

Now that you have reviewed the app and the project structure for this section you’re ready to create the first integration test for your project. In this episode you’ll create your first integration test.

Just like integration tests, you’ll need practice to master integration tests. In this episode you’ll create even more integration tests for your View Models.

We just need to add one more test before wrapping up this section of the course. In this episode we will add one more integration test to our app before refactoring our code.

As a final step for this section, we’re going to refactor our code and make sure that everything still works as expected by executing your tests.

Part 3: Test-Driven Development: UI Tests

Normally, when creating new Android Projects Espresso dependencies are already added for you since it is a very popular library. Still, we need to make sure everything works fine before working with it. In this episode we are are going to verify that espresso dependencies are added and create our test class.

In this episode we will create a UI test by automatically lauching an Activity and verifying if a button is displayed on screen.

Now that you know how to verify if a button is visible on the screen you’ll learn how to check if a certain text is displayed. This is specially useful for alerts and messages you want to display.

When a user taps the New Joke button a new joke should appear on our screen. In our final episode we are going to write the most complex test by creating a Joke, a list of answers and verifying it is displayed on our screen.

Instructors

Contributors

Over 300 content creators. Join our team.

All videos. All books.
One low price.

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalogue of 50+ books and 4,000+ videos.

Learn more

The largest and most up-to-date collection of courses and books on iOS, Swift, Android, Kotlin, Flutter, Dart, Server-Side Swift, Unity, and more!

© 2023 Kodeco Inc


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK