Sometimes software is built “naturally”. By that I mean it is assembled with duct tape and chewing gum. For testing and prototyping this can be fine, but if you are building a production system, this is not the way.
When you glue together an application, this leads to tried and true problems:
There are great, well known solutions to these problems. Check out TDD to prevent reoccurring bugs, and architecture and design patterns to avoid spooky actions and maintain development performance.