Yousof Selim Résumé
All projects

SyncLab

Open source · Kotlin Multiplatform

Deterministic simulation and fault-injection testing for Kotlin Multiplatform sync engines.

  • Kotlin Multiplatform
  • Kotlin Coroutines
  • Ktor
  • JUnit 5
  • Gradle
231multiplatform tests passing across JVM, JS, macOS arm64 and iOS Simulator
9built-in network fault types plus custom interceptors and fault shrinking
2/2targeted mutations killed after closing replay-token and fingerprint coverage gaps

Verified locally on macOS Apple Silicon on 25 Nov 2026 via ./gradlew check and tools/fresh-install-check.sh. CI runs the JVM, JS, macOS and iOS tests and kills all 22 targeted mutations.

In short

I built a Kotlin Multiplatform testing library with a virtual-time dispatcher, nine network fault types, crash/restart storage, fault shrinking and standalone HTML relay-lane reports.

Read the full overview

Offline-first sync bugs—race conditions, dropped packets, clock skew and crash-during-write corruption—rarely reproduce in normal unit tests. SyncLab provides a deterministic virtual-time coroutine dispatcher, simulated network with nine fault types, durable crash/restart storage, Ktor client integration, invariant assertions, fault shrinking and replay tokens across JVM, JS, macOS and iOS targets. When a test fails, it emits a standalone HTML report showing relay lanes and the exact minimal fault sequence needed to reproduce the bug. Open source on GitHub with 231 passing multiplatform tests.

The problem

Sync engines fail under flaky networks, clock skew and mid-write crashes—conditions that wall-clock tests either miss or make flaky.

  1. 1

    Real network and sleep-based tests are slow and non-deterministic.

  2. 2

    Finding a failing interleaving is only half the battle; developers need a minimal reproducer and replay token.

  3. 3

    Offline-first mobile and desktop apps share sync logic in Kotlin Multiplatform and need tests across JVM, JS and native targets.

My part

What I did

  • synclab-core virtual-time dispatcher, seeded interleavings, 9 network faults, crash/restart storage and fault shrinking
  • synclab-ktor, synclab-junit5 and synclab-report (JSONL, GitHub summary and standalone HTML relay-lane viewer)
  • Four runnable examples (expense ledger, offline tasks with clock skew, CRDT collaborative text, Ktor inventory)
  • API binary-compatibility dumps, mutation test harness and isolated Maven fresh-install check

Not mine

  • Kotlin, Ktor, JUnit 5 and the other open-source tools it is built on.
  • It is not on Maven Central yet, so you build it locally and add it from Maven Local.

Solo, with AI coding agents: virtual-time engine, Ktor/JUnit5/report modules, examples, mutation testing and multiplatform verification · Solo · 2026-11 – Present

Hard parts

1Building a custom virtual-time dispatcher instead of TestCoroutineSchedulerPer-step invariant checking, seeded same-instant ordering, exact idleness detection and escaped-dispatcher detection required tighter control than standard test schedulers expose.

What I weighed

  • Wrap kotlinx.coroutines.test.TestCoroutineScheduler
  • Implement a dedicated virtual-time dispatcher with seeded scheduling and foreign-thread checks

What I did

Built a custom virtual-time dispatcher in synclab-core with deterministic replay tokens and fault shrinking (~10 re-runs per failure).

The cost

Relies on Coroutines' internal Delay interface, documented explicitly in COMPATIBILITY.md.

How I checked

231 tests across JVM, JS, macOS arm64 and iOS Simulator plus isolated external Maven consumer project.

Result

Deterministic reproduction from a single replay token and readable HTML relay-lane timelines.

Screens

Testing

231 tests across JVM, JS (Node), macOS arm64 and iOS Simulator arm64, binary-compatibility apiCheck, mutation tests and isolated Maven consumer build.

4example sync engines with both passing implementations and caught seeded bugs
100%isolated Maven fresh-install check passing with HTML failure report output

Mutation testing caught two subtle gaps

Targeted mutation checks verified that replay tokens must respect disabled faults and failure fingerprints must include event details; both assertions were added to RunTest.kt and killed 2/2 mutations.

What I learned

What worked

  • Shrinking fault types rather than raw data values takes ~10 re-runs and points straight to the root cause.

What I underestimated

  • Keeping multiplatform compatibility tables accurate across JVM, JS and native targets requires verifying what Gradle actually executes rather than assumes.

What I’d do next

  • Publish 0.1.0 to Maven Central on approval and run Linux native tests in GitHub Actions.

Hiring graduates for 2027?

I’m looking for software engineering roles from August 2027, anywhere across the stack, and I’m happy to relocate.