Testing is the documentation that shows you know what you’re doing. With enough assertions and expectations, it is obvious to the person who you’re looking to to help you what you thought the code should be doing. When it doesn’t do what you think it should, and there’s nothing for me to understand what you thought the outcome should be - I can’t help you.
A cook who isn’t working from a recipe asks the head chef why his dish turned out so wrong. The chef asks “what is the recipe?” If there are no inputs to the outputs, then all we are left with is the product: a bad meal. My best course of advice is to use a recipe next time. I can’t save what you are about to deliver to the customer unless we throw it away and start with some verifiable approach.