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: |
In yesterday's email, I mentioned some of the recent issues I've seen from AI tools.
I'm wary of any code generated by AI, as I've often found it to be incorrect.
If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.
Automated tests verify your application works as expected, so you need to ensure they are testing the correct things and the logic is correct.
Can you make a test purposely fail by changing some logic within the test or implementation code?
Is it clear what each test is doing?
Are the tests running the implementation code or just testing mocks or running meaningless assertions like self::assertTrue(TRUE)
?
Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.
format: full_html processed: |In yesterday's email, I mentioned some of the recent issues I've seen from AI tools.
I'm wary of any code generated by AI, as I've often found it to be incorrect.
If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.
Automated tests verify your application works as expected, so you need to ensure they are testing the correct things and the logic is correct.
Can you make a test purposely fail by changing some logic within the test or implementation code?
Is it clear what each test is doing?
Are the tests running the implementation code or just testing mocks or running meaningless assertions like self::assertTrue(TRUE)
?
Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.
summary: null field_daily_email_cta: { }