Skip to content

suuus/ghcopilot-challenge-sesh6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Copilot Refactoring Challenge

Welcome to the GitHub Copilot Refactoring Challenge! This exercise is designed to help you practice using GitHub Copilot's various features while improving code quality through refactoring.

Overview

This challenge consists of three increasingly difficult exercises that will help you master:

  • GitHub Copilot inline suggestions
  • GitHub Copilot Chat for code analysis and pattern suggestions
  • Copilot Edits for bulk refactoring

Time Required

Total time: ~20 minutes

  • Challenge 1: 5-7 minutes
  • Challenge 2: 6-8 minutes
  • Challenge 3: 7-10 minutes

Challenges

  1. Basic Function Refactoring

    • Focus: Code clarity, TypeScript types, and SOLID principles
    • Skills: Variable naming, type safety, function decomposition
  2. Class Structure Optimization

    • Focus: Design patterns and dependency injection
    • Skills: SOLID principles, testing strategies, class decomposition
  3. Advanced Pattern Implementation

    • Focus: Security, modern patterns, and best practices
    • Skills: Authentication patterns, security implementation, modern TypeScript

Getting Started

  1. Clone this repository
  2. Ensure you have the following VS Code extensions installed:
    • GitHub Copilot
    • GitHub Copilot Chat
  3. Run npm install to set up dependencies
  4. Start with Challenge 1 and progress through the challenges
  5. Use the verification tests to check your solutions

Using Copilot Effectively

For each challenge:

  1. Start by asking Copilot Chat to analyze the code
  2. Use inline suggestions for implementation details
  3. Leverage Copilot Edits for bulk refactoring
  4. Verify your changes with the test suite

Verification

Each challenge includes its own test suite. To verify your solutions:

npm test                 # Run all tests
npm test challenge1      # Run specific challenge tests
npm run test:watch      # Run tests in watch mode

Need Help?

If you get stuck:

  1. Ask Copilot Chat to explain the current code
  2. Request suggestions for specific patterns or implementations
  3. Use "Show Similar Examples" in Copilot Chat
  4. Check the hints section in each challenge

Learning Objectives

By completing these challenges, you'll learn:

  • Modern TypeScript patterns and practices
  • SOLID principles implementation
  • Security best practices
  • Test-driven development
  • Clean code principles

Good luck!

About

GitHub Copilot Refactoring Challenge

Resources

Stars

Watchers

Forks

Contributors