Given When Then concept on your project

Kotlin Spek Framework

Spek is a formidable behavior-driven testing framework designed for Kotlin. With Spek, we can quickly implement a BDD (Behaviour Driven Development) environment that allows you to easily define your tests in a clear, understandable, and human-readable way.

At this point, we can learn how we create an Android unit test using Spek. Hopefully, this can help developers who may not be comfortable with testing.

But before we even begin, we have a problem. Spek runs well with JUnit5 and Android is stuck on JUnit4. We need another library.

This is what we’ll use:

Step 1 — Setup JUnit5


Kotlin linter that can improve our code

When we talk about lint, many developers think it is related to the style guide. Well, this is not only that.

Linting is the process of analyzing code for potential errors.

As an Android developer, we are using Kotlin language, but is our code clean and comfortable to read? Maybe there are still many of us who are still affected by the Java Code Style or some studying the Kotlin Style Guide.

Ktlint can be our assistant, a linter made to be the Kotlin writing standard format with simplicity, extensibility, and have an active community. So how can we use…


Convert from Groovy to Kotlin script

Build Gradle with Kotlin DSL

It has been a long time since we wrote a Gradle with a script called Groovy, but finally, there is something new 😮.

Kotlin DSL comes with autocomplete, navigation to resource, checking error at compile time and make code readable. How to use Kotlin script on Gradle? Just follow the steps.

FYI, when writing this I use com.android.tools.build:gradle:3.5.0 and on gradle-wrapper 5.4.1

Step 1 — Create buildSrc

Achmad Fachrudin

Happy Android Engineer 💙 achmadfachrudin.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store