<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6" -->

---
title: Why you shouldn't use AI to write your tests | daily.dev
description: The post discusses the reasons why using AI to write tests may not be valuable. It explores the benefits of different types of tests, such as unit tests,...
canonical: https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why you shouldn't use AI to write your tests | daily.dev
og:description: The post discusses the reasons why using AI to write tests may not be valuable. It explores the benefits of different types of tests, such as unit tests,...
og:url: https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6
og:image: https://api.daily.dev/og/posts/kVTbW4YS6.png
og:image:alt: Why you shouldn't use AI to write your tests
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why you shouldn't use AI to write your tests

**[swizec.com](https://daily.dev/sources/swizec)** · 4 min read · 16 upvotes · 4 comments

## Summary

The post discusses the reasons why using AI to write tests may not be valuable. It explores the benefits of different types of tests, such as unit tests, integration tests, and end-to-end tests. It also presents ideas for using AI in test writing, including fuzzing the app, translating acceptance criteria into tests, and letting AI generate code based on tests.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://swizec.com/blog/why-you-shouldnt-use-ai-to-write-your-tests/>

## Community discussion

Top comments from developers on daily.dev.

**@randy** · 10 upvotes

> Article is wrong on many levels. But to stick with the title, don’t let AI write tests, but let’s let it write production code? Umm. No.
>
> Also, “vertical ownership” is a seriously bad idea. What happens when a bug is found in production and the one guy that knows the code is out of the country with no access?
>
> Finally, as for tests finding bugs before they’re in production… yes, I’ve had it happen myself. And sure, I’ve also had bugs make it to production that could have been caught by “a test” or even “a better test.” But to act like tests never “catch bugs before production” is just naive.

---

Tags: [#ai](https://daily.dev/tags/ai), [#testing](https://daily.dev/tags/testing), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Why you shouldn't use AI to write your tests","url":"https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6"},"datePublished":"2024-05-25T16:14:34.684Z","dateModified":"2024-08-23T15:01:34.766Z","description":"The post discusses the reasons why using AI to write tests may not be valuable. It explores the benefits of different types of tests, such as unit tests,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a7d507eed98c367433ade3a814fa5ed0?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a7d507eed98c367433ade3a814fa5ed0?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"swizec.com","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"swizec.com","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/a0733daf6e014e23a638ded7f2d4cd70","url":"https://daily.dev/sources/swizec"},"commentCount":4,"discussionUrl":"https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":16},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"keywords":"ai,testing,typescript","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"swizec.com","item":"https://daily.dev/sources/swizec"},{"@type":"ListItem","position":3,"name":"Why you shouldn't use AI to write your tests"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/why-you-shouldn-t-use-ai-to-write-your-tests-kvtbw4ys6","comment":[{"@type":"Comment","text":"Article is wrong on many levels. But to stick with the title, don’t let AI write tests, but let’s let it write production code? Umm. No.\nAlso, “vertical ownership” is a seriously bad idea. What happens when a bug is found in production and the one guy that knows the code is out of the country with no access?\nFinally, as for tests finding bugs before they’re in production… yes, I’ve had it happen myself. And sure, I’ve also had bugs make it to production that could have been caught by “a test” or even “a better test.” But to act like tests never “catch bugs before production” is just naive.","datePublished":"2024-05-25T19:53:46.711Z","url":"https://daily.dev/posts/kVTbW4YS6#c-Ph0PKO3pn","author":{"@type":"Person","name":"Randy","url":"https://daily.dev/randy","image":"https://media.daily.dev/image/upload/s--UjV4-KkB--/f_auto/v1708097210/avatars/avatar_HXYbbGcBO38Rfv7RrCBdA"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":10}}]}
```

