2024-06-04 18:22:58 +00:00
|
|
|
---
|
|
|
|
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:
|
2024-09-08 22:09:54 +00:00
|
|
|
- software-development
|
|
|
|
- automated-testing
|
2024-06-04 18:22:58 +00:00
|
|
|
cta: testing_course
|
|
|
|
snippet: |
|
2024-09-08 22:09:54 +00:00
|
|
|
Do you rely on AI tools to write your automated tests?
|
2024-06-04 18:22:58 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
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
|