WEBVTT

1
00:00:01.319 --> 00:00:07.920
So we got these slash commands slash doc for example could be used to generate comments

2
00:00:07.920 --> 00:00:14.800
documentation for the selected code but slash tests is another interesting command which

3
00:00:14.800 --> 00:00:21.020
I want to explore here now because as you can also see here you can use this command

4
00:00:21.020 --> 00:00:28.640
to generate unit tests for the selected code and it turns out that AI is really good when

5
00:00:28.600 --> 00:00:37.860
it comes to generating unit tests now if I run slash tests here I could again add more

6
00:00:37.860 --> 00:00:44.420
information if I were looking for specific kinds of tests or if I only wanted to test

7
00:00:44.420 --> 00:00:51.060
something very specific but you can also just run it like this and let the AI figure out

8
00:00:51.080 --> 00:00:59.460
which tests to write and what's really convenient here is that it will then go ahead and show

9
00:00:59.460 --> 00:01:07.380
you which tests it wants to generate here and you see these are the unit tests it would

10
00:01:07.380 --> 00:01:14.400
suggest for this specific function and we could now accept this and it did actually

11
00:01:15.440 --> 00:01:22.720
add them in a new file a new file which I now have to save in a project like db backup

12
00:01:23.319 --> 00:01:31.000
test for example so it's also smart enough to understand that I probably don't want

13
00:01:31.000 --> 00:01:36.540
to add the unit tests in the same file as my main application code but that I instead

14
00:01:36.540 --> 00:01:42.880
want to have them in a separate file like this and that's there for another pretty

15
00:01:42.800 --> 00:01:50.840
useful feature because writing tests is important but can be annoying some developers absolutely

16
00:01:50.840 --> 00:01:56.780
don't want to do it and it turns out that AI is pretty good at that task because of

17
00:01:56.780 --> 00:02:02.920
course it got the application code as very useful context and therefore in many cases

18
00:02:02.920 --> 00:02:09.320
it's able to figure out and write decent tests so that you have all the tests without

19
00:02:09.360 --> 00:02:11.720
going through the effort of writing them manually

