Exercise - Refactor large functions using GitHub Copilot
Important
To complete this exercise, you need an active GitHub account and a Visual Studio Code environment configured for C# development. For help with configuring your lab environment, see Configure lab environment for GitHub Copilot Labs. For help with enabling GitHub Copilot in Visual Studio Code, see Enable GitHub Copilot in Visual Studio Code.
In this exercise, you use GitHub Copilot to refactor a large function into smaller, more manageable functions. You use GitHub Copilot's Ask mode to analyze the existing code and identify refactoring opportunities. You then use GitHub Copilot's Agent mode to perform the refactoring by extracting code sections from the large function into smaller functions. Finally, you test the refactored code to ensure it works as intended.
Tasks include:
- Review the e-commerce order processing codebase manually.
- Identify refactoring opportunities using GitHub Copilot Chat (Ask mode).
- Refactor a large function into smaller, more manageable functions using GitHub Copilot Chat (Agent mode).
- Test the refactored e-commerce order processing code.
When you select the launch exercise button, the browser navigates to a public GitHub page that provides instructions for this exercise.
When you finish the exercise, return here for:
- A quick knowledge check.
- A summary of what you learned during this module.
- A badge for completing this module.
