Skip to content

Testing Tdd Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 50 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is a unit test?

Show ▼

A unit test verifies the behavior of a single, isolated piece of code (e.g., a function or method). Key characteristics:

  • Tests one logical unit in isolation
  • Dependencies are mocked or stubbed
  • Runs fast (milliseconds)
  • Deterministic and repeatable
Example in Jest:
test('add returns sum', () => { expect(add(2, 3)).toBe(5); });

What is an integration test?

Show ▼

An integration test verifies that multiple components work correctly together. Unlike unit tests, it exercises real interactions:

  • Tests communication between modules, services, or layers
  • May use real databases, APIs, or file systems
  • Slower than unit tests but catches interface bugs
  • Example: testing a controller that queries a real database

What is an end-to-end (E2E) test?

Show ▼

An E2E test simulates real user workflows through the entire application stack. It validates the system from the user's perspective:

  • Uses tools like Playwright, Cypress, or Selenium
  • Tests full user journeys (login → action → logout)
  • Slowest and most brittle test type
  • Catches integration issues across the whole system

What is the Test Pyramid?

Show ▼

The Test Pyramid is a testing strategy that recommends:

  • Base (most): Unit tests — fast, cheap, numerous
  • Middle: Integration tests — moderate speed and count
  • Top (fewest): E2E tests — slow, expensive, few
The idea is to have many small, fast tests and fewer large, slow ones. This gives fast feedback while still covering the full stack. Coined by Mike Cohn.

What is TDD (Test-Driven Development)?

Show ▼

TDD is a development practice where you write tests before writing production code. The cycle is:

  1. Red: Write a failing test for the desired behavior
  2. Green: Write the minimum code to make the test pass
  3. Refactor: Clean up the code while keeping tests green
Benefits: better design, fewer bugs, living documentation, and confidence in refactoring.

🎯 Take the Testing Tdd Practice Exam