4

Testing Legacy Apps on Android [SUBSCRIBER]

 1 year ago
source link: https://www.kodeco.com/32839187-testing-legacy-apps-on-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.

Testing Legacy Apps on AndroidGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupShapeGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroup

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

Home Testing Legacy Apps on Android
domain-android-793ce8745970e3fee80e798cb3371b5ec31d3d2678867c3b6f7bb23bb16a7be9.svg
original.png
media-course-android-f507e1136da0a1d634e8be2a45c86f9b374d4f6e4ecdf867ad73d4bac611b26e.svg

Home Testing Legacy Apps on Android

Pro

Testing Legacy Apps on Android

Feb 9 2023, Kotlin 1.6, Android 12, AS Bumblebee 2021.1.1

In this course you are going to learn how to apply the test-driven development practices your learned in “Test-Driven Development in Android” on legacy Android apps. You will learn how to determine your limits when testing legacy code, how to add tests to a legacy app with no test coverage and how to refactor your legacy code for testability.

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

  • Adding Legacy Tests
  • Mock Data
  • Writing Legacy Tests
  • Refactoring Code for Testability
  • Koin and Mockito
  • Nitrogen and Shared Tests
  • Unt Tests with Retrofit

Part 1: Testing Legacy Android Apps

In this episode I am going to give you a brief introduction to Test-Driven Development in Android over the years. We are also going to explore the problems that some legacy code has that makes it difficult to test.

In this episode I am going to give you a quick introduction to the project you are going to use. You are also going to add the appropriate code to make sure the app is ready for testing.

When adding tests to a legacy app with no test coverage, the first step is to add tests around the functionality where you are going to be adding a feature. In this episode you are going to add tests around the “search for companion” section of your app.

Mock web server sets up a local web server that runs on a random port on an Android Device. To use this local web server along with retrofit you need to point your retrofit instance at this local web server instead of the one at petfinder. Here I am going to show you how to do just that.

Before working with our petfinder service we need to know how our data looks like. In this episode I am going to show you the GET response that we are going to use to receive a pet companion from our API.

Now that you know how your data looks like and have a file with a mock response you are going to create a method that automatically reads your file and returns its contents.

Next we are going to write a test to verify that we have the appropriate navigation between our screens.

One thing you should always look for when writing tests is to refactor every time it is possible so you don’t repeat yourself. In this lesson you are going to refactor some methods using the @Before and @After annotations.

In the final episode for this course you are going to write a test for a new feature following the red green refactor steps of test-driven development.

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