Tackling your tech debt with Copilot coding agent

By GitHub

Share:

Key Concepts

  • Tech Debt Management: The process of identifying, prioritizing, and addressing technical debt within a software project.
  • GitHub Copilot Coding Agent: An AI-powered tool that assists developers by generating code, writing tests, and addressing technical debt.
  • Feature Work vs. Tech Debt: The ongoing conflict between developing new features and maintaining/improving existing code.
  • Sustainable Tech Debt Strategy: A long-term approach to managing and reducing technical debt effectively.
  • Issue Writing Best Practices: Techniques for creating clear, detailed, and actionable issues for AI agents.
  • Repository Instructions: Custom configurations for Copilot to tailor its behavior to a specific codebase and development style.
  • Atomic Tasks: Breaking down large technical debt problems into smaller, manageable units of work.
  • Human-AI Collaboration: Leveraging the strengths of both human developers and AI coding agents.

Problems with Tech Debt Management

The current approach to managing technical debt is often ineffective, leading to a backlog of issues that linger for extended periods, sometimes over a year. This occurs because of a constant "tug of war" between feature development and addressing technical debt, where feature work almost always takes precedence. While features are crucial for competitive advantage and differentiating an application, the neglect of tech debt has significant negative consequences:

  • Slowed Velocity: Developers are forced to work around existing problems rather than fixing them, reducing overall productivity.
  • Increased Fragility: The codebase becomes more prone to errors, and engineers become hesitant to modify older code due to fear of breaking existing functionality.
  • Eventual Need for Rewrites: In extreme cases, the accumulated tech debt can become so overwhelming that a complete rewrite from scratch is deemed necessary. This is often a suboptimal solution, leading to the departure of top engineers, loss of institutional knowledge, and significant project risk.

The speaker emphasizes that this cycle of accumulating tech debt is demoralizing for engineers who care about the quality and maintainability of their applications.

GitHub Copilot as a Tech Debt Elimination Accelerator

GitHub Copilot is presented as a solution to this persistent problem, acting as a "tech debt elimination accelerator." Its key advantages include:

  • Constant Availability: Copilot is always available and never tires, making it ideal for tackling tedious and time-consuming tasks that engineers often deprioritize.
  • Offloading Tedious Tasks: It can handle tasks such as bug fixes, improving test coverage, and updating outdated code, freeing up human developers to focus on more strategic and impactful work.
  • Balancing Team Workload: Copilot allows development teams to balance their efforts, dedicating human resources to feature development and strategic planning while offloading maintenance and debt reduction to the AI.

Demo and Example: Test Coverage

A demonstration illustrates the ease of using Copilot for tech debt. The process involves:

  1. Creating an Issue: A simple issue is created, and then assigned to Copilot.
  2. Copilot's Action: Copilot immediately begins working on the assigned task, creating a Pull Request (PR) with the proposed solution.
  3. Example Task: Generating Tests: A specific example shown is improving test coverage. Copilot can automatically add tests to a component.
  4. Review Process: The generated PR can be reviewed like any other PR submitted by a human engineer. The session can be reviewed to understand Copilot's actions and ask follow-up questions.

The speaker notes that these tasks typically take 8-10 minutes for Copilot to complete.

Building a Sustainable Tech Debt Strategy with Copilot

To effectively leverage Copilot for tech debt reduction, a structured strategy is essential. The speaker introduces the acronym R.A.P.P. (Repository Instructions, Atomic Tasks, Pair with Coding Agent) to guide this process.

1. Writing Effective Issues

The quality of the issue assigned to Copilot directly impacts its effectiveness. Best practices include:

  • Descriptive Titles: Pinpoint the exact location and nature of the desired changes. Breaking down components into multiple folders can help Copilot focus on specific areas.
  • Plenty of Context: Write issues as if explaining the task to a new team member who has no prior knowledge of the codebase. This ensures Copilot has sufficient information to understand the problem and its context.
  • Include Examples: If a specific pattern or solution is desired, provide examples within the issue. This is particularly useful for introducing new patterns or applying them consistently across the codebase.

2. Repository Instructions

Custom instructions can be configured for Copilot to align its behavior with the team's development practices and the application's architecture.

  • Tailored Development: Specify preferences like preferred testing frameworks (e.g., table-driven tests in Go) or coding styles.
  • Consistent Application: These instructions are applied automatically every time Copilot initiates a task, eliminating the need to repeat them in individual issues.

3. Atomic Tasks

Large technical debt problems should be broken down into smaller, manageable tasks.

  • Decomposition: Instead of assigning a broad task like "put together an edit widget button," break it down into smaller, actionable steps such as:
    • Add an edit button.
    • Make the database changes.
    • Create an API method.
    • Add metrics for the editing feature.
  • Benefits: This approach makes PRs easier to review, speeds up the resolution process, and reduces the cognitive load on both the AI and the human reviewer.

4. Pair with the Coding Agent

Effective collaboration between human developers and Copilot involves understanding their respective strengths:

  • Human Strengths:
    • Understanding the "Why": Humans can grasp the underlying business context and the true purpose of a task.
    • Navigating Ambiguity: Humans can interpret nuanced requirements and infer intent beyond explicit instructions.
    • Cross-System Thinking: Humans can understand how changes interact with the broader system architecture and organizational context.
  • Copilot Strengths:
    • Expanding Existing Patterns: Copilot excels at applying established patterns across the codebase.
    • Tireless Execution: It can work continuously on assigned tasks without fatigue.
    • Repetitive Tasks: Ideal for applying a solution or pattern to multiple instances.
    • Exploring Possibilities: Copilot can generate multiple solutions to a problem, allowing developers to explore different approaches before committing to one.

Daily Development Flow with Copilot

The speaker outlines a typical daily workflow incorporating Copilot:

  • Dedicated Copilot PR Time: Set aside specific time for triaging issues, reviewing Copilot-generated PRs, and merging them.
  • Personal Development Time: Reserve time for complex tasks, challenging bugs, and exploring new areas that require human intuition and strategic thinking.
  • Triage to Copilot: Assign newly identified tech debt issues to Copilot for processing.
  • Managing Multiple PRs: On average, a developer can manage 3-4 Copilot PRs concurrently while still completing one personal development task.

This approach requires an intentional shift in workflow and can feel uncomfortable initially but ultimately leads to significant progress in reducing tech debt.

Conclusion and Call to Action

The core message is that by strategically integrating GitHub Copilot into the development process, teams can effectively tackle their existing tech debt. Copilot can manage the "terrain" of technical debt, allowing human developers to focus on exploring and innovating in new areas.

The speaker encourages the audience to:

  • Review their backlogs: Identify an issue that can be assigned to Copilot.
  • Experiment with Copilot: Assign a task and observe its capabilities.
  • Utilize provided resources: Access additional information via a QR code.

The ultimate goal is to transform "mountains of tech debt" into "managed terrain," enabling more efficient and sustainable software development.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "Tackling your tech debt with Copilot coding agent". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video