๐Ÿงช Chapter 8: Software Testing

Test Your Understanding

Total Questions: 25

Topics Covered: Black-Box Testing, White-Box Testing, Cyclomatic Complexity, Basis Path Testing, Testing Levels, Verification & Validation

Instructions: Select one answer for each question, then click "Submit Quiz" to see your results.

Question 1
What is Black-Box Testing?
Explanation: Black-box testing is testing functionality without looking at the internal code structure, implementation details, or internal paths. It focuses on inputs and outputs based on requirements.
Question 2
What is the main focus of Black-Box Testing?
Explanation: The main focus of black-box testing is on the validation of functional requirements. It provides abstraction from code and focuses on software system behavior.
Question 3
What is White-Box Testing?
Explanation: White-box testing validates the internal structure and working of software code. It requires knowledge of the underlying programming language and checks all paths a program can execute.
Question 4
Which black-box testing technique is used to minimize test cases while maintaining reasonable test coverage?
Explanation: Equivalence Class Testing is used to minimize the number of possible test cases to an optimum level while maintaining reasonable test coverage.
Question 5
What is Boundary Value Testing focused on?
Explanation: Boundary Value Testing is focused on the values at boundaries. It determines whether a certain range of values are acceptable by the system, useful for reducing test cases.
Question 6
What is Cyclomatic Complexity?
Explanation: Cyclomatic Complexity is a software metric used to measure the paths complexity of a program. It's a quantitative measure of independent paths in the source code.
Question 7
What is an independent path in Cyclomatic Complexity?
Explanation: An independent path is defined as a path that has at least one edge which has not been traversed before in any other paths.
Question 8
How is Cyclomatic Complexity calculated using edges and nodes?
Explanation: Cyclomatic Complexity is calculated as V(G) = E - N + 2, where E is the number of edges and N is the number of nodes. Alternatively, V(G) = P + 1, where P is the number of predicates/decision nodes.
Question 9
What is the alternative formula for Cyclomatic Complexity using predicates?
Explanation: Cyclomatic Complexity can also be calculated as V(G) = P + 1, where P is the number of predicates (decision nodes) in the control flow graph.
Question 10
What is Basis Path Testing?
Explanation: Basis Path Testing involves execution of all possible blocks in a program and achieves maximum path coverage with the least number of test cases. The number of test cases equals the cyclomatic complexity.
Question 11
What does Verification mean in V&V (Verification and Validation)?
Explanation: Verification asks "Are we building the product right?" It aims to check that the software meets its stated functional and non-functional requirements.
Question 12
What does Validation mean in V&V (Verification and Validation)?
Explanation: Validation asks "Are we building the right product?" It's a more general process aimed at ensuring the software meets the customer's expectations.
Question 13
What are the four levels of testing?
Explanation: The four levels of testing are: Unit Testing (test individual components), Integration Testing (test integrated components), System Testing (test entire system), and Acceptance Testing (test final system).
Question 14
What is Acceptance Testing?
Explanation: Acceptance testing is beta testing done by actual end users. It's conducted to find if requirements of a specification are met. Only black-box testing techniques are used.
Question 15
What is Regression Testing?
Explanation: Regression Testing is done after code fixes, upgrades, or system maintenance to check that the new code has not affected the existing code. The product must be tested against previous test cases.
Question 16
What advantage does White-Box Testing have over Black-Box Testing?
Explanation: White-box testing tests the internal details of the code and checks all paths that a program can execute. However, it requires waiting until after designing and coding to select test cases.
Question 17
What is an advantage of Black-Box Testing?
Explanation: Black-box testing allows test case selection to be done before the implementation of a program, and helps in getting the design and coding correct with respect to the specification.
Question 18
How many test cases are needed in Basis Path Testing?
Explanation: The number of test cases in Basis Path Testing will be equal to the cyclomatic complexity of the program. It guarantees to execute each statement at least once.
Question 19
Which type of testing is NOT related to testing specific functionality but rather non-functional requirements?
Explanation: Non-functional testing is not related to testing specific functionality, but rather non-functional requirements such as performance, scalability, and usability.
Question 20
What does Decision Table Testing involve?
Explanation: Decision Table Testing puts causes and their effects in a matrix. There is a unique combination in each column, allowing systematic testing of different combinations.
Question 21
What is the first step in performing Black-Box Testing?
Explanation: The first step in Black-Box Testing is to examine the requirements and specifications of the system. Then testers choose valid/invalid inputs, determine expected outputs, construct test cases, execute them, and compare results.
Question 22
What is the purpose of using Cyclomatic Complexity in testing?
Explanation: Cyclomatic Complexity helps determine independent path executions, assures all paths are tested at least once, helps focus on uncovered paths, improves code coverage, evaluates risk, and reduces project failure risks.
Question 23
What is the difference between Black-Box and White-Box Testing regarding module communication?
Explanation: Black-box testing facilitates testing communication amongst modules, while white-box testing does not facilitate testing communication amongst modules (it focuses on internal code paths).
Question 24
What are the steps for Basis Path Testing?
Explanation: Steps are: 1) Draw control graph from source code, 2) Calculate Cyclomatic Complexity using V(G) = E - N + 2 or V(G) = P + 1, 3) Identify basis set of paths, 4) Generate test cases to execute all paths.
Question 25
What is Defect Testing focused on?
Explanation: The priority in defect testing is to find those inputs that reveal problems with the system. These inputs cause anomalous behavior and outputs that reveal the presence of defects.

Quiz Results