Hacker News new | ask | show | jobs
by lolinder 765 days ago
> If you're finding it repetitive and formulaic, take that opportunity to identify the next refactoring.

It doesn't really matter how many helper functions you extract from your test code, in the end you have to string them together and then make assertions, and that part will always be repetitive and formulaic. If you've extracted a lot of shared code, then it might look something like "do this high-level business thing and then check that this other high-level business thing is true". But that is still going to need to be written a dozen times to cover all the test cases, and you're still going to want test names that match the test content.

There's a certain amount of repetition and formulaism that will never go away and that copilot is very good at.