---
title: "Testing Strategies: Unit, Integration, E2E"
description: "Master comprehensive testing: unit testing, integration testing, end-to-end testing, mocking, fixtures, coverage goals, and CI/CD integration."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/testing-strategies-quiz
---

# Testing Strategies: Unit, Integration, E2E

Welcome to the comprehensive quiz on testing strategies! This quiz covers unit testing, integration testing, end-to-end testing, mocking, fixtures, code coverage, and more. Test your knowledge and understanding of these essential concepts in software testing. Good luck!

## Questions

### 1. What is unit testing?

- **The practice of verifying individual functions or methods in complete isolation** ✅
  - Unit testing: fast, focused, many tests. Jest, Vitest, pytest.
- The verification of complex data flows between the backend and the database
  - This describes integration testing.
- The manual process of checking the user interface for visual inconsistencies
  - This refers to manual UI testing or visual regression.
- The deployment of code to a staging environment for real-world user feedback
  - This is User Acceptance Testing (UAT) or Beta testing.

**Hint:** Think about testing functions.

### 2. What is integration testing?

- **The verification of interactions between multiple components or external services** ✅
  - Integration testing: slower, realistic, catches interactions. Fewer than unit tests.
- The process of testing a single line of logic without any external dependencies
  - This describes unit testing.
- The act of combining multiple source code files into a single production bundle
  - This describes "bundling" or "linking," not testing.
- The practice of testing the entire system from the perspective of an end user
  - This describes End-to-End (E2E) testing.

**Hint:** Think about testing together.

### 3. What is end-to-end (E2E) testing?

- **The simulation of complete user workflows from the frontend through to the backend** ✅
  - E2E: realistic, slow, expensive. Cypress, Selenium, Playwright. Fewer tests.
- A method for testing private class methods to ensure internal state consistency
  - This is a specific form of unit testing.
- A technique for verifying that the API documentation matches the actual code
  - This is contract testing or documentation testing.
- The process of testing how an application behaves when the network is offline
  - This is a specific type of resilience or offline-mode testing.

**Hint:** Think about testing full flows.

### 4. What is the test pyramid?

- **A strategy favoring many unit tests, fewer integration tests, and minimal E2E tests** ✅
  - Pyramid: 70% unit, 20% integration, 10% E2E. Optimize ROI.
- A design pattern where tests are written in a hierarchical order of code complexity
  - The pyramid refers to the distribution of test types, not code complexity.
- A requirement that every line of code must be covered by at least three test types
  - This would be an inefficient use of resources and over-testing.
- A visual representation of the server infrastructure used to run automated suites
  - The pyramid is a testing strategy model, not an infrastructure map.

**Hint:** Think about quantity per type.

### 5. What is a mock?

- **A replacement for a dependency that allows for controlling and inspecting behavior** ✅
  - Mocks: Jest.mock(), sinon. Prevent side effects, control environment.
- A duplicate of the production database used for running heavy analytical queries
  - This describes a read-replica or staging database.
- A specialized function that automatically fixes bugs found during a test run
  - Mocks simulate behavior; they do not fix code bugs.
- A type of comment used to temporarily disable tests that are currently failing
  - This is usually "skipping" or "x-testing".

**Hint:** Think about fake implementations.

### 6. What is a stub?

- **A simplified object that returns fixed, predetermined data for specific calls** ✅
  - Stub: simpler than mock. No behavior tracking. Quick, deterministic.
- A complex simulation of a third-party API that includes full business logic
  - This describes a "fake" rather than a "stub".
- A temporary variable used to hold the results of a failed assertion
  - Stubs are used for setup, not for holding assertion results.
- A piece of code that connects the frontend components to the backend API
  - This describes an "adapter" or "service layer".

**Hint:** Think about fake functions.

### 7. What is a spy?

- **A wrapper around a function that records details about how it was called** ✅
  - Spy: wraps real implementation, non-intrusive observation.
- A hidden security tool that monitors the cluster for unauthorized access
  - This describes an Intrusion Detection System (IDS).
- A test that intentionally fails to ensure the reporting system is active
  - This is a "canary test" for the test runner itself.
- A specialized type of mock that deletes data after a test completes
  - Spies record information; they do not handle data deletion.

**Hint:** Think about call tracking.

### 8. What is a fixture?

- **A baseline set of data or state used consistently across multiple test cases** ✅
  - Fixtures: reusable setup, cleanup. DRY testing. Pytest, Jest support.
- A physical hardware device used to run mobile application tests
  - In software testing, fixtures refer to data/state setup.
- A permanent change to the production database required for a new feature
  - Fixtures are temporary for tests and should not affect production.
- A syntax error that prevents a test file from being executed by the runner
  - Fixtures are intentional setup tools, not errors.

**Hint:** Think about test setup data.

### 9. What is code coverage?

- **A metric indicating the percentage of source code executed during a test suite** ✅
  - Coverage: statement, branch, function, line. Aim 80-90%, not 100%.
- A security report listing all the third-party libraries used in a project
  - This describes a Software Bill of Materials (SBOM).
- A legal document that protects developers from liability for code defects
  - Coverage is a technical metric, not a legal document.
- A count of how many developers have reviewed a specific pull request
  - This refers to code review participation.

**Hint:** Think about how much tested.

### 10. What is Cypress?

- **A modern, browser-based framework designed for end-to-end testing** ✅
  - Cypress: developer-friendly, good debugging, WebDriver alternative.
- A server-side language used for writing high-performance unit tests
  - Cypress is a JavaScript/TypeScript framework, not a language.
- A cloud-based tool for storing and versioning large binary test files
  - Cypress is an execution framework, not a storage tool.
- A plugin that automatically converts manual tests into automated scripts
  - While recorders exist, Cypress is primarily a coding framework.

**Hint:** Think about E2E testing.

### 11. What is test isolation?

- **Ensuring that the outcome of one test does not affect the outcome of another** ✅
  - Isolation: prevents state coupling, improves debugging. Use beforeEach cleanup.
- Running all tests on a single, disconnected machine to prevent data leaks
  - Isolation refers to logic and state separation, not physical machine location.
- A rule that prevents developers from talking to each other during the QA phase
  - This is not a technical concept in software testing.
- The practice of putting all failing tests into a separate folder for later review
  - This is "quarantining" tests, which is different from isolation.

**Hint:** Think about independent tests.

### 12. What is a flaky test?

- **A test that provides inconsistent results without any changes to the code** ✅
  - Flaky tests: hidden bugs, avoid CI/CD. Root cause: timing, state, randomness.
- A test that is designed to fail when the system is under heavy load
  - This describes a load test threshold or stress test.
- A test that takes a long time to run due to slow network connections
  - A slow test is not necessarily a flaky one.
- A test that has been deprecated and is no longer part of the main suite
  - This describes a "skipped" or "legacy" test.

**Hint:** Think about inconsistent results.

### 13. What is Test-Driven Development (TDD)?

- **A process where you write a failing test before writing the actual implementation** ✅
  - TDD: fail test → write code → pass test → refactor. Ensures testability.
- A strategy where developers only write code that has already been tested manually
  - TDD is an automated process where the test precedes the code.
- A management style that rewards developers based on the number of tests written
  - TDD is a technical development methodology, not a management style.
- A tool that automatically generates unit tests based on existing production code
  - This is "automated test generation," not TDD.

**Hint:** Red-Green-Refactor cycle?

### 14. What is Behavior-Driven Development (BDD)?

- **A methodology using human-readable descriptions to define how an application should act** ✅
  - BDD: human-readable specs. Gherkin (Given/When/Then). Bridges testing and business.
- A performance test that monitors the behavior of the server CPU during a spike
  - This is performance monitoring, not BDD.
- A way of writing code where the computer predicts the next logic step for the developer
  - This describes AI-assisted coding or Autocomplete.
- A security protocol that tracks the behavior of users on a public network
  - This is user behavior analytics (UBA) or monitoring.

**Hint:** User scenarios and Gherkin syntax?

### 15. What is snapshot testing?

- **A technique that compares the current output of a component to a previously stored version** ✅
  - Snapshot testing: regression detection. Jest, Percy (visual), Playwright.
- A method for taking a photo of the developer to verify their identity
  - This is biometric authentication, not software testing.
- A way of testing that only checks the code that was changed in the last hour
  - This is incremental testing or change-set testing.
- A tool that creates a backup of the entire server before a test begins
  - This is server imaging or snapshotting in an infrastructure context.

**Hint:** Store expected output and compare?

### 16. What is the AAA (Arrange-Act-Assert) pattern?

- **A structural pattern that divides a test into three clear, sequential phases** ✅
  - AAA pattern: readable, maintainable tests. Setup → Execute → Verify.
- A grading system that ranks tests from A (perfect) to F (completely broken)
  - AAA refers to the structure of a single test, not a grading system.
- A cloud provider requirement that all tests must be authenticated with three keys
  - AAA is a coding pattern, not an authentication requirement.
- A technique for running three different tests at the exact same time
  - This describes parallel execution, not the AAA pattern.

**Hint:** Test structure with three phases?

### 17. What is parameterized testing?

- **A method for executing the same test logic multiple times using different input data** ✅
  - Parameterized testing: avoid duplicated test logic. Vitest.each, pytest.mark.parametrize.
- A test that checks if the parameters of a function are typed correctly
  - This is static type checking (like TypeScript), not parameterized testing.
- A way to limit the number of arguments a function can receive during a test
  - This is an API constraint, not a testing strategy.
- A performance metric that measures the time it takes to parse URL parameters
  - This is a specific performance check for a parser.

**Hint:** Test same logic with multiple inputs?

### 18. What is regression testing?

- **Re-running existing tests to ensure that new changes haven’t introduced any new bugs** ✅
  - Regression testing: safety net for changes. Automated suites run before merge.
- The practice of reverting the code to a previous version when a test fails
  - This is a "rollback," not regression testing.
- A testing phase where old, unused code is deleted from the repository
  - This is refactoring or code cleanup.
- A manual process where users report bugs they found in the previous release
  - This is bug reporting or feedback loops.

**Hint:** Ensure bug fixes don't break existing features?

### 19. What is smoke testing?

- **A preliminary set of tests that verify the most critical functions of an application** ✅
  - Smoke testing: first-pass validation. Catches obvious breaks early.
- A test that checks if the server hardware is overheating under load
  - This is thermal monitoring, not smoke testing.
- A specialized security test that checks for vulnerabilities in firewalls
  - This is network security scanning.
- The process of deleting all log files before starting a fresh test run
  - This is environment cleanup, not smoke testing.

**Hint:** Quick critical path tests?

### 20. What is performance/load testing?

- **A strategy to evaluate how a system performs under a high volume of concurrent users** ✅
  - Load testing: concurrent users, throughput, latency metrics.
- A test that checks if the developers are writing code fast enough
  - This is a productivity metric, not software performance testing.
- A way to measure the physical speed of the internet connection in the office
  - This is network speed testing.
- A method for compressing the application size to improve download times
  - This is asset optimization or minification.

**Hint:** Test system under high load?

### 21. What is security testing?

- **The practice of identifying vulnerabilities and threats in an application’s code or infrastructure** ✅
  - Security testing: vulnerability detection. OWASP Top 10, DAST, SAST.
- The act of locking the office doors to prevent unauthorized physical entry
  - This is physical security, not application security testing.
- A requirement that all developers must use complex passwords for their accounts
  - This is an access policy, not a testing strategy.
- A test that checks if the application can run on a secure operating system
  - This is compatibility testing.

**Hint:** Test for vulnerabilities and attacks?

### 22. What is contract testing?

- **A technique to ensure that a provider and a consumer of an API agree on the data format** ✅
  - Contract testing: microservices safety. Pact defines request/response contracts.
- A legal review of the terms of service agreement for a new software product
  - This is a legal contract review, not technical testing.
- A test that verifies if a developer has completed their assigned tasks
  - This is project management or task tracking.
- A way to verify that a third-party vendor is following their service level agreement
  - This is SLA monitoring or compliance auditing.

**Hint:** Test API contracts between services?

### 23. What is mutation testing?

- **An advanced method that modifies the source code to check if the test suite fails** ✅
  - Mutation testing: test suite effectiveness. Mutate operators, verify test catches.
- A process for automatically updating the code to a newer version of a library
  - This is an automated dependency update (like Dependabot).
- A test that checks if the application can adapt to different screen sizes
  - This is responsive design testing.
- A way of testing how an application behaves when its binary data is corrupted
  - This is fuzzing or corruption testing, not mutation testing.

**Hint:** Mutate code and verify tests catch changes?

### 24. What is property-based testing?

- **A strategy where a test generates random data to verify that certain logic properties always hold** ✅
  - Property-based testing: find edge cases via generation. Hypothesis, fast-check.
- A test that verifies if an object’s properties are stored correctly in the database
  - This is standard data persistence testing.
- A method for calculating the market value of a software application’s source code
  - This is intellectual property (IP) valuation.
- A test that only focuses on the CSS properties of a web page
  - This is CSS regression testing.

**Hint:** Generate random inputs and verify properties?

### 25. What is accessibility testing?

- **The practice of ensuring that software is usable by people with various disabilities** ✅
  - Accessibility testing: WCAG 2.1 (A/AA/AAA). Keyboard, screen readers, color.
- A test that checks if the website can be accessed from any country in the world
  - This is global availability or geolocation testing.
- The process of checking if the application has a fast enough login time
  - This is performance or UX testing.
- A test that ensures the server room is accessible to maintenance staff
  - This is physical facility accessibility.

**Hint:** Test for inclusive UI for people with disabilities?

### 26. What is the test data builder pattern?

- **A design pattern that uses a fluent interface to construct complex objects for testing** ✅
  - Test data builder: reduce boilerplate. Fluent API with sensible defaults.
- A tool that automatically scrapes data from the web to use in a test suite
  - This is web scraping or data mining.
- A database script that builds a new table every time a test is executed
  - This describes dynamic schema creation, not the builder pattern.
- A specific way of organizing the folders where test data is stored
  - This is folder structure or data management.

**Hint:** Fluent API for building test data?

### 27. What is test isolation and why is it important?

- **A requirement that tests remain independent to prevent side effects and shared state** ✅
  - Test isolation: no cross-test dependencies. Prevent flaky tests.
- A security feature that keeps the test code separate from the production code
  - This is repository organization or source separation.
- A strategy where only one developer is allowed to run tests at a time
  - This is serial execution, not test isolation.
- A rule that forces tests to only run on a specific version of the operating system
  - This is environment pinning or OS compatibility.

**Hint:** Independent tests without side effects?

### 28. What is continuous testing in CI/CD?

- **The automated execution of software tests as part of the software delivery pipeline** ✅
  - Continuous testing: automated gates before merge. Quick feedback.
- A manual process where a QA engineer tests the application every single day
  - This is manual regression, not continuous testing.
- A test that runs in an infinite loop until it finds a bug
  - This is "fuzzing" or "soak testing," not continuous testing.
- The practice of writing tests while the application is already running in production
  - This is live-environment monitoring or production testing.

**Hint:** Run tests automatically on every commit?

### 29. What is canary testing and canary deployment?

- **The process of releasing a new version of code to a small group of users to monitor performance** ✅
  - Canary testing: production testing with small traffic. Minimize risk.
- A specialized test designed to check the software’s compatibility with legacy browsers
  - This is cross-browser compatibility testing.
- The act of testing the application in a room filled with actual birds
  - This is not a technical concept in software engineering.
- A strategy where the test suite is executed by an AI that mimics a human user
  - This is AI-driven testing or bot testing.

**Hint:** Roll out changes to small subset first?

### 30. What is chaos engineering and chaos testing?

- **The discipline of experimenting on a system to ensure its ability to withstand turbulent conditions** ✅
  - Chaos engineering: proactively inject failures to find system weaknesses.
- A methodology where developers write code without any plan or documentation
  - This is disorganized development, not chaos engineering.
- A specialized test that checks for errors in the application’s mathematical formulas
  - This is logic or computational testing.
- The practice of running all tests at the same time on a single CPU core
  - This is resource contention testing or concurrency testing.

**Hint:** Inject failures to test resilience?
