Human-in-the-Loop AI Pair Programming Evaluation Suite
1. Overview and Objectives
This evaluation suite assesses AI pair programming assistants (e.g., GitHub Copilot, Cursor, or custom LLMs) in a human-in-the-loop collaboration model. Humans drive decision-making, while the AI provides code suggestions, explanations, debugging help, and refactoring in real-time or iterative sessions.
Primary Objectives:
- Measure productivity gains (speed, efficiency).
- Evaluate defect outcomes (code quality, bug rates).
- Capture qualitative feedback (user experience, trust, perceived value).
- Compare baselines: Human-only vs. Human+AI.
- Provide actionable insights for AI improvement (e.g., via fine-tuning datasets from sessions).
Scope: Focuses on software engineering tasks like feature implementation, bug fixes, and refactoring. Scalable for 50–200 participants.
Key Assumptions:
- Sessions use IDEs with AI plugins (e.g., VS Code + Copilot).
- Ethical: Anonymized data, IRB-compliant for human subjects.
2. Methodology
2.1 Participants
- Profile: 50–100 mid-level developers (2–5 years experience), diverse in languages (Python, JavaScript, Java) and domains (web, data, backend).
- Assignment: Randomized crossover design:
| Condition | Sessions |
|---|
| Baseline (Human-only) | 1 task/session |
| Treatment (Human+AI) | 1 task/session |
- Each participant does 4–6 sessions (2 baseline + 2–4 treatment) over 2 weeks to minimize fatigue/learning effects.
- Training: 15-min onboarding video/demo.
2.2 Tasks
Standardized benchmark tasks from sources like HumanEval+, SWE-Bench, or custom:
- Complexity Tiers (balanced across conditions):
| Tier | Examples | Est. Time (Human-only) |
|---|
| Easy | Implement fizzbuzz, sort array | 10–15 min |
| Medium | REST API endpoint, data pipeline | 30–45 min |
| Hard | Refactor legacy code, fix multi-file bugs | 60–90 min |
- Task Specs: Clear README with requirements, tests, and success criteria (e.g., 90% test coverage).
- Variations: 20% algorithmic, 40% application logic, 40% real-world (e.g., from GitHub issues).
2.3 Session Protocol (Human-in-the-Loop)
- Setup (5 min): Load task in sandboxed repo (GitHub Codespaces or Replit).
- Pair Programming (30–90 min):
- Human types/edits code; AI responds to natural language prompts or auto-suggests.
- Allowed interactions: Accept/reject suggestions, chat queries (e.g., "Explain this bug").
- Human must commit/push at milestones.
- Wrap-up (5 min): Run tests, submit.
- Logging: Automated via IDE plugins (e.g., telemetry for keystrokes, suggestions).
Tools:
- IDE: VS Code with AI extension + custom telemetry logger.
- Telemetry: Tracks AI suggestions (accepted/rejected rate), human edits, timestamps.
- Version Control: Git for diffs/commits.
3. Evaluation Metrics
3.1 Productivity Metrics (Quantitative)
Captured automatically via telemetry:
| Metric | Definition | Unit | Target Improvement (AI vs. Baseline) |
|---|
| Task Completion Time | Wall-clock time from start to submission | Minutes | ≥20% reduction |
| Code Velocity | Lines of code (LOC) per hour (functional LOC, exclude comments/boilerplate) | LOC/hour | ≥30% increase |
| Suggestion Acceptance Rate | % of AI suggestions accepted by human | % | 60–80% |
| Edit Cycles | Number of human edits per 100 LOC | Edits/100 LOC | ≤20% reduction |
| Commit Frequency | Commits per session | #/session | ≥1.5x |
3.2 Defect Outcomes (Quantitative)
Automated + semi-automated post-session:
| Metric | Definition | Tools | Threshold for "Success" |
|---|
| Test Pass Rate | % of provided unit/integration tests passed | pytest/Jest | ≥90% |
| Bug Density | Bugs found per 1K LOC (via static analysis + fuzzing) | SonarQube, CodeQL | ≤5 bugs/1K LOC |
| Test Coverage | Line/branch coverage | Coverage.py, Istanbul | ≥80% |
| Critical Defects | Severity-weighted bugs (e.g., crashes, security) | Manual review (10% sampled) + SAST | 0 critical |
| Refactoring Quality | Cyclomatic complexity delta pre/post | Radon, ESLint | ≤10% increase |
- Validation: Tasks include hidden tests (e.g., edge cases) revealed post-session.
3.3 Qualitative Feedback
Captured via in-session popups + post-session surveys (5-point Likert + open-text):
| Category | Questions (Likert 1–5) | Open-Ended |
|---|
| Helpfulness | "AI sped up my work" / "Suggestions were relevant" | "Most/least helpful AI feature?" |
| Trust & Usability | "I trusted AI suggestions" / "Interface was intuitive" | "Moments of frustration?" |
| Collaboration | "Felt like true pair programming" / "AI handled explanations well" | "How did AI change your workflow?" |
| Overall | NPS (0–10): "Recommend to colleague?" | Free-form |
- Advanced: Session recordings (screen + audio opt-in) for thematic analysis (e.g., via Otter.ai transcripts).
4. Data Collection and Instrumentation
4.1 Automated Logging (Zero-Overhead)
- Client-Side: VS Code extension logs JSON events:
{
"event": "suggestion",
"ai_text": "def foo(...",
"accepted": true,
"timestamp": "2023-10-01T12:00:00Z"
}
- Server-Side: CI/CD pipeline runs tests/analysis on submission.
- Privacy: Hash repos, anonymize keystrokes.
4.2 Surveys
- Tools: Google Forms/Typeform integrated in IDE.
- Response Rate Goal: 95% (incentivized: $10 Amazon gift card/session).
4.3 Baselines and Controls
- Counterbalance task order/conditions.
- Pre-survey: Experience level, AI familiarity.
5. Analysis Plan
5.1 Statistical Methods
- Productivity/Defects: Paired t-tests/Wilcoxon (per participant), effect sizes (Cohen's d).
- Qualitative: Thematic coding (NVivo or manual), sentiment analysis (VADER).
- Correlations: Regression (e.g., acceptance rate vs. bug density).
- Segmentation: By task tier, participant exp, AI model.
5.2 Reporting Dashboard
- Real-time: Streamlit/Grafana with metrics viz.
- Final Report: Executive summary + raw data export (CSV/Parquet).
| Example Aggregates | Human-Only | Human+AI | p-value |
|---|
| Completion Time (min) | 45 | 32 | <0.001 |
| Bug Density (/1K LOC) | 8.2 | 4.1 | <0.01 |
6. Implementation Roadmap
| Phase | Duration | Deliverables |
|---|
| Prep | 2 weeks | Tasks curated, extension built, participant recruitment. |
| Pilot | 1 week | 10 participants, iterate on logging. |
| Full Run | 4 weeks | Data collection. |
| Analysis | 2 weeks | Stats, report, public dataset release. |
Cost Estimate: $5K–10K (incentives, cloud compute).
Scalability: Modular—add languages/tasks easily.
Risks & Mitigations:
- Cheating: Proctored via timestamps + plagiarism checks.
- AI Variability: Fix model/version.
- Bias: Diverse participants.
This suite provides a rigorous, end-to-end framework to quantify AI's impact on pair programming. Open to refinements!