Although you're already writing tests, you have an opportunity to use just-in-time design every time you refactor them.
The simplest tests assume a lot about the initial state of the system, which must be established each time to have valid results.
Use a shell script to reset the system to the correct initial state.
If too much time goes into resetting the system, refactor your tests to leave the system in the same state at the end of the tests as at the beginning.
Be aware of coupling you introduce between tests of different features.
To avoid inadvertent coupling between tests, imagine they're all executing simultaneously and refactor them to provide consistent results in that environment.