HomeSubjectsUniversityBlogAbout

Web Testing & Debugging

Topic in Web Development

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

Web testing is the process of checking that a web application behaves correctly, from single functions to full user journeys. Debugging is the related work of finding and fixing defects. MCQs describe the testing pyramid, with many unit tests, fewer integration tests and a small number of end-to-end tests. You should know tools such as Jest and Mocha for unit tests, React Testing Library for components, and Cypress, Playwright or Selenium for browser automation. Terms like assertions, mocks, stubs and spies, code coverage, test-driven development, regression testing and snapshot tests are common. Debugging items cover browser DevTools breakpoints, the console, network inspection, mutation testing and visual regression testing.

Below are 30 practice questions from a pool of 210 Web Testing & Debugging MCQs, one of 17 topics in Web Development. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Web Testing & DebuggingEasy

Q1. What is unit testing?

  1. A.Testing individual functions of code in isolation✓ Correct
  2. B.Testing the entire application end to end
  3. C.Testing only the database layer and queries
  4. D.Testing CSS styles across different browsers

Explanation

Unit testing verifies that individual functions work correctly in isolation.

Report an error in this question

Web Testing & DebuggingEasy

Q2. What is a bug in software?

  1. A.A planned feature in the software design
  2. B.A CSS property that is incorrectly applied
  3. C.An error in code causing unexpected behavior✓ Correct
  4. D.A computer virus that damages system files

Explanation

A bug is a defect that causes incorrect or unexpected results.

Report an error in this question

Web Testing & DebuggingEasy

Q3. What is the browser developer console used for?

  1. A.Writing CSS styles for page elements
  2. B.Managing database records and schemas
  3. C.Debugging JavaScript and inspecting elements✓ Correct
  4. D.Designing web page visual layouts

Explanation

The developer console provides tools for debugging and inspecting web applications.

Report an error in this question

Web Testing & DebuggingEasy

Q4. What is console.log() used for in debugging?

  1. A.Creating a user activity log in the database
  2. B.Outputting values to the console for inspection✓ Correct
  3. C.Sending logs to the remote server for storage
  4. D.Creating log files on the server disk

Explanation

console.log() prints values to the console for inspection during debugging.

Report an error in this question

Web Testing & DebuggingEasy

Q5. What is a test case?

  1. A.Conditions to verify a feature works correctly✓ Correct
  2. B.A computer case for housing hardware
  3. C.A CSS container for grouping styled elements
  4. D.A JavaScript class for creating object types

Explanation

A test case defines inputs, conditions, and expected results to verify a feature.

Report an error in this question

Web Testing & DebuggingEasy

Q6. What is manual testing?

  1. A.Testing with reference to user documentation
  2. B.Testing only the documentation for accuracy
  3. C.Testing performed using automated tools
  4. D.Testing software by hand without automation✓ Correct

Explanation

Manual testing involves a human tester executing test cases by hand.

Report an error in this question

Web Testing & DebuggingEasy

Q7. What does a breakpoint do in debugging?

  1. A.Pauses code execution at a specific line for inspection✓ Correct
  2. B.Breaks the code permanently so it stops running
  3. C.Breaks the CSS layout causing elements to misalign
  4. D.Creates a responsive breakpoint for media queries

Explanation

A breakpoint pauses execution at a designated line.

Report an error in this question

Web Testing & DebuggingEasy

Q8. What is the Network tab in browser DevTools for?

  1. A.Managing network configuration settings in browser
  2. B.Creating network topology diagrams for documentation
  3. C.Connecting to WiFi network for internet access
  4. D.Monitoring HTTP requests, responses, and their timing✓ Correct

Explanation

The Network tab shows all HTTP requests made by the page.

Report an error in this question

Web Testing & DebuggingEasy

Q9. What is regression testing?

  1. A.Re-testing features after changes to check nothing broke✓ Correct
  2. B.Testing CSS regression across different browsers
  3. C.Testing database regression after schema updates
  4. D.Testing a feature for the very first time

Explanation

Regression testing verifies that features still work after changes.

Report an error in this question

Web Testing & DebuggingEasy

Q10. What is a linter?

  1. A.A debugger for stepping through code execution
  2. B.A CSS framework for responsive page layouts
  3. C.A testing framework for automated unit testing
  4. D.A tool analyzing code for errors and style violations✓ Correct

Explanation

A linter statically analyzes code to detect errors and style inconsistencies.

Report an error in this question

Web Testing & DebuggingMedium

Q11. What is integration testing?

  1. A.Testing CSS integration across page components
  2. B.Testing only the user interface visual appearance
  3. C.Testing individual functions in complete isolation
  4. D.Testing how multiple modules work together as a group✓ Correct

Explanation

Integration testing verifies that different modules work correctly together.

Report an error in this question

Web Testing & DebuggingMedium

Q12. What is end-to-end (E2E) testing?

  1. A.Testing from start to finish of the codebase
  2. B.Testing exclusively the backend server logic only
  3. C.Testing the complete application from user perspective✓ Correct
  4. D.Testing only a single API endpoint in isolation

Explanation

E2E testing simulates real user scenarios across the entire application stack.

Report an error in this question

Web Testing & DebuggingMedium

Q13. What is Jest?

  1. A.A JavaScript testing framework for unit and integration tests✓ Correct
  2. B.A web server for hosting test environments and staging
  3. C.A database tool for testing query performance and accuracy
  4. D.A CSS framework for responsive web design

Explanation

Jest is a popular JavaScript testing framework with built-in assertions and mocking.

Report an error in this question

Web Testing & DebuggingMedium

Q14. What is Cypress used for?

  1. A.API testing only without any browser interaction
  2. B.End-to-end testing of web apps in a real browser✓ Correct
  3. C.CSS processing and compilation of style files
  4. D.Database testing for query performance and accuracy

Explanation

Cypress is an E2E testing framework that runs tests in a real browser.

Report an error in this question

Web Testing & DebuggingMedium

Q15. What is mocking in testing?

  1. A.Making fun of poorly written source code
  2. B.Creating fake implementations to isolate tested code✓ Correct
  3. C.A debugging method tracking variable value changes
  4. D.A CSS technique simulating dynamic state changes

Explanation

Mocking replaces real dependencies with controlled fake versions.

Report an error in this question

Web Testing & DebuggingMedium

Q16. What is code coverage?

  1. A.Covering code with explanatory inline comments
  2. B.A security feature for protecting sensitive source code files
  3. C.A metric measuring what percentage of code tests execute✓ Correct
  4. D.A CSS overlay property for stacking visual layer elements

Explanation

Code coverage measures the percentage of code executed by tests.

Report an error in this question

Web Testing & DebuggingMedium

Q17. What is Test-Driven Development (TDD)?

  1. A.Writing tests before code, then implementing to pass✓ Correct
  2. B.Developing tests after all code is fully written
  3. C.A debugging technique for tracing execution flow
  4. D.A testing framework for running automated test suites

Explanation

TDD writes a failing test first, then writes code to pass it.

Report an error in this question

Web Testing & DebuggingMedium

Q18. What is a test suite?

  1. A.A hotel suite used for testing software
  2. B.A debugging tool for inspecting test output data
  3. C.A collection of related test cases grouped together✓ Correct
  4. D.A CSS test framework for visual regression testing

Explanation

A test suite is a group of related test cases.

Report an error in this question

Web Testing & DebuggingMedium

Q19. What is snapshot testing?

  1. A.Comparing current output against a stored reference✓ Correct
  2. B.A database backup for point-in-time recovery
  3. C.A version control feature for branching code
  4. D.Taking screenshots of the application pages

Explanation

Snapshot testing compares serialized output against a reference.

Report an error in this question

Web Testing & DebuggingMedium

Q20. What is the purpose of assertion libraries?

  1. A.To assert database values match expected outputs
  2. B.To create assertions within HTML for validation
  3. C.To provide methods verifying expected code results✓ Correct
  4. D.To assert CSS values match the design mockups

Explanation

Assertion libraries verify expected outcomes in test cases.

Report an error in this question

Web Testing & DebuggingHard

Q21. What is the testing pyramid?

  1. A.A database structure for hierarchical data storage
  2. B.A pyramid-shaped test data structure for storage
  3. C.Many unit tests, fewer integration, fewest E2E tests✓ Correct
  4. D.A CSS shape rendered using clip-path properties

Explanation

The testing pyramid recommends many unit tests, fewer integration, and very few E2E tests.

Report an error in this question

Web Testing & DebuggingHard

Q22. What is mutation testing?

  1. A.Testing DNA sequences in bioinformatics research
  2. B.Testing code changes before merging into main branch
  3. C.Database mutation testing for verifying data integrity
  4. D.Introducing small code changes to verify tests detect them✓ Correct

Explanation

Mutation testing modifies source code and checks if tests catch the changes.

Report an error in this question

Web Testing & DebuggingHard

Q23. What is the difference between stubs and mocks?

  1. A.Mocks are simpler and less capable than stub versions
  2. B.They are identical in their testing approach
  3. C.Stubs give predetermined responses; mocks verify interactions✓ Correct
  4. D.Stubs verify that specific method interactions occurred

Explanation

Stubs return predefined data, while mocks also verify specific method calls.

Report an error in this question

Web Testing & DebuggingHard

Q24. What is visual regression testing?

  1. A.Testing CSS variables across different components
  2. B.Testing image quality and resolution across screen sizes
  3. C.Testing color contrast for accessibility compliance
  4. D.Comparing screenshots across versions for visual changes✓ Correct

Explanation

Visual regression testing compares screenshots pixel-by-pixel to detect UI changes.

Report an error in this question

Web Testing & DebuggingHard

Q25. What is contract testing in microservices?

  1. A.Legal testing of software license agreements
  2. B.CSS contract testing for cross-browser consistency
  3. C.Testing employment contracts for HR compliance
  4. D.Verifying services communicate per agreed interfaces✓ Correct

Explanation

Contract testing ensures API providers and consumers agree on request/response formats.

Report an error in this question

Web Testing & DebuggingHard

Q26. What is fuzz testing?

  1. A.Testing with blurry images for visual quality checks
  2. B.Providing random invalid data to find vulnerabilities✓ Correct
  3. C.Testing with fuzzy logic algorithms for AI systems
  4. D.CSS filter testing for verifying blur effect output

Explanation

Fuzz testing bombards software with random input to discover vulnerabilities.

Report an error in this question

Web Testing & DebuggingHard

Q27. What is the purpose of Selenium?

  1. A.A JavaScript runtime for executing server-side scripts
  2. B.A framework for automating browser testing interactions✓ Correct
  3. C.A CSS preprocessor for compiling advanced style syntax
  4. D.A chemical element found in nature supplements

Explanation

Selenium automates web browser actions for cross-browser E2E testing.

Report an error in this question

Web Testing & DebuggingHard

Q28. What is Playwright?

  1. A.A CSS animation tool for creating transition effects
  2. B.A theater tool for managing stage performances
  3. C.A modern testing framework with auto-wait and isolation✓ Correct
  4. D.A database testing tool for verifying query accuracy

Explanation

Playwright offers modern features like auto-waiting and browser context isolation.

Report an error in this question

Web Testing & DebuggingHard

Q29. What is chaos engineering?

  1. A.A random testing approach without defined test cases
  2. B.Random coding without any structure or planning
  3. C.Deliberately introducing failures to test resilience✓ Correct
  4. D.A messy code style ignoring best practices rules

Explanation

Chaos engineering injects failures to verify the system handles them gracefully.

Report an error in this question

Web Testing & DebuggingHard

Q30. What is the difference between black-box and white-box testing?

  1. A.Black-box tests without code knowledge; white-box tests with✓ Correct
  2. B.They are identical in their testing methodology
  3. C.Black-box testing requires full access to source code
  4. D.White-box testing ignores internal implementation details

Explanation

Black-box evaluates functionality without seeing code, white-box uses knowledge of internal structure.

Report an error in this question

Ready to test yourself on Web Testing & Debugging?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Web Testing & Debugging Quiz