I wrote tests to make sure the code before and after the refactoring produced the same results. The tests are not perfect, and I don't consider them as a product of my work to be shipped with the refactored code. Rather, they were a tool that enabled me to work faster and more safely.
As the code was tightly coupled to the GUI and the I/O (writing files rather than returning data), I had to write end-to-end tests that simulate mouse input and check the resulting files. On the time budget that I allowed myself, I couldn't get pytest-qt
to work on the lab's machines, and ended up running the test on my own machine, which is not Ubuntu based. Since pytest-qt
simulates mouse input, the tests are tightly coupled to the window's size and my screen resolution, they are platform dependent, machine dependent, and require significant setup to be run on another machine.
I found no easy way to make the tests sufficiently robust to be useful for everyone. They break often for reasons independent from t