<p><a href="/daily/2024/10/19/phpunit-or-pest">Whether you prefer PHPUnit or Pest PHP</a>, or if you're coding in a different language, it's important to have automated tests - especially before you refactor any code.</p>
<p>Before you refactor, you want to have passing tests that you're confident cover all the required functionality.</p>
<p>When you finish refactoring, the tests should still pass.</p>
<p>Then you know the functionality is the same and the code still works after it's been refactored.</p>
<p>If you don't have tests, how do you know everything still works, or how likely are you to do the refactor at all?</p>
<p><a href="/daily/2024/10/19/phpunit-or-pest">Whether you prefer PHPUnit or Pest PHP</a>, or if you're coding in a different language, it's important to have automated tests - especially before you refactor any code.</p>