CAPM Agile Frameworks and Methodologies Practice Question
An agile team is using Extreme Programming (XP). A developer wants to refactor a complex module but is concerned about breaking existing functionality. Which XP practice should the developer rely on to safely make changes?
⚠ Common exam trap
The trap here is choosing a collaborative or integration practice like Pair Programming or Continuous Integration when the specific need is a regression safety net for refactoring.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Test-Driven Development
Test-Driven Development provides an automated test suite that acts as a safety net, allowing developers to refactor with confidence. Continuous Integration, Pair Programming, and Collective Code Ownership support quality and collaboration but do not by themselves verify that refactoring preserved existing behavior. TDD directly addresses the risk of breaking functionality.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Continuous Integration
Why it's wrong here
Continuous Integration involves integrating and testing code multiple times per day. While it helps detect integration issues early, it does not by itself provide the safety net for refactoring. Without automated tests, continuous integration cannot verify that refactoring preserved behavior. It complements but does not replace the practice that directly guards against regressions.
- ✓
Test-Driven Development
Why this is correct
Test-Driven Development (TDD) requires writing automated tests before writing the code. These tests form a safety net that verifies behavior remains correct during refactoring. In XP, TDD is a core practice that enables developers to improve design confidently. By running the tests after each change, the developer can detect regressions immediately and refactor safely.
- ✗
Collective Code Ownership
Why it's wrong here
Collective Code Ownership means any team member can improve any part of the code. It encourages refactoring by removing ownership barriers, but it does not provide verification that changes are correct. Without a test suite, collective ownership alone cannot ensure that refactoring preserves functionality, so it is not the safety net the developer needs.
- ✗
Pair Programming
Why it's wrong here
Pair Programming involves two developers working together at one workstation, which improves code quality and knowledge sharing. However, it does not automatically verify that refactoring did not break existing behavior. Without automated tests, a pair could still introduce regressions. Pairing is valuable but is not the primary safety mechanism for refactoring.
Go deeper
Related to this question
About these practice questions
This CAPM question is part of Courseiva's 451-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official PMI exam blueprint
This CAPM practice question is part of Courseiva's free PMI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAPM exam.