Re:GitHub Copilot X: The AI-powered developer experience
by thornewolf on Wednesday March 22, 2023 @02:02PM
(#35264818)
Testing best practices have the opposite philosophy for the most part. Avoid abstraction as much as possible. Do repeat yourself. Because a bug in tests is insidious, so you want to minimize that. One of the best ways to minimize bugs is to explicitly avoid abstraction.
Re:GitHub Copilot X: The AI-powered developer experience
by adambard on Wednesday March 22, 2023 @01:59PM
(#35264765)
Oh shit, you're right, I forgot about loops. Guess I'll go uninstall copilot now.
Re:GitHub Copilot X: The AI-powered developer experience
by simonw on Wednesday March 22, 2023 @02:44PM
(#35265430)
Copilot helps me write parametrized unit tests. You might find this example useful: https://til.simonwillison.net/gpt3/writing-test-with-copilot
Isn't this something we've built into every modern language(and arguably the entire point of languages)? If you have multiple pieces of code that share code with tweaks(to test this or that case for example), shouldn't you parameterize the bulk of the code instead of getting autocomplete to parameterize it for you and dump it into your source file multiple times?