oliverdavies.uk/content/node.792953b8-b5f7-44dc-8e32-d70629bf06a4.yml

68 lines
2.7 KiB
YAML

uuid:
- value: 792953b8-b5f7-44dc-8e32-d70629bf06a4
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:01+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: 'Writing more tests than production code'
created:
- value: '2025-02-08T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:01+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2025/02/08/more-tests
langcode: en
body:
- value: |
<p>As well as <a href="/daily/2025/02/07/less">having less code than you started with</a>, another good type of change is one where there are tests accompanying the production code.</p>
<p>Whether the tests were written after the code or before with a test-driven development approach, the main thing is that there are tests when the code is committed.</p>
<p>There should also be more test code than production code.</p>
<p>There is only one implementation of the production code, but there should be multiple tests for it.</p>
<p>There should be different tests for different situations, such as different types of input and no input, testing for throwing Exceptions and other failure cases and not just the "happy path".</p>
<p>Looking at the diff of a commit or merge request, there should be more changes to the test then the code it's testing.</p>
format: full_html
processed: |
<p>As well as <a href="/daily/2025/02/07/less">having less code than you started with</a>, another good type of change is one where there are tests accompanying the production code.</p>
<p>Whether the tests were written after the code or before with a test-driven development approach, the main thing is that there are tests when the code is committed.</p>
<p>There should also be more test code than production code.</p>
<p>There is only one implementation of the production code, but there should be multiple tests for it.</p>
<p>There should be different tests for different situations, such as different types of input and no input, testing for throwing Exceptions and other failure cases and not just the "happy path".</p>
<p>Looking at the diff of a commit or merge request, there should be more changes to the test then the code it's testing.</p>
summary: null
field_daily_email_cta: { }