How to write unit tests in Kotlin

Dependency First you need to add the following dependency to your build.gradle file dependencies { testImplementation ‘org.jetbrains.kotlin:kotlin-test’ As a second step you need to add the task test { useJUnitPlatform() } Implementation When you are familiar with JUnit you may recognized the @Test annotation. Assertions work pretty much the same. You can choose from a…

Wie baue ich eine entwicklungsbegleitende Software-Qualitätssicherung auf?

Aufbau einer entwicklungs-begleitenden Software-Qualitätssicherung In meiner Zeit als Software-Entwickler bei mgm technology partners und der e.solutions GmbH durfte ich zweimal eine entwicklungsbegleitende Qualitätssicherung aufbauen. Bei mgm technology partners konnten wir im ERiC (Elster Rich Client) die Neufehlerrate pro Release um 90% senken. Bei e.solutions begleiteten wir das Audi Virtual Cockpit in die drei ersten SOPs…

Kotlin Tutorial

This is the overview page for my little Kotlin tutorial Learning Kotlin Part 1 – print Learning Kotlin Part 2 – arrays Learning Kotlin Part 3 – ranges Learning Kotlin Part 4 – conditionals Learning Kotlin Part 5 – loops Learning Kotlin Part 6 – functions Learning Kotlin Part 7 – multiple return values Reading…

How to implement Python Decorators – Part 2

When you’ve finished reading How to implement Python Decorators you might wonder if it is possible to hand over some parameters to the decorator function. And yes that is possible and can come in quite handy. For a Flask project I wrote a decorator to manage authorization of endpoints. I wanted to grant access to…

How to use glob in Python

Motivation Sometimes you need to find files across multiple directories and / or directory hierarchies according to certain pattern. E.g. find all image files with the jpg extension You can use it to find files in a directory by using wildcard semantics. Let’s say we have a directory structure like this: glob_test/ |– dir_a/ |–…

Anatomy of a Gradle file

Motivation Understanding Gradle is mandatory if you want to build good Android apps Bare Minimum This is the bare minimum you need to be able to compile and run an Android application: plugins { id ‘com.android.application’ id ‘kotlin-android’ } android { compileSdk 30 defaultConfig { applicationId “de.creatronix.myapplication” minSdk 21 } } dependencies { implementation ‘androidx.core:core-ktx:1.6.0’…

How to write your __init__.py

What should you put into your __init__.py? Perhaps you already know that a python package is a directory which contains a __init__.py file In this article we will solve the mystery around the __init__.py For this article let’s assume the following project structure: Empty init file Sometimes doing nothing isn’t so bad at all. You…

How to implement Python Decorators

Motivation Python decorators are a nice way to implement the decorator pattern. Perhaps you read the article about Python data classes and wondered how the @dataclass thingy worked. Example Let’s say we created the following function: def un_decorated_function(): print(‘–> Starting un_decorated_function’) print(‘Inside un_decorated_function’) print(‘<– un_decorated_function finished’) This works but violates the DRY principle if repeated…