Correct answer: D
Unit testing
Explanation
Explanation:
This question is asking which testing cycle, if performed properly, would have prevented the specific issue described. However, it is crucial to analyze the scenario carefully. The question states that after new capabilities were deployed, issues with preexisting capabilities were found. This is the classic symptom of a failure in regression testing. Since regression testing is not listed as an option, we must look for the testing type among the choices that occurs before deployment and is responsible for catching code-level errors that could impact existing functionality.
Why D is correct:
Unit testing is the first level of testing performed by developers on individual components or units of code. If developers had thoroughly unit-tested their code changes and the interfaces between the new code and the old code, they likely would have caught the bugs that broke the preexisting capabilities before the system was deployed. While integration testing is also critical, unit testing is the foundational step to ensure individual components work correctly in isolation.
Why A is incorrect:
Performance testing is conducted to determine how a system performs in terms of responsiveness and stability under a particular workload. It is used to check speed, scalability, and stability, not to find functional bugs in preexisting features.
Why B is incorrect:
User acceptance testing (UAT) is the final phase of testing where end users validate the system against business requirements. While UAT might uncover these issues, it is too late in the cycle to be the primary preventative measure. The goal is to catch such bugs long before UAT.
Why C is incorrect:
Stress testing is a type of performance testing that evaluates how a system behaves under extreme loads (beyond normal operational capacity). It is used to find the breaking point of the system, not to find functional bugs in preexisting capabilities.
Note:
The ideal answer to this question would be Regression testing, as that is the specific testing cycle designed to ensure new code doesn't break old functionality. However, since it is not an option, and based on common exam logic where the "best available" answer is selected, Unit testing is the most appropriate choice as it is the first line of defense against code defects. In a real-world scenario, a combination of unit, integration, and regression testing would be used.
References:
CompTIA Project+ PK0-005 Objective 2.4: Given a scenario, use the appropriate quality and performance measures. This objective covers various testing methods including unit, integration, system, regression, and user acceptance testing.
Testing Hierarchy: Testing typically progresses from unit testing → integration testing → system testing → regression testing → user acceptance testing.