How we test concurrent algorithms in Kotlin Coroutines
summary
JetBrains uses Lincheck to declaratively test a dozen non‑trivial concurrent data structures (queues, semaphores, channels), generating and controlling interleavings by instrumenting bytecode, reproducing bugs and producing a concrete interleaving trace. Tests run as stress or model checking mode where the engine decides preemptions, finds a counterexample (for example a bounded‑queue with capacity 2 accepting three adds), and helps root cause analysis. The framework repeatedly uncovers real issues — it even found bugs in the standard Java library — and verifies fixes deterministically.
AI-written summary · about
chapters (10)
- 0:00Start
- 5:36Typical Concurrent Tests
- 7:34An Ideal Concurrent Test
- 9:08Let's run the test!
- 9:37Correctness in Sequential World
- 10:55Correctness in Concurrent World
- 20:31Lincheck Overview
- 22:30Bytecode Transformation
- 25:14Counter Test
- 30:29Summary
related talks
01h 11mWorkshop. Lincheck: Testing concurrency on the JVM (Part 2)
01h 10mWorkshop. Lincheck: Testing concurrency on the JVM (Part 1)
43mEffective Unit testing with Kotlin
47mFew Tools: How To Write And Understand! Coroutines Tests
44mTesting Kotlin Coroutines
42mUnit Testing Kotlin Channels & Flows
38mUnit Testing Kotlin Channels & Flows
33mTesting with Coroutines
