1.1 What is the primary objective of software testing?
Correct Answer: C) To evaluate the software and identify defects
Explanation: The primary objective of software testing is to evaluate the software and identify defects, not to guarantee it's defect-free. Testing helps assess quality and provide stakeholders with information about the software's quality, but it cannot prove absolute correctness or fix all issues.
1.2 Which of the following is NOT a principle of testing?
Correct Answer: A) Exhaustive testing is possible
Explanation: Exhaustive testing (testing all possible inputs and combinations) is impossible except for trivial cases. This is a fundamental principle - testing can only sample possible scenarios. The other options are all recognized principles of software testing.
1.3 Which testing activity is performed first?
Correct Answer: B) Unit Testing
Explanation: Unit testing is typically the first testing activity in the software development lifecycle, where individual components or units of code are tested in isolation. It's followed by integration testing (combining units), system testing (testing the complete system), and finally acceptance testing.
1.4 What is "Regression Testing"?
Correct Answer: B) Re-executing test cases to ensure no new defects are introduced
Explanation: Regression testing involves re-running previously executed test cases to verify that recent changes (bug fixes, new features, etc.) haven't adversely affected existing functionality. It's crucial for maintaining software quality throughout the development lifecycle.
1.5 Which of the following is a verification activity?
Correct Answer: B) Code Review
Explanation: Verification is the process of evaluating work products during development to ensure they meet specified requirements (building the product right). Code review is a verification activity, while the other options are validation activities (ensuring the right product is built).
2.1 Which technique is used in Black Box Testing?
Correct Answer: C) Equivalence Partitioning
Explanation: Equivalence Partitioning is a black box testing technique where input data is divided into equivalent partitions that are expected to be processed similarly. The other options (Statement Coverage, Decision Coverage, Path Testing) are white box testing techniques that require knowledge of internal code structure.
2.2 Equivalence Partitioning divides input data into:
Correct Answer: A) Valid and Invalid partitions
Explanation: Equivalence Partitioning divides input data into valid (acceptable) and invalid (unacceptable) partitions. Test cases are then designed to cover each partition, with the assumption that if one value in a partition works, all values in that partition should work similarly, reducing the number of test cases needed.
2.3 Boundary Value Analysis focuses on:
Correct Answer: A) Testing values at the edges of input ranges
Explanation: Boundary Value Analysis (BVA) tests values at the boundaries (edges) of input ranges because these are where most defects tend to occur. For a range [1,100], BVA would test values like 0, 1, 2, 99, 100, and 101. It's often used together with Equivalence Partitioning.
2.4 Which technique is best suited for testing combinations of inputs?
Correct Answer: A) Decision Table Testing
Explanation: Decision Table Testing is ideal for testing combinations of inputs and business rules. It systematically captures different combinations of conditions and their corresponding actions in a table format, ensuring all possible combinations are considered. This is particularly useful for business logic testing.
2.5 State Transition Testing is useful for:
Correct Answer: A) Testing systems with different states and transitions
Explanation: State Transition Testing is valuable for systems where the output depends not just on current inputs but also on previous inputs (system state). It models the system as a finite state machine and tests valid/invalid transitions between states. Examples include login systems, ATMs, or any application with workflow states.
3.1 Which of the following is a White Box Testing technique?
Correct Answer: C) Statement Coverage
Explanation: Statement Coverage is a white box (structural) testing technique that requires knowledge of the internal code. It aims to execute every statement in the code at least once. The other options are black box testing techniques that don't require knowledge of the internal implementation.
3.2 Statement Coverage ensures:
Correct Answer: B) Every statement is executed at least once
Explanation: Statement Coverage is the most basic white box testing technique that measures whether each executable statement in the code has been executed at least once. While it helps find unreachable code, it doesn't guarantee all decision outcomes are tested (which would require branch coverage) or all paths are tested (path coverage).
3.3 Cyclomatic Complexity is used to measure:
Correct Answer: B) Number of independent paths in a program
Explanation: Cyclomatic Complexity, developed by Thomas McCabe, measures the number of linearly independent paths through a program's source code. It's calculated as M = E - N + 2P (where E=edges, N=nodes, P=connected components). Higher complexity indicates more test cases are needed for full path coverage and suggests potentially more error-prone code.
3.4 Which technique ensures that every possible branch is executed?
Correct Answer: C) Branch Coverage
Explanation: Branch Coverage (also called Decision Coverage) ensures that every possible branch from each decision point (like both outcomes of an if-statement) is executed at least once. It's stronger than statement coverage but weaker than path coverage. For example, it would require testing both the true and false outcomes of conditions.
3.5 What does "Path Testing" focus on?
Correct Answer: A) Testing all possible execution paths
Explanation: Path Testing is a white box technique that aims to execute all possible paths through a program from entry to exit. While theoretically thorough, it's often impractical for complex programs due to path explosion (exponential growth of possible paths with each decision point). In practice, critical paths are selected based on risk and complexity.