A comprehensive, ready-to-use demonstration kit showcasing GitHub Copilot's capabilities across code completion, bug detection, test generation, refactoring, security analysis, and more.
- Overview
- Model Decision Tree
- Quick Start
- What's Included
- Demo Capabilities
- Setup Instructions
- Running the Demo
- Project Structure
- Troubleshooting
This demo kit is designed for trainers, presenters, and teams who want to showcase GitHub Copilot's powerful AI-assisted development capabilities. It includes:
- 3 Python modules with intentional bugs, TODOs, and optimization opportunities
- Comprehensive test suite demonstrating test generation capabilities
- Step-by-step trainer script with interactive guidance
- Detailed demo guide covering 10 key capability areas
- Automated setup for consistent environment configuration
Duration: 45-90 minutes (flexible)
Skill Level: Beginner to Advanced
Prerequisites: Python 3.8+, VS Code, GitHub Copilot extension
β οΈ Note: This repository intentionally contains bugs and insecure patterns (e.g.,eval, path traversal) for demonstration purposes only.
GitHub Copilot supports multiple AI models, each optimized for different tasks (speed, cost, deep reasoning, strict code generation, or agent workflows).
To help you choose the right model during the demo, refer to the visual decision guide:
π Copilot Model Decision Tree
Tip for presenters:
- Default to Balanced models for most demos
- Switch to Deep-Reasoning models for architecture or complex bugs
- Use Code-Focused models for large refactors or migrations
- Use Agent-Strong models when demonstrating multi-file changes or Copilot Agents
# 1. Clone or download this repository
cd "GH-300-GitHub-Copilot-Demos"
# 2. Run the setup script
.\setup_demo.ps1
# 3. Open in VS Code
code .That's it! The setup script will:
- β Create and activate a virtual environment
- β Install all dependencies
- β Configure VS Code settings
- β Verify the installation
- β Create quick reference guides
π‘ For Presenters: The
mainbranch has complete tests (227+). Use.\reset_for_demo.ps1before demos to showcase Copilot's test generation capabilities. Script backs up tests automatically and creates minimal stubs. After demos:git checkout .to restore.
-
calculator.py- Arithmetic operations with:- Empty list bugs
- Duplicate constants
- Missing error handling
- Edge case issues
- Incomplete implementations (TODOs)
-
data_processor.py- Data operations with:- O(nΒ²) performance problems
- Security vulnerabilities (eval)
- Missing type hints
- Edge case bugs
-
file_handler.py- File I/O with:- Path traversal vulnerabilities
- Missing error handling
- Encoding issues
- Incomplete implementations
test_calculator.py- 15 comprehensive test casestest_data_processor.py- 17 test cases with edge casestest_file_handler.py- 16 test cases including mockstest_runner.py- Unified test runner
setup_demo.ps1- Automated environment setupQUICK_REFERENCE.md- Auto-generated cheat sheetrequirements-test.txt- Python dependencies
- Function completion from comments
- Multi-line code generation
- Alternative suggestions
- Context-aware implementations
- Empty list handling
- Edge case identification
- Input validation
- Defensive programming
- Eliminate duplication
- Performance optimization (O(nΒ²) β O(n))
- Design pattern improvements
- Code smell detection
- Automated test creation
- Edge case coverage
- Mock object generation
- Test debugging
- Docstring generation
- Parameter documentation
- Usage examples
- Behavior explanations
- Code injection detection (eval)
- Path traversal vulnerabilities
- Input validation gaps
- Secure alternatives
- Code explanation
- Pattern alternatives
- Best practice suggestions
- Python 3.8+ (Download)
- VS Code (Download)
- GitHub Copilot extension (Install)
- PowerShell (included with Windows)
# Basic setup
.\setup_demo.ps1
# Skip test verification (faster)
.\setup_demo.ps1 -SkipTests
# Force recreate environment
.\setup_demo.ps1 -Force# Create virtual environment
python -m venv .venv
# Activate it
.\.venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements-test.txt
# Verify installation
python test_runner.pypytestThis provides:
- β 227 comprehensive test cases
- β 93% code coverage
- β Security vulnerability tests
- β Performance validation
- β HTML coverage reports
- Review the improved codebase
- Check
TRANSFORMATION_GUIDE.mdfor the full journey - Run tests to verify everything works
- Review
CHANGELOG.mdfor all changes
Pick and choose sections based on:
- Time available
- Audience skill level
- Specific interests (security, testing, performance)
GitHub Copilot Demos Starter/
βββ calculator.py # Module 1: Arithmetic operations
βββ data_processor.py # Module 2: Data operations
βββ file_handler.py # Module 3: File I/O
βββ data_table.py # Module 4: Table component
βββ logger.py # Centralized logging
βββ main.py # Entry point
β
βββ tests/ # Test suite (227 tests)
β βββ test_calculator.py # Calculator tests (80+)
β βββ test_data_processor.py # Data processor tests (60+)
β βββ test_file_handler.py # File handler tests (50+)
β βββ test_data_table.py # Data table tests (70+)
β βββ test_logger.py # Logger tests (40+)
β βββ conftest.py # Shared fixtures
β
βββ setup_demo.ps1 # Automated setup script
βββ pytest.ini # Test configuration
βββ TRANSFORMATION_GUIDE.md # Complete improvement journey
βββ CHANGELOG.md # All changes documented
βββ QUICK_REFERENCE.md # Quick commands reference
βββ README.md # This file
βββ requirements-test.txt # Python dependencies
β
βββ .venv/ # Virtual environment (created by setup)
βββ .vscode/ # VS Code settings (created by setup)
β βββ settings.json # Python & testing configuration
β
βββ __pycache__/ # Python cache (auto-generated)
# Run all tests
python test_runner.py
# Run specific test file
python -m pytest test_calculator.py -v
# Run specific test class
python -m pytest test_calculator.py::TestCalculator -v
# Run specific test method
python -m pytest test_calculator.py::TestCalculator::test_average -v
# Run with coverage
pytest --cov=. --cov-report=html
# View coverage report
start htmlcov/index.html| File | Line | Issue | Demo Type |
|---|---|---|---|
| calculator.py | ~62 | Empty list in average() | Bug Detection |
| calculator.py | ~68-75 | Duplicate PI constant | Refactoring |
| calculator.py | ~80 | Missing error handling | Code Quality |
| calculator.py | ~96 | No empty check | Edge Cases |
| data_processor.py | ~41 | O(nΒ²) performance | Optimization |
| data_processor.py | ~57 | eval() security risk | Security |
| file_handler.py | ~49 | Path traversal | Security |
| File | Line | Task | Demo Type |
|---|---|---|---|
| calculator.py | ~27 | Implement multiply() | Code Completion |
| calculator.py | ~30 | Implement divide() | Code Completion |
| calculator.py | ~46 | Implement square_root() | Code Generation |
| calculator.py | ~81 | Implement factorial() | Code Generation |
| data_processor.py | ~19 | is_palindrome() | Code Completion |
| file_handler.py | ~32 | write_text_file() | Code Completion |
- Accept:
Tab - Alternatives:
Ctrl + Enter - Next/Previous:
Alt + ]/Alt + [ - Inline Chat:
Ctrl + I - Dismiss:
Esc
/explain- Explain selected code/fix- Fix problems/tests- Generate tests/doc- Add documentation/optimize- Improve performance
- Right-click β "Copilot" menu
- Or open from sidebar (Ctrl + Shift + I)
- Check status bar - Copilot icon should be visible
- Verify extension is enabled
- Try
Ctrl + Enterto force suggestions - Check GitHub Copilot subscription is active
# Recreate environment
.\setup_demo.ps1 -Force
# Manual activation
.\.venv\Scripts\Activate.ps1
# Verify activation
python -c "import sys; print(sys.prefix)"# Reinstall dependencies
pip install -r requirements-test.txt --force-reinstall
# Check Python version
python --version # Should be 3.8+
# Run with verbose output
python -m pytest -vv# Ensure virtual environment is activated
.\.venv\Scripts\Activate.ps1
# Verify modules exist
python -c "import calculator; import data_processor; import file_handler"# If scripts won't run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or run with bypass
powershell -ExecutionPolicy Bypass -File .\setup_demo.ps1- Run
setup_demo.ps1and verify everything works - Review
QUICK_REFERENCE.md - Test Copilot connection
- Adjust timing based on audience
- Prepare backup examples
- β Start with simple examples, progress to complex
- β Show both successes and limitations
- β Ask audience for input on solutions
- β Pause for questions regularly
- β Emphasize real-world applicability
π‘ Reset Tip:
If you need to revert the project to its original broken state during a live demo:
git checkout .
git clean -fd- Ask audience to suggest fixes
- Show multiple Copilot alternatives
- Demonstrate live debugging
- Compare manual vs AI-assisted coding time
After completing this demo, participants will understand:
- How to use Copilot effectively for daily development
- When to trust vs verify AI suggestions
- Best practices for prompting Copilot
- Security implications of AI-generated code
- Testing strategies with AI assistance
- Code quality improvements through AI
- Documentation automation capabilities
- Learning opportunities from AI explanations
Found a bug? Have a suggestion? Want to add more demo scenarios?
- File an issue describing the problem/enhancement
- Fork the repository
- Make your changes
- Submit a pull request
This demo kit is provided as-is for educational purposes. Feel free to use, modify, and distribute for training and demonstration purposes.
Created for demonstrating GitHub Copilot capabilities in professional development environments.
For questions or issues:
- Check
TROUBLESHOOTINGsection above - Consult
QUICK_REFERENCE.mdfor commands
Ready to showcase GitHub Copilot? π
Run .\setup_demo.ps1 to get started!