AI tools have become a regular part of my daily workflow as a developer. In this article, I want to share a few use cases that show how I use them — from generating code to writing documentation and tests. These tools don’t replace me as a programmer, but they definitely make some parts of my job faster and more enjoyable.
Generating Code
I use Windsurf and GitHub Copilot almost every day. Of course, I don’t let AI write all my code — not even close. Most of the time, I still like to write logic myself. But for small, repetitive tasks where I already know what I need, I usually let the AI take over.
Here’s an example. In one of my personal projects, I needed a simple function to format a string into a clean slug. It needed to remove whitespaces and punctuation like colons and commas, strip any trailing dots or exclamation marks, and convert everything to lowercase. This kind of task is perfect for Copilot because it’s great with regex and text manipulation.
export function getCleanIdForHeading(text: string) {
return text
.replace(/\s+/g, '-')
.replace(/[;:(),]/g, '')
.replace(/[\?\!\.]+$/, '')
.toLowerCase();
}
Sure, anyone could write this in five minutes after some quick Googling — but it took me maybe one minute to phrase the prompt and get a working result. That’s the real value for me: saving time on the mechanical stuff so I can focus on more complex problems.
Of course, I still double-check everything. I review and test any AI-generated code (both manually and with unit tests) before I commit it. It’s still my code at the end of the day.
Explaining Code
This is one of the areas where AI really shines. We’re all working with bigger and more complex codebases now — there’s just no way to fully understand every part of them. When I’m dropped into unfamiliar code, I often ask Windsurf or Copilot to explain what’s happening in plain language.
It’s surprisingly good at doing this — not just at describing what a function does, but also at explaining why a certain pattern or approach was used. This helps me understand code faster and reduces the friction of onboarding to new projects or technologies.
Generating test data
Here’s another small but really practical use case: generating test data.
Let’s say you have an API endpoint that expects a list of objects (for example, StatisticsDTO).
package com.example.demo.dto;
import java.time.LocalDateTime;
public record StatisticsDTO(
long totalCount,
double averageValue,
double minValue,
double maxValue,
LocalDateTime generatedAt
) {}
Normally, you’d have to manually write the JSON for testing in Postman or some other tool. Instead, I just ask the AI to generate a few test examples for me. It’s a small convenience, but if you need large or complex test datasets, it can save a surprising amount of time and effort.
Writing documentation
AI has also made writing documentation a lot less painful. Since coding agents are great at reading and understanding code, they’re pretty good at generating documentation for it too.
I mostly use it for in-code documentation — things like JSDoc or JavaDoc comments — but sometimes also for more structured documentation like API docs, GitHub readmes, or architectural summaries. It’s not perfect, but it gives you a solid first draft that you can refine rather than starting from scratch.
Writing tests
Tests are another area where AI tools come in handy. Once you know the cases you want to cover, prompting the AI to generate some quick unit tests can save a bunch of time. Refering to the piece of code I provided as an example before, it only took me a couple of seconds to generate some unit test with AI for it.
export function getCleanIdForHeading(text: string) {
return text
.replace(/\s+/g, '-')
.replace(/[;:(),]/g, '')
.replace(/[\?\!\.]+$/, '')
.toLowerCase();
}
With small functions, this might not look like a huge time saver. But when you need to write dozens or hundreds of similar test cases, it really adds up.
describe('getCleanIdForHeading', () => {
it('should replace spaces with hyphens and remove punctuation', () => {
expect(getCleanIdForHeading('Hello, World!')).toBe('hello-world');
expect(getCleanIdForHeading('Test: Heading (Example)?')).toBe('test-heading-example');
expect(getCleanIdForHeading('Another Heading.')).toBe('another-heading');
});
it('should lowercase the result', () => {
expect(getCleanIdForHeading('UPPER CASE')).toBe('upper-case');
});
});
Something I’ve also been experimenting with is using AI for test-driven development (TDD). The idea is to write your tests first, then prompt the AI to implement the function until all tests pass. I heard about this approach on The Pragmatic Engineer podcast — haven’t used it a lot yet, but it seems like a cool workflow to try if you like TDD.
Non-Technical Uses of AI
Besides coding, I also use AI for other work stuff — like writing user documentation, preparing internal announcements, creating presentations, or even generating images. These aren’t strictly “developer tasks,” but depending on your role, they often come up. Having AI help with them just makes life easier.
Final thoughts
AI has really become part of my everyday toolkit as a developer. It helps me code faster, learn new systems more quickly, and take care of repetitive tasks so I can focus on the creative side of building software.
That said, I still think all AI-generated code should be reviewed and tested carefully before it goes anywhere near production. Used responsibly, AI doesn’t replace developers — it makes us more efficient and gives us more time to focus on the fun parts of the job.
