oliverdavies.uk/content/node.9d57dff8-de30-4e32-8278-c5a947ef8c25.yml

73 lines
2.9 KiB
YAML

uuid:
- value: 9d57dff8-de30-4e32-8278-c5a947ef8c25
langcode:
- value: en
type:
- target_id: daily_email
target_type: node_type
target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7
revision_timestamp:
- value: '2025-05-11T09:00:30+00:00'
revision_uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
revision_log: { }
status:
- value: true
uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
title:
- value: |
TDD: repeat and refactor
created:
- value: '2023-10-01T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:30+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2023/10/01/tdd--repeat-and-refactor
langcode: en
body:
- value: |
<p>With test-driven development, you start with a failing test and focus on getting it to pass.</p>
<p>But what do you do once it's passing?</p>
<p>You either repeat the process, adding more assertions to the same test until you generate the next failure or write the next failing test, or take the opportunity to refactor the code.</p>
<p>Is there something you'd like to change within the implementation or test code? You can do that whilst the tests are passing.</p>
<p>You may want to extract a new class or method to improve the implementation or create some test helpers to reduce duplication within the tests.</p>
<p>You just need to keep the tests passing to ensure the code still works. If something breaks, you fix it as soon as possible, either by fixing the code or reverting to the previously passing code.</p>
<p>Then, once you've completed the refactoring, move back into the red/green phase with the next test failure.</p>
format: full_html
processed: |
<p>With test-driven development, you start with a failing test and focus on getting it to pass.</p>
<p>But what do you do once it's passing?</p>
<p>You either repeat the process, adding more assertions to the same test until you generate the next failure or write the next failing test, or take the opportunity to refactor the code.</p>
<p>Is there something you'd like to change within the implementation or test code? You can do that whilst the tests are passing.</p>
<p>You may want to extract a new class or method to improve the implementation or create some test helpers to reduce duplication within the tests.</p>
<p>You just need to keep the tests passing to ensure the code still works. If something breaks, you fix it as soon as possible, either by fixing the code or reverting to the previously passing code.</p>
<p>Then, once you've completed the refactoring, move back into the red/green phase with the next test failure.</p>
summary: null
field_daily_email_cta: { }