Hacker News new | ask | show | jobs
by trollbridge 20 days ago
LLMs/agents are a great way to create a test harness for something like that.
2 comments

This was my approach to a large rewrite I'm working on. First create the multiple layers of test suite to map out existing behavior at the unit, API, and integration level (something that should have been done incrementally over the 20 years this software has existed), then predicate the new code on the tests. It's been remarkably effective.
I plan to eventually get there, just need to find the time. It’s a lot of code, and a lot of it is not set up for testability.
To start the transition you can build your own tooling, in this case maybe start with the whole app stack including browser in an emulator, emulator controlled over a socket (write a harness that exposes all the inner debuggers, framebuffer, snapshotting, etc). Then generate a component inventory and likely failures for each, and generate pixel-perfection + internal state checks for each. Then migrate one component out (this may be quite a large project due to all the glue you'll need to make this possible). Then do the rest one at a time.

The big problem with doing it this way is you end up with something structurally the same as what you started with, but potentially more code if you e.g. end up carrying your own reimplementation of Web Forms.

Tell the agent to work on it and then give you summaries of code coverage, progress, and so on. It doesn't need to take up much of your time.