{ "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": "\n

In yesterday's email<\/a>, I mentioned some of the recent issues I've seen from AI tools.<\/p>\n\n

I'm wary of any code generated by AI, as I've often found it to be incorrect.<\/p>\n\n

If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.<\/p>\n\n

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>\n\n

Can you make a test purposely fail by changing some logic within the test or implementation code?<\/p>\n\n

Is it clear what each test is doing?<\/p>\n\n

Are the tests running the implementation code or just testing mocks or running meaningless assertions like self::assertTrue(TRUE)<\/code>?<\/p>\n\n

Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.<\/p>\n\n ", "format": "full_html", "processed": "\n

In yesterday's email<\/a>, I mentioned some of the recent issues I've seen from AI tools.<\/p>\n\n

I'm wary of any code generated by AI, as I've often found it to be incorrect.<\/p>\n\n

If you rely on AI-generated code, I'd be especially wary if it also generates the automated tests.<\/p>\n\n

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>\n\n

Can you make a test purposely fail by changing some logic within the test or implementation code?<\/p>\n\n

Is it clear what each test is doing?<\/p>\n\n

Are the tests running the implementation code or just testing mocks or running meaningless assertions like self::assertTrue(TRUE)<\/code>?<\/p>\n\n

Writing tests is about building confidence, which you can't do if you don't know what your tests are testing or how.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "9270caa76092aa60451a52a5d428601a", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }