Study for the Software Quality Assurance Test. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which of the following statements about unit testing is true?

  1. It tests the application as a whole

  2. It is performed after integration testing

  3. It focuses on individual components or modules

  4. It is not necessary if integration testing is performed

The correct answer is: It focuses on individual components or modules

Unit testing is a fundamental practice in software development that focuses on testing individual components or modules of a program in isolation. The primary aim is to validate that each unit of the software performs as expected. This means that unit tests confirm the correctness of a specific function or method before it integrates with other parts of the application. By concentrating on single units, developers can identify and fix issues early in the development process, which ultimately leads to more robust and reliable software. Unit testing also provides documentation of how each component is expected to function, aiding in future maintenance and modifications of the codebase. In contrast, the other statements highlight concepts that do not align with the primary characteristics of unit testing. Testing the application as a whole refers to system testing or end-to-end testing, which involves evaluating the entire application in a complete operational environment. Performing unit tests after integration testing contradicts the typical sequential flow in software testing practices; unit tests are generally executed first. Lastly, stating that unit testing is unnecessary if integration testing is conducted undermines the importance of verifying individual components. Unit tests catch defects early, while integration testing focuses on the interaction between modules, meaning both testing levels are crucial for robust software development.