{ "uuid": [ { "value": "60d29f19-7871-4b8e-a2e5-3bf7edf17c00" } ], "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:20+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": "Automated tests prevent you from adding regressions" } ], "created": [ { "value": "2024-02-02T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:20+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2024\/02\/02\/automated-tests-prevent-you-from-adding-regressions", "langcode": "en" } ], "body": [ { "value": "\n

Continuing from my last few emails<\/a>, as well as adding the new use case more easily and quicker, having automated tests also saved me from adding a regression into the code I was changing.<\/p>\n\n

I'd written a condition in the query to ensure only results that started with the search term.<\/p>\n\n

Initially, I removed it, but then the tests failed.<\/p>\n\n

This reminded me why I'd written the condition that way, and I was able to re-add my fix differently.<\/p>\n\n

Without the tests, I'd likely have removed it and introduced a regression.<\/p>\n\n

Whilst fixing a bug, I'd have introduced a different bug.<\/p>\n\n

My tests saved me from doing that and I was able to rectify it quickly before pushing to CI or the staging environment.<\/p>\n\n ", "format": "full_html", "processed": "\n

Continuing from my last few emails<\/a>, as well as adding the new use case more easily and quicker, having automated tests also saved me from adding a regression into the code I was changing.<\/p>\n\n

I'd written a condition in the query to ensure only results that started with the search term.<\/p>\n\n

Initially, I removed it, but then the tests failed.<\/p>\n\n

This reminded me why I'd written the condition that way, and I was able to re-add my fix differently.<\/p>\n\n

Without the tests, I'd likely have removed it and introduced a regression.<\/p>\n\n

Whilst fixing a bug, I'd have introduced a different bug.<\/p>\n\n

My tests saved me from doing that and I was able to rectify it quickly before pushing to CI or the staging environment.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "4da060af4834ea01bfde91a020ba0f5f", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }