Professionally, I regularly work with ZPL (Zebra Programming Language) for clients. However, testing software that ultimately communicates with real label printers is not entirely trivial - especially when automated tests also need to take device status into account.
A state like „paper empty“ can still be provoked relatively easily on real hardware. But when it comes to things like overtemperature, that becomes rather impractical.
Until now, I had a Python script for this that could simulate various responses and states of a printer. That worked, but it had one crucial drawback: it didn't render labels. Of course, I know and use Labelary as a ZPL renderer, but sending test data for every automated test to an external service is a no-go when it comes to client data.
I had therefore had the idea of my own ZPL emulator in the back of my mind for over a decade.
There's a huge hype surrounding the current top AI models. That's why I was interested in what's actually possible when you deliberately avoid the large and comparatively expensive models.
The idea for ZplPrinterPro was therefore also an experiment: How far can you get with an inexpensive open-source model when you combine it with rather classic software development methods?
So: Test Driven Development, the most precise specifications possible, and unit tests – a great many unit tests.
As the inference provider, I deliberately chose against Anthropic and OpenAI. Instead, DeepSeek V4 Flash was used via airouter.ch.
As the coding harness, I used Oh My Pi together with the plugins Ponytail and Superpowers. The model also received the ZPL Programming Guide directly as a reference. In addition, there were some ZPL test cases in which the rendered result had to hold its own against Labelary.
So the AI wasn't simply supposed to „write a ZPL renderer somehow“, but rather had a specification, a reference implementation, and above all tests that it could use as a guide.
After just over a week, the result actually surprised me quite a bit.
Of course, the renderer isn't 100 percent identical to a real Zebra printer or Labelary. Simply by using different fonts, a certain delta is inevitable. There were and are also implementation errors and bugs, and you're welcome to open an issue on GitHub about them.
But their number remained surprisingly limited.
What I actually found even more interesting was something else: The project once again demonstrated very nicely how many errors can be found through consistent automated testing – regardless of whether the code was written by a human or an AI model.
A good example was the barcodes. There were rendering issues there that ultimately had to do with padding. Thanks to the existing tests, the AI model was able to narrow down the deviations independently, find the cause, and then fix it.
And that's exactly the most interesting insight I've gained from the experiment so far:
Perhaps what matters for AI-assisted software development isn't just how intelligent or expensive the model is. At least equally important is how well we build the environment in which it works.
A comprehensive specification, small verifiable steps, TDD, and a large number of good unit tests are classic software engineering tools. In combination with current, inexpensive open-source models, however, they seem to enable an astonishing amount.
If you'd like to take a look at the result: ZplPrinterPro on GitHub