May 28, 2023
The statement I was responding to said that adding a _unit test_ broke the code. Unit tests should not in any way be able to break the code they are testing.
But to answer you question, when I am changing functionality, I nearly always change the test first to reflect the new behavior (so I break the test before I change the code, and then the change in the behavior of the code fixes the test).