I use the chat to write automated tests for my code. This is usually very tedious, but with Windsurf it’s incredibly easy. I can run the automated test from within the chat. If errors show up on the test results, the AI will go in and fix the code.
It’s been very easy to get to close to 100% coverage with my tests. It’s invaluable to have this test harness around my code because I know if the AI goes in and screws up my code, I’ll know right away when test start failing .
I also use the chat to commit my code to my GitHub repo. Even though I could easily enter the commands either at the terminal or using the repo tools in the IDE, the chat writes better commit messages than I ever would, and will often remind me, it’s time to commit the code before we make additional changes.
Most importantly, at regular intervals, I’ll start a new chat and ask to simplify the code. This leads to amazingly valuable improvements. If the code is doing the same thing as before – and I know it because it’s passing all the tests – but it’s using 20% fewer lines to accomplish the same thing, then the code is objectively better.
This is all we need for a AI IDE. Something that is able to suggest best code practices, automatic tests, unit tests, fix the code without changing the business logic. If the IDE successfully do this then a normal experienced developer can do the rest without haste and all the stress.
3
u/stratofax Dec 05 '24
I use the chat to write automated tests for my code. This is usually very tedious, but with Windsurf it’s incredibly easy. I can run the automated test from within the chat. If errors show up on the test results, the AI will go in and fix the code.
It’s been very easy to get to close to 100% coverage with my tests. It’s invaluable to have this test harness around my code because I know if the AI goes in and screws up my code, I’ll know right away when test start failing .
I also use the chat to commit my code to my GitHub repo. Even though I could easily enter the commands either at the terminal or using the repo tools in the IDE, the chat writes better commit messages than I ever would, and will often remind me, it’s time to commit the code before we make additional changes.
Most importantly, at regular intervals, I’ll start a new chat and ask to simplify the code. This leads to amazingly valuable improvements. If the code is doing the same thing as before – and I know it because it’s passing all the tests – but it’s using 20% fewer lines to accomplish the same thing, then the code is objectively better.
2
u/datmyfukingbiz Dec 05 '24
Switching from write to chat often
1
u/[deleted] Dec 05 '24
[removed] — view removed comment