Urgent.News

What's breaking now, across thousands of outlets.

Tech

Rewriting for Kotlin Multiplatform Without Changing Behavior: Old Code as a Test Oracle

I moved two small RSS reader apps and a space app to Kotlin Multiplatform so they could also run on iOS. That meant rewriting code that leaned on Android and Java classes. I did not want a single existing user to notice a difference, so I kept the old implementation in the test sources and made it argue with the new one. Here is how that went. What had to be rewritten Common Kotlin code cannot…

The author migrated two small RSS reader apps and a space app to Kotlin Multiplatform for iOS compatibility. Since iOS lacked the necessary Android and Java classes, the author preserved the old implementations in test sources, creating a "test oracle" for comparing the new and old code. The test fed the same XML to both parsers and checked if the results matched across six fields such as title, link, date, cover image, summary, and cleaned HTML.

The author identified issues like HTML entities being decoded twice and dates being parsed differently. To ensure the space app's daily card remained consistent, the author wrote a class replicating the java.util.Random algorithm for shuffling, keeping the sequence unchanged. The parity test covers specific inputs but does not guarantee correctness for future or unseen inputs.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Shipping an iPhone App Without a Mac: Kotlin Multiplatform, a Cloud Mac and TestFlight

I develop on Windows and I do not own a Mac, but I wanted my small Android game 2048 on the App Store. It turns out you do not need a Mac on your desk, only one in the cloud for a few minutes per…

  • Windows developer can ship iOS app via cloud-based solution
  • Kotlin Multiplatform, cloud Mac, and TestFlight used for development
  • Android and iOS shells are thin wrappers around shared Kotlin code

RAG Without a Second Database

Almost every RAG tutorial I read starts the same way. Take your documents, split them into chunks, embed them, and load the vectors into a vector database.

  • Author builds RAG system without second database.
  • PostgreSQL 16.15 and pgvector 0.8.0 used for setup.
  • HNSW index shows significant latency gap vs. exact scan.

Debugging an iPhone From Windows Over USB: Screenshots and Logs With Python

On Android, adb makes it easy to take a screenshot or read a log from a phone on your desk. I expected nothing like it for an iPhone on Windows, but there is a way: Apple's own driver package plus an…

  • Install Apple Devices app and Python 3 on Windows
  • Use pymobiledevice3 package to access iPhone from Windows
  • Filter log output by app process name for targeted debugging

App Store Screenshots Without a Phone: Robolectric, a Fake Image Loader and a Headless Browser

My iPhone apps share their screens with the Android versions, written once in Compose. App Store Connect wants screenshots at 1206x2622 pixels, and I work on a Windows laptop with no iPhone to spare…

  • Robolectric runs Android code on JVM for screenshot generation
  • Roborazzi saves bitmap images as PNG files for App Store Connect
  • Headless Edge renders WebView pages for accurate representation

More from Monday 16 November →