Developer Moves Android RSS Reader to Kotlin Multiplatform Using Old Code as a Test Oracle
A developer ported two small RSS reader apps and a space app to Kotlin Multiplatform so they could run on iOS, replacing Android and Java-specific classes. To avoid silent behavior changes, the original implementation was kept in the Android test sources and compared against the new shared code. A test parses the same feeds with both parsers and compares titles, links, dates, images, summaries and cleaned HTML field by field. Because the old parser depended on Android-specific behavior, the developer also had to reimplement HTML entity decoding, which needed double-decoding and a hand-built table of named entities. Date parsing was rewritten with a regular expression and kotlinx-datetime, and the space app's shuffle was reproduced by replicating java.util.Random exactly so daily cards stay unchanged.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in