WriteDaily Migration Update: Test Coverage Complete, Approaching Production Switch

The WriteDaily Laravel migration I announced in April 2019 has been progressing steadily. Last month, we hit a key milestone: the test suite covers the core writing loop and sentiment analysis pipeline.

The Testing Strategy

I took a pragmatic approach — not 100% coverage on every model method, but complete coverage on the paths where data loss or corruption could occur:

Entry save pipeline. Tests verify that entries persist correctly, word counts are accurate, pace data records, and auto-save conflict detection works as expected. Edge cases covered: empty entries, entries with Unicode characters, entries exceeding the 750-word target.

Sentiment analysis pipeline. The LIWC parser is tested against known text samples with verified sentiment profiles. Cache hits and cache misses both covered. The serialisation round-trip (analyse → serialise → deserialise → display) passes consistently.

User authentication. Registration, login, password reset, and session management all covered. Sentry integration works as expected.

Data migration. The seed scripts that migrate existing user data from the raw-PHP schema to the Laravel schema have been tested against a full production snapshot. All 60,000+ entries survived the round trip with verified body checksums.

Test Results

PHPUnit 8.5
Tests: 87, Assertions: 214
OK (87 tests, 214 assertions)

Zero failures. The suite runs in under 10 seconds.

What Remains

A few items before the production switch:

  • Load testing. The new stack needs to handle concurrent auto-save requests at production volume. The old stack manages this with raw efficiency; the Laravel stack has more overhead from the ORM layer.
  • Cron job migration. The hourly pace evaluation and badge condition checks need to move to Laravel’s scheduler.
  • DNS and SSL cutover. The switch itself is a DNS update pointing to the new stack. I want zero-downtime, which means both stacks running in parallel during propagation.

Timeline

The current estimate: Q3 2020. The existing product continues to serve users at writedaily.co throughout. When the switch happens, it’ll be without disruption — same editor, same stats, new architecture underneath.

logo

I Create Reach.
I Generate Impact.
I Amplify.