
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
- JarosÅaw Michalik
- November 30, 2024
- 11:03 am
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.
- JarosÅaw Michalik
- November 25, 2024
- 12:34 am
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.
- JarosÅaw Michalik
- October 31, 2023
- 12:25 pm
Short answer: you don't.
Instead...
- JarosÅaw Michalik
- October 31, 2023
- 12:23 pm
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.
- JarosÅaw Michalik
- February 13, 2023
- 7:07 pm
In this article we will explore several ways of creating stubs⊠using Kotlin idioms.
- JarosÅaw Michalik
- January 2, 2023
- 4:12 pm
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.
- JarosÅaw Michalik
- July 6, 2022
- 3:26 pm
Examples of de-mocking test code as presented on Droidcon Berlin 2022.
- JarosÅaw Michalik
- May 8, 2022
- 3:04 pm
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.
- JarosÅaw Michalik
- February 18, 2022
- 2:59 pm
Mockito cannot mock/spy because your class is final class? We can fix that.
- JarosÅaw Michalik
- February 12, 2022
- 1:40 pm
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.
- JarosÅaw Michalik
- November 28, 2021
- 1:32 pm
JVM and Kotlin testing libraries - Gradle dependencies and latest versions.
- JarosÅaw Michalik
- September 7, 2021
- 1:20 pm
Learn how to create custom Timber Tree to test log outputs in unit tests. Mocking Timber, unit testing logs.
- JarosÅaw Michalik
- July 20, 2021
- 12:52 pm
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.
- JarosÅaw Michalik
- June 14, 2021
- 12:45 pm
Strikt is assertion library built for Kotlin with API which allows building multi assertions and gives us readable assertion errors.
- JarosÅaw Michalik
- May 10, 2021
- 7:49 am
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.
- JarosÅaw Michalik
- April 6, 2021
- 7:00 am
IntelliJ is great tool for developer productivity. Check how can we adjust IDE to our preferences. Tutorial: how to create custom live template?
- JarosÅaw Michalik
- February 20, 2021
- 6:38 am
The story of debugging date time formatting issue. It passes locally, it fails on CI. How can it be?
- JarosÅaw Michalik
- February 9, 2021
- 6:20 am
KotlinTesting.com now has stories!
- JarosÅaw Michalik
- January 14, 2021
- 8:56 pm
Nested tests in Junit5 allows us grouping test cases. Check how to do this in presenter tests.
- JarosÅaw Michalik
- January 2, 2021
- 8:32 pm
Frequently Asked Questions - now I'm giving answers about things you've asked me on 2020 conferences.
- JarosÅaw Michalik
- December 2, 2020
- 8:10 pm
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.
- JarosÅaw Michalik
- October 29, 2020
- 8:02 pm
Functional tests in Ktor - how to mock application server with TestApplicationEngine?
- JarosÅaw Michalik
- October 20, 2020
- 7:52 pm
Refactoring Java Mockito based test suite to Mockito-Kotlin DSL
- JarosÅaw Michalik
- September 24, 2020
- 3:28 pm
How to test Retrofit calls? Example of testing requests executed with Retrofit and OkHttp.
- JarosÅaw Michalik
- September 2, 2020
- 2:59 pm
Story of an attempt to test the code generated by DataBinding library.
- JarosÅaw Michalik
- August 11, 2020
- 2:08 pm
Creating parameterized tests in Kotlin: data driven testing, collection inspections and generating test cases with FreeSpec.
- JarosÅaw Michalik
- June 5, 2020
- 12:06 pm
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.
- JarosÅaw Michalik
- May 30, 2020
- 11:54 am
Using Spek to generate test cases
- JarosÅaw Michalik
- May 30, 2020
- 11:16 am
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.
- JarosÅaw Michalik
- May 25, 2020
- 11:06 am
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.