# KotlinX

Published articles for KotlinX.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## The conflation problem of testing StateFlows

DevFeed: [The conflation problem of testing StateFlows](<https://devfeed.tech/articles/the-conflation-problem-of-testing-stateflows-27057.md>)

Original publisher: [Read original article](<https://zsmb.co/conflating-stateflows/>)

Author: Márton Braun

Published: 2023-08-15T14:00:00Z

Content type: tutorial

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [coroutine-testing](<https://devfeed.tech/tags/coroutine-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlinx](<https://devfeed.tech/tags/kotlinx.md>), [marton-braun](<https://devfeed.tech/tags/marton-braun.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui](<https://devfeed.tech/tags/ui.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>), [zsmb](<https://devfeed.tech/tags/zsmb.md>), [zsmb-co](<https://devfeed.tech/tags/zsmb-co.md>), [zsmb13](<https://devfeed.tech/tags/zsmb13.md>), [zsmbco](<https://devfeed.tech/tags/zsmbco.md>)

### AI overview

This article explains how StateFlow conflation affects tests. It compares asserting on the StateFlow state property with collecting emitted values, and discusses testing intermediate values when rapid updates may be skipped by slow collectors.

### Source excerpt

StateFlow behaves as a state holder and a Flow of values at the same time. Due to conflation, a collector of a StateFlow might not receive all values that it holds over time. This article covers what that means for your tests.

## Using KotlinX Flow for Functional Data Pipelines

DevFeed: [Using KotlinX Flow for Functional Data Pipelines](<https://devfeed.tech/articles/functional-flowing-25513.md>)

Original publisher: [Read original article](<http://nomisrev.github.io/functional-flowing/>)

Author: Simon Vergauwen

Published: 2022-11-24T00:00:00Z

Content type: article

Language: en

Sources: [nomisRev](<https://devfeed.tech/sources/nomisrev.md>)

Topics: [Streaming](<https://devfeed.tech/topics/streaming.md>), [data](<https://devfeed.tech/topics/data.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [data](<https://devfeed.tech/tags/data.md>), [flow](<https://devfeed.tech/tags/flow.md>), [functional](<https://devfeed.tech/tags/functional.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlinx](<https://devfeed.tech/tags/kotlinx.md>), [pipelines](<https://devfeed.tech/tags/pipelines.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [talk](<https://devfeed.tech/tags/talk.md>)

### AI overview

A talk explains how KotlinX Flow can be used to describe functional programs and build efficient streaming pipelines for transforming and manipulating data.

### Source excerpt

KotlinX's Flow data type is extremely powerful, and offers an API that is quite familiar for functional programmers. This talk will showcase how we can leverage KotlinX Flow to describe powerful programs, and build pipelines to transform and manipulate data in an efficient streaming way.

## Hello8Ball: Exploring Coroutine Testing with a Kotlin Sampler App

DevFeed: [Hello8Ball: Exploring Coroutine Testing with a Kotlin Sampler App](<https://devfeed.tech/articles/hello8ball-32055.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/hello8ball/>)

Published: 2019-11-23T21:36:11Z

Content type: tutorial

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [test](<https://devfeed.tech/topics/test.md>), [CircleCI](<https://devfeed.tech/topics/circleci.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [circleci](<https://devfeed.tech/tags/circleci.md>), [code](<https://devfeed.tech/tags/code.md>), [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [coroutine-testing](<https://devfeed.tech/tags/coroutine-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [detekt](<https://devfeed.tech/tags/detekt.md>), [jacoco](<https://devfeed.tech/tags/jacoco.md>), [kotlinx](<https://devfeed.tech/tags/kotlinx.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

Hello8Ball is a toy sampler app for exploring coroutine testing in Kotlin. It simulates an 8 Ball and includes examples involving network calls, calculations, password generation, synonym lookup, and prime-number checks. The repository includes tests using kotlinx-coroutine-test, CircleCI test execution, detekt, JaCoCo coverage, and a branch converted to JUnit 5.

### Source excerpt

A sampler app to explore Coroutine testing. This is a toy app that simulates an 8 Ball. It can answer questions, find synonmyms, generate a password or check if a number is prime. It was created to make a situation where it makes sense to use coroutines to e.g. go on the network or make a calculation. Then I added tests for all the pieces using kotlinx-coroutine-test. As a bonus the repo is set up to run the tests on CircleCi. It has detekt setup and jacoco code coverage. There is also a branch where all the tests are converted to junit5. Devfest 2019 video This is the companion repo to the KotlinEveryWhereZA 2019 and DevFestZa 2019 talk. Slides are in the repo. code