There was a whole series of articles by Robert C. Martin (an editor of the now defunct C++ Report) and his colleagues at Object Mentor on how to structure code so that it is easy to extend, reuse and maintain, but the articles don't seem to be available on "public" sites anymore. You can explore some of them in a slightly more abstract form via
https://en.wikipedia.org/wiki/SOLID
He also put these together in a book "Agile Software Development: Principles, Patterns and Practices" but switching to Java for the example code. The whole point of these articles is that effort is required at the Design stage, with emphasis on Test Driven Development supported by UML diagrams.
You might also be interested in "Working Effectively with Legacy Code" by Michael C. Feathers (also of Object Mentor) in how to refactor existing code to make it more easily testable. You will need to be fluent in "Design Patterns" by Gamma, Helm, Johnson and Vlissides.
You might be able to find "The Humble Dialog Box" paper by Michael C. Feathers as a way of designing abstract interfaces for user interfaces.