76 lines
2.9 KiB
YAML
76 lines
2.9 KiB
YAML
uuid:
|
|
- value: 759bb289-07cd-4103-bc90-107b7f13978d
|
|
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:12+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: "Don't use AI to write your automated tests"
|
|
created:
|
|
- value: '2024-06-01T00:00:00+00:00'
|
|
changed:
|
|
- value: '2025-05-11T09:00:12+00:00'
|
|
promote:
|
|
- value: false
|
|
sticky:
|
|
- value: false
|
|
default_langcode:
|
|
- value: true
|
|
revision_translation_affected:
|
|
- value: true
|
|
path:
|
|
- alias: /daily/2024/06/01/dont-use-ai-to-write-your-automated-tests
|
|
langcode: en
|
|
body:
|
|
- value: |
|
|
<p>In <a href="/daily/2024/05/31/putting-glue-on-pizza">yesterday's email</a>, I mentioned some of the recent issues I've seen from AI tools.</p>
|
|
|
|
<p>I'm wary of any code generated by AI, as I've often found it to be incorrect.</p>
|
|
|
|
<p>If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.</p>
|
|
|
|
<p>Automated tests verify your application works as expected, so you need to ensure they are testing the correct things and the logic is correct.</p>
|
|
|
|
<p>Can you make a test purposely fail by changing some logic within the test or implementation code?</p>
|
|
|
|
<p>Is it clear what each test is doing?</p>
|
|
|
|
<p>Are the tests running the implementation code or just testing mocks or running meaningless assertions like <code>self::assertTrue(TRUE)</code>?</p>
|
|
|
|
<p>Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.</p>
|
|
|
|
|
|
format: full_html
|
|
processed: |
|
|
<p>In <a href="http://default/daily/2024/05/31/putting-glue-on-pizza">yesterday's email</a>, I mentioned some of the recent issues I've seen from AI tools.</p>
|
|
|
|
<p>I'm wary of any code generated by AI, as I've often found it to be incorrect.</p>
|
|
|
|
<p>If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.</p>
|
|
|
|
<p>Automated tests verify your application works as expected, so you need to ensure they are testing the correct things and the logic is correct.</p>
|
|
|
|
<p>Can you make a test purposely fail by changing some logic within the test or implementation code?</p>
|
|
|
|
<p>Is it clear what each test is doing?</p>
|
|
|
|
<p>Are the tests running the implementation code or just testing mocks or running meaningless assertions like <code>self::assertTrue(TRUE)</code>?</p>
|
|
|
|
<p>Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.</p>
|
|
|
|
|
|
summary: null
|
|
field_daily_email_cta: { }
|