From 7a8a9703ea1744f2801cec2e3b5cb542eccfa603 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 4 Jun 2024 19:22:58 +0100 Subject: [PATCH] Add daily email for 2024-06-01 Don't use AI to write your automated tests --- source/_daily_emails/2024-06-01.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 source/_daily_emails/2024-06-01.md diff --git a/source/_daily_emails/2024-06-01.md b/source/_daily_emails/2024-06-01.md new file mode 100644 index 00000000..ba1d094a --- /dev/null +++ b/source/_daily_emails/2024-06-01.md @@ -0,0 +1,29 @@ +--- +title: Don't use AI to write your automated tests +date: 2024-06-01 +permalink: daily/2024/06/01/dont-use-ai-to-write-your-automated-tests +tags: + - software-development + - automated-testing +cta: testing_course +snippet: | + Do you rely on AI tools to write your automated tests? +--- + +In [yesterday's email][0], 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. + +[0]: {{site.url}}/daily/2024/05/31/putting-glue-on-pizza