1. GitHub Official Documentation, "Using GitHub Copilot Chat in your IDE": This document outlines the capabilities of Copilot Chat, including refactoring. It states, "You can ask GitHub Copilot to refactor a piece of code for you by highlighting the code in the editor and entering a prompt in the chat input." The examples provided, such as asking for fixes or improvements, align directly with improving readability and maintainability on a selected code segment.
Reference Location: In the section "Refactor code."
2. GitHub Official Documentation, "GitHub Copilot frequently asked questions (FAQ)": This document clarifies the scope and limitations of Copilot. It explains that Copilot's suggestions are based on the context of the code being edited. This context-bound nature supports why prompts must be specific to a code segment (like a function) rather than an entire application. It also implicitly confirms that Copilot works with existing patterns, not future predictions.
Reference Location: In the section "How does GitHub Copilot work?".
3. Dakhel, A. M., et al. (2023). GitHub Copilot, an AI pair programmer: Asset or liability? arXiv preprint arXiv:2302.12207. This academic study explores how developers use Copilot. The findings indicate that developers use it for tasks like "code refactoring and optimization," which includes improving code structure and clarity. This supports the use of prompts aimed at enhancing specific quality attributes like readability and maintainability.
Reference Location: Section 3.2, "RQ2: How do developers use GitHub Copilot in their daily programming tasks?", subsection "Code Refactoring and Optimization."
DOI: https://doi.org/10.48550/arXiv.2302.12207