fbpx
android pro newsletter tips and tricks how to learn android

AndroidPro newsletter 🚀

join 3057 developers reading AndroidPro newsletter every week

👉 tips & tricks, articles, videos

👉 every Thursday in your inbox

🎁 bonus on signup – Clean Architecture blueprint

brought to you by Jarek Michalik, Kotlin GDE

You can unsubscribe any time. For details visit our privacy policy.

Blog

Eight years ago, I almost punched my code reviewer. Today, I'm that "annoying" person leaving detailed comments on PRs. Here's what I learned.
Building an Android developer career isn’t just about coding—it’s about the experiences that push you to grow. Whether it’s connecting with other Android devs at meetups or mastering the fundamentals, it’s those key moments that shape how you approach the craft.
Short answer: you don't. Instead...
When it comes to testing in Kotlin, we often default to jUnit as the go-to framework. However, there's an alternative that offers a variety of powerful features – Kotest. Kotest provides a variety of spec styles, each with its unique capabilities, that make writing tests a breeze.
In this article we will explore several ways of creating stubs
 using Kotlin idioms.
Are you programming for Android and wondering how to write tests for your app? Or maybe you don't have any tests in your project and don't know how to live? Get to know my philosophy of creating tests for Android.
Examples of de-mocking test code as presented on Droidcon Berlin 2022.
Most of the times while stubbing with Mockito or MockK you will use doReturn construction. But do you know, that you can stub your test double method in other way – with doAnswer. Let's take a look a both stubbing types.
Mockito cannot mock/spy because your class is final class? We can fix that.
When you have existing test suite containing jUni4 tests and you want to migrate slowly to jUnit5 to make use of new APIs and modern test engine, you may encounter some issues – not all tests will be visible in reports.
JVM and Kotlin testing libraries - Gradle dependencies and latest versions.
Learn how to create custom Timber Tree to test log outputs in unit tests. Mocking Timber, unit testing logs.
Do you want to assert that SLF4J actually logged warn with proper message? Check this guide on how to mock logger in tests, in Kotlin and Java.
Strikt is assertion library built for Kotlin with API which allows building multi assertions and gives us readable assertion errors.
Writing tests involves repeating some patterns over and over again. IntelliJ IDEA can shorten the process of test creation with the help of live templates.
IntelliJ is great tool for developer productivity. Check how can we adjust IDE to our preferences. Tutorial: how to create custom live template?
The story of debugging date time formatting issue. It passes locally, it fails on CI. How can it be?
Nested tests in Junit5 allows us grouping test cases. Check how to do this in presenter tests.
Frequently Asked Questions - now I'm giving answers about things you've asked me on 2020 conferences.
MockK over the years became my go-to library for mocking suspend functions. Its intuitive syntax and built-in coroutine support simplify testing asynchronous operations. With MockK, you can easily replicate complex behaviors of coroutine-based functions, ensuring tests are reflective of real-world scenarios. Mock - fake version of an object used in testing to check how other parts of a program interact with it. Stub - fake part of the program that always returns the same result. This article will show you how to use both in testing Kotlin code with MockK.
Functional tests in Ktor - how to mock application server with TestApplicationEngine?
Refactoring Java Mockito based test suite to Mockito-Kotlin DSL
How to test Retrofit calls? Example of testing requests executed with Retrofit and OkHttp.
Story of an attempt to test the code generated by DataBinding library.
Creating parameterized tests in Kotlin: data driven testing, collection inspections and generating test cases with FreeSpec.
When the test passes, when it fails and why it crashes? In this short note we will try to find the answers for those questions.
In this example we will try to implement VenueDetailsViewModel in TDD style. TDD (Test Driven Development) is development technique, where developer relies on unit tests created before actual implementation.
This repository contains examples of basic unit tests written in Kotlin. In specific directories you can find gradle buildscript with needed dependencies and configuration, simple unit test and parameterized test.