Add daily email for 2024-10-20
Test, then refactor
This commit is contained in:
parent
770bcb88d0
commit
e3ce9e2d78
1 changed files with 25 additions and 0 deletions
25
source/_daily_emails/2024-10-20.md
Normal file
25
source/_daily_emails/2024-10-20.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
title: Test, then refactor
|
||||
date: 2024-10-20
|
||||
permalink: daily/2024/10/20/test-then-refactor
|
||||
tags:
|
||||
- software-development
|
||||
- refactoring
|
||||
- test-driven-development
|
||||
- automated-testing
|
||||
cta: ~
|
||||
snippet: |
|
||||
Do you make sure you have automated tests before you refactor?
|
||||
---
|
||||
|
||||
[Whether you prefer PHPUnit or Pest PHP][0], or if you're coding in a different language, it's important to have automated tests - especially before you refactor any code.
|
||||
|
||||
Before you refactor, you want to have passing tests that you're confident cover all the required functionality.
|
||||
|
||||
When you finish refactoring, the tests should still pass.
|
||||
|
||||
Then you know the functionality is the same and the code still works after it's been refactored.
|
||||
|
||||
If you don't have tests, how do you know everything still works, or how likely are you to do the refactor at all?
|
||||
|
||||
[0]: {{site.url}}/daily/2024/10/19/phpunit-or-pest
|
Loading…
Add table
Add a link
Reference in a new issue