3 ms·
I love it for writing tests. It’s good at picking up patterns, so if I need a bunch of unit tests then I can usually write one test and let it write the rest ba
by actsasbuffoon 4y ago
I love it for writing tests. It’s good at picking up patterns, so if I need a bunch of unit tests then I can usually write one test and let it write the rest based on the RSpec descriptions.
I recently had a ticket that required refactoring some code that used net::http from Ruby’s stdlib over to using the HTTP gem. The rewrite was pretty easy to do by hand, but we had a bunch of test cases and rewriting them proved to be a bit painful because the mocks required were quite different.
So I spent half an hour rewriting the first test case with the new shape of mocks. Then I commented out the remaining tests and the AI recognized what I was doing and rewrote the remaining test cases with the new mock structure in seconds.
I treat AI like a junior programmer. I don’t trust it to do the hard stuff, but it’s great for scenarios where I have already established the pattern and I just need someone with basic coding proficiency to apply that pattern to a large chunk of code. It’s amazing at doing the grunt work.