← Graph

Rewrite with confidence

talk 28 connections

Szymon Fiedler's wroclove.rb 2025 talk. Describes a three-month project at Lemonade (with Arkency) to replace the legacy HO4 renters-insurance quoting flow without breaking parity. Constraints: no UX regression, tight timeline, and business rules embedded in a years-old Rails monolith with sparse documentation and original authors gone. Methodology: treat existing system behavior as a specification; instead of writing full test coverage for dozens of microservices, sample 1–2% of production quotes, snapshot the quote model before/after underwriting, and record all HTTP interactions via Typhoeus callbacks (and a Net::HTTP override for AWS/S3). A verifier runs the new flow inside an ActiveRecord transaction that is always rolled back, stubs the recorded HTTP calls, blocks all other outgoing HTTP requests, and diffs the resulting quote against the old one (excluding ids/timestamps via an 'invariable_attributes' list). Background jobs are guarded with an after-commit wrapper so no side effects leak; thread-safety ensured under Unicorn with concurrent-ruby tasks forced inline. Sample collection and verification are decoupled to allow iterative polishing. The project shipped a gradual feature-flag rollout with no rollbacks; project leader 'Gaya' praised it as one of the best releases he had experienced.

date
2025-03-14
type
talk
duration_project
3 months
talk Rewrite with confidence
about
Lemonade company
The case study is the rewrite of Lemonade's US renters-insurance quoting/underwriting flow.
talk Rewrite with confidence
about
Scope of the rewrite narrowed to the HO4 renters product line.
talk Rewrite with confidence
about
Core process validated by the methodology was automated underwriting.
talk Rewrite with confidence
about
Insurance Quote concept
The quote model was the central data structure snapshotted before and after the underwriting process.
talk Rewrite with confidence
about
Lemonade's codebase is a Rails monolith; the rewrite work took place inside it.
talk Rewrite with confidence
about
Typhoeus tool
Used Typhoeus's completion callbacks to record HTTP calls and its stubbing API to block/replay traffic.
talk Rewrite with confidence
about
Net::HTTP tool
AWS SDK uses Net::HTTP directly; the team overrode its behavior in Ruby to handle S3 downloads while blocking other traffic.
talk Rewrite with confidence
about
AWS SDK (Net::HTTP-based) required a separate override strategy.
talk Rewrite with confidence
about
Unicorn tool
Thread-safety of the dynamic HTTP overrides relied on Unicorn's process-per-request model.
talk Rewrite with confidence
about
Concurrent-ruby tasking objects were forced inline inside the verification block to keep everything in one process.
talk Rewrite with confidence
about
Sentry tool
Team ignored Sentry exclusions during sample recording so any weirdness would surface.
talk Rewrite with confidence
about
Active Record concept
Persistence model and transaction semantics (after-commit, rollback) are core to the verification flow.
talk Rewrite with confidence
about
Cited as one place inside Arkency where the after-commit transaction pattern lived before Rails 7.2 introduced it.
talk Rewrite with confidence
about
Monkey Patching concept
Uses Ruby meta-programming / prepend to inject sampling and to override Net::HTTP behavior.
talk Rewrite with confidence
about
Uses Module#prepend to safely overwrite underwriting entry points inside Chat::Quotes.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
asked_at
Rewrite with confidence talk
Asked during the talk's Q&A.
authored
Rewrite with confidence talk
Szymon presented this talk at wroclove.rb 2025.
from_talk
Rewrite with confidence talk
Core methodology presented in the talk.
from_talk
Rewrite with confidence talk
Architectural split of the verification pipeline explained in the talk.
from_talk
Rewrite with confidence talk
Key implementation detail of the on-production verification flow.
from_talk
Rewrite with confidence talk
Takeaway emerged from the Q&A with an audience member.
talk Rewrite with confidence
presented_at
Single-track Ruby conference where the talk was delivered on 2025-03-14.

Provenance

Created
2026-04-17 16:18 seed
Read by
20 extractions