CS Testing & Quality Assurance 3 — Questions and Answers
Question 1: Mutation testing evaluates the quality of a test suite by doing what?
- Introducing small code faults and checking if tests detect them (Correct answer)
- Randomly generating new test inputs
- Measuring how fast the tests execute
- Counting the number of assertions per test
Correct answer: Introducing small code faults and checking if tests detect them
Mutation testing seeds small deliberate faults (mutants) and measures how many the test suite kills.
Question 2: An integration strategy that tests high-level modules first, replacing lower modules with stand-ins, is called what?
- Top-down integration using stubs (Correct answer)
- Bottom-up integration using drivers
- Big-bang integration
- Sandwich testing using oracles
Correct answer: Top-down integration using stubs
Top-down integration starts from upper-level modules and uses stubs to simulate the not-yet-integrated lower modules.
Question 3: A test passes and fails intermittently across runs with no code changes. What is this test commonly called?
- A flaky test (Correct answer)
- A regression test
- A golden test
- A parameterized test
Correct answer: A flaky test
A flaky test produces inconsistent results due to nondeterminism such as timing, ordering, or shared state.
Question 4: Which testing level is performed by end users or customers to determine whether the system meets business requirements?
- Acceptance testing (Correct answer)
- Unit testing
- Integration testing
- Component testing
Correct answer: Acceptance testing
Acceptance testing confirms the system satisfies business requirements, typically involving the customer or end users.
Question 5: Equivalence partitioning reduces the number of test cases by assuming what?
- Inputs in the same partition are processed the same way, so one representative suffices (Correct answer)
- All boundary values behave identically
- Every input must be tested at least twice
- Invalid inputs never need testing
Correct answer: Inputs in the same partition are processed the same way, so one representative suffices
Equivalence partitioning groups inputs the program treats equivalently, so one value per class represents the whole class.
Question 6: In a CI pipeline, a small fast suite runs on every commit to catch build-breaking defects early. What is this suite commonly called?
- Smoke tests (Correct answer)
- Soak tests
- Penetration tests
- Beta tests
Correct answer: Smoke tests
Smoke tests are a quick shallow suite verifying the build's core functionality before deeper testing proceeds.
Question 7: Which metric expresses the percentage of executable source lines exercised by a test suite?
- Statement (line) coverage (Correct answer)
- Cyclomatic complexity
- Defect density
- Mean time to failure
Correct answer: Statement (line) coverage
Statement coverage measures the proportion of executable statements run at least once by the tests.
Mutation testing evaluates the quality of a test suite by doing what?