From the course: Software Testing Assistance with GitHub Copilot AI

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Update functionality by writing more tests

Update functionality by writing more tests

- Copilot uses the context of the code you have open to generate code. So if the code you have open are tests, it gives copilot the info necessary to build up your code base. I created a value object for redirects. Value objects come from domain-driven design. And this is not technically a value object because of the setter methods. A VO is immutable. Equality is not based on identity. This is not immutable. How important is that here? Well, not very. However, the generated code has too much extra stuff. First, I'm going to run the existing value object test and this should pass test redirect value, object in test redirect. I spelled object wrong. While there is a copilot utility for the command line, it's not going to help with things like that. So these tests pass, but how do I tell a copilot to remove code? There's not really a way. I have tests, so I can manually remove these extra methods. I'll do that. And whenever I delete code, I always like to run the test again to make sure…

Contents