How do you write and maintain automated test scripts to ensure new features do not break existing functionality?