1. Find some known-good code you trust and measure coverage. 2. Find a few missing coverage lines. 3. Write tests. 4. Find bugs!
Related Posts
When writing long-lived programs (daemons etc) in Rust, I find myself asking *where* I should put data.
In a GC'd language it's just "I have a string" but Rust forces me to find somewhere to put it.
You do get a performance benefit for this work though.
It's really satisfying to use a profiler for the first time on a project. I always find a big performance win with only a small code change.
It's never the code that I expected to be slow, however!
Over a sufficiently long time horizon, all code you write is legacy code.