How to leverage LLMs for writing technical documentation and unit tests

  Рет қаралды 743

COMMAND

COMMAND

Күн бұрын

Пікірлер: 12
@nicholasdelnegro6936
@nicholasdelnegro6936 4 ай бұрын
love it
@gothfather1
@gothfather1 3 ай бұрын
Thanks for sharing this interesting and helpful productivity tip! I'm a bit old school...I always start a large development project with documentation - conceptual, sequence, data relationship, activity and other diagrams (what documentation is applicable varies per case and complexity of what I'm building) and a summary of the highlights of the application. Then before I start writing code I document the classes, methods, etc. before I even write the logic. Then I start writing the code and I document as I go, never leaving it to the end as an afterthought. While coding, valuable things may come to your mind to be captured as documentation, that may be forgotten if not recorded right away. Unit tests I do very early in the development process. I prefer creating the unit test classes at least with empty methods stating "given/when/then" right after I'm done the functional class containing business logic. I like the idea of using AI to help document code which, for whatever reason is lacking in documentation. I also like the idea of AI helping write better unit tests and ensure a good amount of coverage is met. However, I don't think AI should be a substitution for writing meaningful unit tests and documentation. Copilot is a great option. Some companies are training AI to teach it their frameworks (industry and homegrown) in order to help developers write better code faster. I really hope people use it the right way and don't get lazy expecting AI to do the thinking for then. It is a tool and should not be a crutch. Cheers!
@cmd_labs
@cmd_labs 3 ай бұрын
An approach I think worthy of exploring would be to generate code from documentation instead of the other way around as shown in this video I've seen some other developers implementing this approach I appreciate the engagement Sending lots of love
@gothfather1
@gothfather1 3 ай бұрын
​​@@cmd_labsyou know what, that was possible using the old RationalRose software and others circa 2007. Haven't done that approach for a while; the tooling at work is a little constrained at the moment. However, generating good code from really good documentation is an excellent approach, and I think AI will immensely help for that! Of course, the code needs to be reviewed very thoroughly, PRs need to be manually reviewed and approved and testing is paramount, etc.
@QuadDrums
@QuadDrums 4 ай бұрын
This channels needs more viewers this content is great
@cmd_labs
@cmd_labs 4 ай бұрын
Appreciate it. Great to meet you @QuadDrums
@gothfather1
@gothfather1 3 ай бұрын
You went from being the "GG Allin of hip-hop" with the dadaist approach, to a technology expert in a few short years - very happy for your success and direction you've gone!
@cmd_labs
@cmd_labs 3 ай бұрын
Appreciate it
@prajwalpadole5558
@prajwalpadole5558 4 ай бұрын
could this llm model be integrated with own mern stack project if yes ,how ? can you give short idea really loved the content , appretaite it .
@cmd_labs
@cmd_labs 4 ай бұрын
Great to meet you @prajwalpadole5558! You can ABSOLUTELY integrate this technique with your MERN stack application... Create a folder called "scripts" at the root of your project and add a file inside called "gen_docs.py" or "gen_tests.py" (depending on what exactly what you want to do) If you already have a folder where you hold useful scripts related to developing your project then you can store the following scripts there too... I personally don't mind mixing programming languages within projects but if you want to stay consistent with Javascript/Typescript you can copy/paste the provided Python scripts to ChatGPT and have them rewritten in Javascript/Typescript for you. And then you'll be able to add files called "gen_docs.ts" or "gen_tests.ts" and copy/paste in the rewritten Javascript/Typescript code. Here are the 2 scripts showcased in the video... gen_docs script - github.com/Kalygo-io/kalygo3-ai-api/blob/main/scripts/gen_docs.py gen_tests script - github.com/Kalygo-io/kalygo3-ai-api/blob/main/scripts/gen_tests.py These 2 scripts have a simple API... 1) FOR THE "gen_docs" SCRIPT, you list the files that you want to document as well as the name of the generated documentation file... github.com/Kalygo-io/kalygo3-ai-api/blob/13a27062f6c29df7f3760a002fe4c6a2e0ca0e40/scripts/gen_docs.py#L59 Also you can tweak the prompt used for generating the documentation to your application... github.com/Kalygo-io/kalygo3-ai-api/blob/main/src/core/prompts/DOCUMENTATION_WRITER.py The "DOCUMENTATION WRITER" prompt is held in a separate file to not bloat the "gen_docs" script AKA you will want to edit the DOCUMENTATION writer to be specialized in Javascript/Typescript instead of Python 2) FOR THE "gen_tests" SCRIPT things are a bit trickier but generally similar to the "gen_docs" script. In the example shown in the video, you list each class you would like to generate unit tests for as well as the path where the class sits in your project github.com/Kalygo-io/kalygo3-ai-api/blob/13a27062f6c29df7f3760a002fe4c6a2e0ca0e40/scripts/gen_tests.py#L54 You can also tweak the prompt used for generating the unit tests as well... AKA you will want the TESTS_WRITER to be specialized in Javascript/Typescript and which test framework you are using aka Mocha or Jest etc. github.com/Kalygo-io/kalygo3-ai-api/blob/main/src/core/prompts/TESTS_WRITER.py Note how in this TESTS_WRITER prompt I include a lot of contextual information about the application in which the class to generate unit tests for sits As I mention in the video, I have found that the generate unit tests often times have bugs that need to be fixed If you are lazy you can just delete the lines of generated test code giving you issues. ALSO make sure you audit the generated unit tests to make sure they are not doing anything malicious : ) kzbin.info/www/bejne/jKWtfIR-pN6VaKMsi=xn6sOWZHyBFY7W8l&t=211 Did I miss anything? Let me know how it goes!
@gothfather1
@gothfather1 3 ай бұрын
Would you be adverse to me emailing you a few questions I was thinking of asking ? It is about your musical career. I don't want to impose and totally understand if you're not comfortable as I respect people's privacy. I simply don't want to post the questions on KZbin.
@cmd_labs
@cmd_labs 3 ай бұрын
@@gothfather1 go for it I have nothing to hide But yea at the same time each platform has its nuances
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 172 М.
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 247 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
CrewAI and AgentOps for beginners
30:38
COMMAND
Рет қаралды 1,1 М.
Meta drops new LLM based testing
32:28
ThePrimeTime
Рет қаралды 49 М.
How to create CUSTOM LLMs using OLLAMA
10:25
The Neural Maze
Рет қаралды 1,5 М.
CODE-LLAMA For Talking to Code Base and Documentation
14:49
Prompt Engineering
Рет қаралды 24 М.
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 369 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,6 МЛН
Generate unit tests with EarlyAI
19:16
Eddie Jaoude
Рет қаралды 11 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН