4 ms·
Main benefit is it does boilerplate really well. You type a few letters and then hit tab, and now your test case is done. I did this as late as yesterday. Type
by lordnacho 3y ago
Main benefit is it does boilerplate really well. You type a few letters and then hit tab, and now your test case is done.
I did this as late as yesterday. Type in a case, type in a variant of the case that is more or less symmetric, it fills in what you would have typed. Or you add a member to your object, thus requiring it to be tested. It figures out that you need to check this new thing in all your tests.
Other thing it does well is syntax. Some weird c++ template parameter thing, it does it for you. Little things like "what's that thing that makes the sort go the other way" it will know, and save you a minute of googling.
What there doesn't seem to be is an interface for that I've found is any kind of refactoring. That's still a form of donkey work that a junior guy can do, but you'd think there would be some way for the AI to suggest DRY candidates and re-orgs.
- valenterry 3y agoI find that to be true as well. It's just that boilerplate is usually an indication of a bad design or a bad/verbose language. Both of it are painpoints that should be fixed. But if that's not possible then Copilot is a good helper.
- jezzamon 3y agoAn alternative idea is that some types of "boilerplate" can be annoying to write but actually helpful for people to read, and these tools might make that type of code more acceptable. For example, it's helpful to be able to see all the steps a test case is doing in the one function, so you can read that and see what's going wrong if it fails. If a lot of your test cases are similar you might be tempted to refactor and put common parts in separate methods, often with unhelpful names like "assertResult()", etc, but now the reader has to jump about to understand the logic. Whereas this allows you to write the more repetitive but also more readable code easier