Full-Stack Development Quality Control & Assurance 2 — Questions and Answers
Question 1: Which testing technique executes code without examining internal structure, focusing solely on inputs and outputs?
- White-box testing
- Black-box testing (Correct answer)
- Gray-box testing
- Static testing
Correct answer: Black-box testing
Black-box testing treats the system as an opaque box and validates behavior purely based on inputs and expected outputs.
Question 2: In a CI/CD pipeline, at which stage should unit tests typically run?
- After deployment to staging
- Only on the main branch
- On every commit, before integration tests (Correct answer)
- Before code is committed
Correct answer: On every commit, before integration tests
Unit tests run on every commit as the first gate in CI to catch failures early before slower integration tests execute.
Question 3: What does 'test coverage' primarily measure?
- Number of bugs found per test
- Percentage of code executed by tests (Correct answer)
- Time taken to run the test suite
- Number of test cases written
Correct answer: Percentage of code executed by tests
Test coverage measures the percentage of source code lines, branches, or paths that are exercised during test execution.
Question 4: Which type of testing verifies that a new code change has not broken existing functionality?
- Smoke testing
- Regression testing (Correct answer)
- Sanity testing
- Exploratory testing
Correct answer: Regression testing
Regression testing re-runs existing tests after changes to ensure previously working features still function correctly.
Question 5: What is a 'test double' in software testing?
- Running the same test twice for reliability
- A generic term for objects that replace real dependencies in tests (Correct answer)
- A second developer who reviews test code
- A production replica environment
Correct answer: A generic term for objects that replace real dependencies in tests
Test doubles (mocks, stubs, fakes, spies) are stand-ins for real dependencies that allow isolated unit testing.
Question 6: Which HTTP status code range indicates a server-side error that end-to-end tests should detect?
- 2xx
- 3xx
- 4xx
- 5xx (Correct answer)
Correct answer: 5xx
5xx status codes indicate server-side errors (e.g., 500 Internal Server Error) that signal broken backend logic.
Question 7: What is the primary purpose of a 'staging environment' in the QA process?
- To run load tests only
- To provide a production-like environment for final validation before release (Correct answer)
- To store test artifacts and logs
- To host the CI runner agents
Correct answer: To provide a production-like environment for final validation before release
Staging mirrors production configuration so QA teams can validate the full release candidate under realistic conditions.
Which testing technique executes code without examining internal structure, focusing solely on inputs and outputs?