Software Engineering Software Engineering MCQ 4 — Questions and Answers
Question 1: Which software development practice involves writing tests before writing the actual implementation code?
- Behavior-Driven Development
- Test-Driven Development (Correct answer)
- Acceptance Test-Driven Development
- Exploratory Testing
Correct answer: Test-Driven Development
Test-Driven Development (TDD) requires developers to write a failing test first, then write just enough code to make it pass, then refactor.
Question 2: What is the primary purpose of a software configuration management (SCM) system?
- Monitor application runtime performance
- Track and control changes to software artifacts (Correct answer)
- Automate deployment to production servers
- Generate automated documentation from code
Correct answer: Track and control changes to software artifacts
SCM systems track and control changes to software artifacts such as source code, configuration files, and documentation throughout the development lifecycle.
Question 3: In object-oriented design, what does the Liskov Substitution Principle state?
- Subclasses should extend but not replace base class behavior in a way that breaks correctness (Correct answer)
- Each class should have only one reason to change
- Depend on abstractions, not on concrete implementations
- Interfaces should be client-specific and not force unnecessary methods
Correct answer: Subclasses should extend but not replace base class behavior in a way that breaks correctness
The Liskov Substitution Principle states that objects of a subclass should be substitutable for objects of the superclass without altering the correctness of the program.
Question 4: What is 'pair programming' in Extreme Programming (XP)?
- Two developers independently solving the same problem and comparing solutions
- Two developers working together at one workstation on the same code (Correct answer)
- A developer writing code while another writes tests separately
- Pairing front-end and back-end developers on separate features
Correct answer: Two developers working together at one workstation on the same code
In pair programming, two developers share one workstation—one writes code (driver) while the other reviews each line (navigator), then they switch roles.
Question 5: Which metric measures the percentage of source code executed during testing?
- Defect Density
- Code Coverage (Correct answer)
- Mean Time to Failure
- Halstead Volume
Correct answer: Code Coverage
Code coverage measures the proportion of source code lines, branches, or paths that are executed by a test suite.
Question 6: In DevOps, what is the primary goal of Continuous Integration (CI)?
- Deploy code to production automatically after every commit
- Merge code changes frequently and detect integration errors early (Correct answer)
- Monitor production systems for performance degradation
- Manage infrastructure as code using declarative templates
Correct answer: Merge code changes frequently and detect integration errors early
CI aims to merge developers' working copies to a shared mainline frequently—typically multiple times per day—to detect integration problems early.
Question 7: What is the difference between verification and validation in software quality assurance?
- Verification checks if the product is built right; validation checks if the right product was built (Correct answer)
- Verification is done by clients; validation is done by developers
- Verification tests functionality; validation tests performance
- Verification uses black-box testing; validation uses white-box testing
Correct answer: Verification checks if the product is built right; validation checks if the right product was built
Verification ensures the product meets its specification ('built right'), while validation ensures the product meets the actual user needs ('right product built').
Which software development practice involves writing tests before writing the actual implementation code?