I’m not really a working as a test (automation) engineer any more, but would say earlier likely 70% writing new tests, 10% refactoring, 20% banging my head against a wall…
If these (probably more, hopefully others below can fill in my gaps), are in place, there shouldn’t be hardly any need to fix tests… fixing becomes largely with the SUT, integrated systems, SUT connectivity and/or environments
the tests have been written by trained specialists who have had enough time to understand the System Under Test & the requirements, receiving timely answers to as many questions to aid this
a structured and planned test data strategy complete with generation or restoration is in place
To be honest, i’d say that it is 20% writing new tests and 80% fixing the old ones, but it is caused by mainly by the environment (a lot of contractors delivering to a project that had a pretty long history meaning there were literally zero standards). Really curious about the experience of others.