이 가이드는 엔지니어링 시스템 개선을 위한 전략과 측정 항목을 추천하는 GitHub의 ESSP(엔지니어링 시스템 성공 플레이북)에서 영감을 받았습니다.
Copilot을 출시하려면 목표를 정의하고, 이에 따라 출시를 계획하고, 직원에게 목표를 명확하게 전달하는 것이 좋습니다. Achieving your company's engineering goals with GitHub Copilot을(를) 참조하세요.
1. Identify barriers to success
ESSP에서 권장하는 첫 번째 단계는 회사의 개선을 방해하는 장애물을 명확히 이해하는 것입니다. 현재 기준, 원하는 미래 상태, 진행을 방해하는 장벽을 이해하게 되면 발생하는 변화의 방향이 목표 지향적이고 효과적이라는 것을 확신할 수 있습니다.
Many software teams face persistent challenges in maintaining high-quality code due to low unit test coverage. In fast-paced development environments, writing tests is often seen as time-consuming or non-essential, especially when teams are under pressure to deliver features quickly.
As a result, critical bugs can be discovered late in the development lifecycle, often in staging or production environments.
This leads to a chain of negative outcomes:
- Higher bug rates and customer-reported issues
- Increased cost of fixing bugs after deployment
- Reduced developer confidence in the stability of their code
- Slower release cycles due to reactive debugging and patching
In legacy systems, test coverage can be even harder to address because of complex dependencies or poorly documented code. Developers may lack familiarity with older codebases or with testing frameworks in general, further compounding the problem.
Improving test coverage is a recognized best practice, but it requires time and expertise that many teams struggle to allocate.
2. Evaluate your options
다음 단계는 1단계에서 확인한 장벽을 해결하기 위한 솔루션을 평가하고 합의하는 것입니다. 이 가이드에서는 GitHub Copilot이 사용자가 파악한 목표에 미칠 수 있는 영향에 대해 중점적으로 살펴보겠습니다. 새로운 도구를 성공적으로 출시하려면 문화와 프로세스도 바뀌어야 한다는 점을 명심하세요.
피드백을 수집하고 성공을 측정하기 위해 파일럿 그룹과 함께 새로운 도구와 프로세스의 평가판을 시험적으로 실행하게 됩니다. 평가판 중에 사용할 학습 리소스 및 메트릭에 대해서는 3. 변경 내용 구현 및 주시해야 할 메트릭 섹션을 참조하세요.
How Copilot can help
GitHub Copilot can significantly accelerate and simplify the process of writing unit tests. By understanding the surrounding code and context, Copilot can suggest test functions that match the structure and logic of the code being tested.
Copilot's capabilities are useful across multiple scenarios:
- As developers write new functions, Copilot can automatically suggest corresponding test cases inline.
- When refactoring legacy code, Copilot can help generate test scaffolding to prevent regressions.
- For untested modules, developers can prompt Copilot to generate meaningful test cases, even when test coverage is missing or inconsistent.
By making unit testing easier, faster, and less manual, Copilot reduces the friction that can lead to gaps in test coverage, and helps teams adopt a quality-first mindset.
Use cases
- Inline test generation: Developers can ask Copilot to generate tests for a specific function or module without switching context.
- Better edge case coverage: By prompting Copilot for edge scenarios (such as null inputs, empty lists, or invalid states), developers can quickly cover more branches of logic.
- Accelerated onboarding: New team members can use Copilot to understand how a function is expected to behave by looking at the generated test cases.
- Assistance with CI/CD: Copilot can suggest how to integrate tests into your build pipeline, ensuring that coverage improvements directly support quality gates.
Cultural considerations
GitHub Copilot을 출시할 때, 목표 달성을 방해할 수 있는 사회적 또는 문화적 요소도 해결해야 합니다.
다음 예는 ESSP의 "Anti-Patterns" 섹션에서 가져온 것입니다.
- Teams might rely on manual testing or insufficient automated testing. This could be caused by resource constraints for automation or a lack of experience with modern test tools.
- Teams might wait too long to release, deploying large batches of code at once, which makes bugs and regressions harder to detect. This could be caused by a lack of CI/CD pipeline maturity, strict compliance requirements, or long review cycles between PR and deployment.
3. Implement changes
장벽을 극복하기 위한 올바른 접근 방식을 파악하면 파악한 솔루션을 스케일링합니다. 새로운 도구 또는 프로세스를 성공적으로 도입하기 위해서는 도입의 각 부분에 소유권을 할당하고, 목표에 대해 투명하게 소통하고, 효과적인 교육을 제공하고, 성과를 측정하는 것이 중요합니다.
이 섹션에서는 개발자를 위한 예시 시나리오, 모범 사례, 리소스를 제공합니다. 이 섹션을 사용하여 직원들이 Copilot을 목표에 맞춰 사용할 수 있도록 돕는 커뮤니케이션 및 교육 세션을 계획하는 것이 좋습니다.
- Generate tests inline
- Cover edge cases
- Understand new code
- Get assistance with CI/CD
- Best practices for developers
- Resources for developers
- Recommended features
Generate tests inline
- In VS Code, select the function you want to test and prompt Copilot:
Generate a unit test for this code.
- Copilot generates a test inline or in a separate test file, depending on the language and structure.
- Review, refine, and accept the suggestion.
Cover edge cases
-
After writing a test, ask Copilot:
What are some edge cases I should test for this function?
Or:
Write test cases for when the input is null or empty.
-
Copilot suggests additional test cases to cover boundary conditions.
-
Review the tests and incorporate them into your test suite.
Understand new code
- Select a legacy function and ask Copilot:
Explain what this function does and generate a test to validate it.
- Copilot explains the function's purpose and suggests corresponding test cases.
- Look at the test cases to understand the expected behavior and quickly build context.
Get assistance with CI/CD
- Review your test cases and commit them to the codebase.
- Ask Copilot:
Where should I place this test if I want it to run in CI?
- Based on the structure of the codebase, Copilot will suggest where to place test files and how to update pipeline configurations.
Best practices for developers
Developers should:
- Use descriptive comments or prompts when chatting with Copilot. For example:
Generate unit tests for a function that calculates discounts based on user type and purchase amount.
- Use Copilot to explore logic coverage. For example:
What branches or conditions does this function have that should be tested?
- Explore different prompt techniques and compare results from different AI models.
Developers should not:
- Accept generated tests without reviewing logic. Make sure the tests reflect actual requirements and handle realistic inputs and outputs.
- Skip asserting edge behavior. If you only test "happy paths," you risk missing regressions.
- Rely on Copilot to guess undocumented business rules. Always provide context through prompts or comments.
- Treat Copilot as a substitute for human code reviews. Copilot accelerates the process, but you still need to apply engineering judgment.
Resources for developers
- Writing tests with GitHub Copilot
- How to generate unit tests with GitHub Copilot: Tips and examples
- GitHub Copilot is EVERYWHERE in Visual Studio (video content with a section on testing)
- Copilot Chat의 프롬프트 엔지니어링
- Changing the AI model for Copilot Chat
Recommended features
Metrics to watch
새로운 도구의 평가판을 평가하고 전체 출시를 통해 일관된 개선 사항을 제공하는지 확인하려면 결과를 모니터링하고 필요한 경우에는 조정해야 합니다. 일반적으로 품질, 속도, 개발자의 행복이라는 핵심 영역을 고려하고 이러한 영역이 어떻게 모여 비즈니스 성과에 기여하는지 살펴보는 것이 좋습니다.
Copilot이 이 특정 목표에 미치는 영향을 평가하기 위해 살펴보기 좋은 몇 가지 지표는 다음과 같습니다.
- Test coverage: Track increases in line and branch coverage after Copilot adoption. If possible, look at test coverage reports from your CI pipelines.
- Bug rate after deployment: Fewer bugs should be reported in production environments.
- Developer confidence: Use surveys or retrospectives to assess how confident developers feel shipping new code.
- Time to write tests: Measure reduction in time spent creating unit tests.