Apply TDD principles to everything - build the test first, make the goal to pass in a verifiable provable way, by checking output from an implementation - make it do this in a deterministic way eg test script or test case etc. Only then start implementation.
Make it standard behaviour for every pro...