Software Testing and Quality Assurance

Software Testing and Quality Assurance

Introduction

Explore systematic methods for detecting software defects and improving quality.

Topic-Wise Course Outline

  • Testing foundations, objectives and levels
  • Black-box, white-box and grey-box techniques
  • Test planning, cases and execution
  • Automated testing and tools
  • Quality assurance, reporting and improvement

Study Guidance

Begin with key concepts and clear definitions. Practise each topic using examples and independent exercises. Topic-wise MCQs, short questions and worked solutions will be added after verification.

Explore Computer Science Subjects

Practice MCQs — Set 1 (Questions 1–10)

Choose the best answer, then open the explanation to check your reasoning.

Question 1. What is the main purpose of software testing?

  1. To evaluate behavior and find defects relative to requirements
  2. To avoid all documentation
  3. To replace source-code review
  4. To prove mathematically that no bug can exist
Show correct answer and explanation

Correct answer: A. To evaluate behavior and find defects relative to requirements

Testing checks observable behavior against expected outcomes and may uncover defects. Passing tests does not guarantee the absence of all bugs.

Question 2. What is a unit test?

  1. A review of hardware manufacturing
  2. A test of an isolated small program component
  3. A test that always requires the internet
  4. An assessment of the entire organization
Show correct answer and explanation

Correct answer: B. A test of an isolated small program component

Unit tests focus on functions, classes or small modules with controlled dependencies. They provide quick feedback about localized behavior.

Question 3. What is integration testing?

  1. Measuring the size of a compiler
  2. Replacing all user acceptance tests
  3. Checking how components work together
  4. Testing only source-code indentation
Show correct answer and explanation

Correct answer: C. Checking how components work together

Integration tests exercise interactions between modules, databases, APIs or services. They reveal problems that isolated unit tests can miss.

Question 4. What is regression testing?

  1. Testing only newly purchased software
  2. Deleting failed tests
  3. Running a program without any assertions
  4. Rechecking previously working behavior after changes
Show correct answer and explanation

Correct answer: D. Rechecking previously working behavior after changes

Regression tests help detect when an update breaks previously functioning behavior. Automated suites make repeated checking practical.

Question 5. What is boundary-value analysis?

  1. Choosing inputs near limits and boundaries
  2. Testing only average values
  3. Selecting random usernames only
  4. Ignoring invalid input
Show correct answer and explanation

Correct answer: A. Choosing inputs near limits and boundaries

Errors often appear at the edge of permitted input ranges. Testing just below, at and just above a boundary can reveal off-by-one defects.

Question 6. What is equivalence partitioning?

  1. Testing only the fastest computer
  2. Dividing inputs into classes expected to behave similarly
  3. Splitting a program into equal-length source files
  4. Executing every possible input
Show correct answer and explanation

Correct answer: B. Dividing inputs into classes expected to behave similarly

Equivalence partitioning groups inputs by expected behavior. Representative tests from each class can reduce test count while preserving useful coverage.

Question 7. What does a code coverage metric indicate?

  1. A guarantee of correct algorithms
  2. Whether the project is profitable
  3. Which source elements were exercised by tests
  4. The exact number of undiscovered bugs
Show correct answer and explanation

Correct answer: C. Which source elements were exercised by tests

Coverage records executed statements, branches or other code elements. High coverage is useful evidence but cannot prove correctness.

Question 8. What is the difference between verification and validation?

  1. Both mean only compiling source code
  2. Verification happens only after release
  3. Validation tests are always automated
  4. Verification asks whether the product was built correctly; validation asks whether it meets user needs
Show correct answer and explanation

Correct answer: D. Verification asks whether the product was built correctly; validation asks whether it meets user needs

Verification examines conformance to specifications and design. Validation evaluates whether the system serves its intended purpose.

Question 9. What is a test oracle?

  1. A mechanism that determines the expected result of a test
  2. A database server brand
  3. A type of operating-system scheduler
  4. A data-compression tool
Show correct answer and explanation

Correct answer: A. A mechanism that determines the expected result of a test

A test oracle supplies expected outcomes so actual results can be compared. Requirements, reference implementations and mathematical properties may serve as oracles.

Question 10. What is a flaky automated test?

  1. A test with no assertions by definition
  2. A test that passes or fails inconsistently without a relevant code change
  3. A test that always fails for the same defect
  4. A test using the same input every run
Show correct answer and explanation

Correct answer: B. A test that passes or fails inconsistently without a relevant code change

Flaky tests can be caused by timing, randomness, shared state or external dependencies. They undermine trust in automation until the cause is fixed.