🌍 Back-end Web Developement · subject

Back-end Web Developement Testing Syllabus

The Testing syllabus for Back-end Web Developement in full: 3 chapters and 7 topics, every one listed below, plus 50 Testing flashcards with answers.

3Chapters
7Topics
50Flashcards

Testing syllabus: all 3 chapters

Expand any chapter to see its topics and sub-topics.

  1. Unit Testing

    3 topics
    • JUnit
    • Mocha
    • PyTest
  2. Integration Testing

    2 topics
    • Postman
    • Selenium
  3. End-to-End Testing

    2 topics
    • Cypress
    • TestCafe

Back-end Web Developement Testing flashcards — 50 questions with answers

  1. What is unit testing?

    A software testing method where individual units or components of code (typically single functions, methods, or classes) are tested in isolation to verify they behave as expected.

  2. What is the difference between unit testing and integration testing?

    Unit testing verifies individual components in isolation (often with mocks/stubs), while integration testing verifies that multiple components work correctly together, including their interactions and data flow.

  3. What does the acronym in the AAA testing pattern stand for?

    Arrange, Act, Assert - a three-step structure for a test: set up data/preconditions (Arrange), execute the code under test (Act), and verify the outcome (Assert).

  4. In test suites, how is code coverage percentage calculated?

    $$\text{Coverage} = \frac{\text{lines (or branches) executed by tests}}{\text{total lines (or branches)}} \times 100\%$$

  5. What is a test double, and name its main types?

    A test double is any object that stands in for a real dependency during testing. Main types: dummy, stub, spy, mock, and fake.

  6. What programming language and framework family is JUnit built for?

    JUnit is a unit testing framework for the Java programming language, and is the reference member of the xUnit family.

  7. In JUnit 5, which annotation marks a method as a test?

    @Test - it marks a method to be run by the test runner as a test case.

  8. In JUnit 5, what are the annotations @BeforeEach and @AfterEach used for?

    @BeforeEach runs before every test method (setup), and @AfterEach runs after every test method (teardown), so each test starts from a fresh, known state.

  9. In JUnit 5, what is the difference between @BeforeAll and @BeforeEach?

    @BeforeAll runs once before all tests in the class (and must be static by default), while @BeforeEach runs before each individual test method.

  10. What are the three main modules that make up JUnit 5?

    JUnit Platform (launches test frameworks on the JVM), JUnit Jupiter (new programming and extension model/API), and JUnit Vintage (runs legacy JUnit 3 and 4 tests).

  11. In JUnit 5, which annotation is used to write a parameterized test, and how are inputs supplied?

    @ParameterizedTest marks the method; inputs are supplied via source annotations such as @ValueSource, @CsvSource, @MethodSource, or @EnumSource.

  12. In JUnit 5, how do you assert that a specific exception is thrown?

    Use assertThrows(ExpectedException.class, () -> code()), which fails the test if the executable does not throw the expected exception type and returns the thrown exception for further assertions.

  13. In JUnit 5, what does the @Disabled annotation do?

    It disables a test class or test method so it is skipped by the test runner (typically shown as skipped, not passed or failed).

  14. Which library is commonly paired with JUnit to create mock objects in Java?

    Mockito - it is used to create mocks, stubs, and spies for dependencies so units can be tested in isolation.

  15. What is Mocha, and what environment does it primarily run in?

    Mocha is a feature-rich JavaScript test framework that runs on Node.js and in the browser, providing the test structure (describe/it) but not assertions by default.

  16. In Mocha, what is the purpose of the describe() and it() functions?

    describe() groups related tests into a suite (and can be nested), while it() defines an individual test case containing the assertions.

  17. Why is Mocha often paired with a separate assertion library such as Chai?

    Because Mocha does not ship with its own assertion library; Chai (or Node's assert) provides the assertion styles (expect, should, assert) needed to verify results.

  18. In Mocha, what are the four main hooks for setup and teardown?

    before() (once before all tests in a block), after() (once after all), beforeEach() (before each test), and afterEach() (after each test).

  19. How do you test asynchronous code in Mocha?

    Either accept a done callback and call done() when finished, or return a Promise / use an async function so Mocha waits for it to resolve.

  20. In Mocha, how do you run only or skip a specific test?

    Use .only (e.g. it.only or describe.only) to run just that test/suite, and .skip (e.g. it.skip) to skip it.

Show the other 30 Testing flashcards
  1. What is PyTest?

    PyTest is a mature, full-featured testing framework for Python that supports simple assert-based tests, fixtures, parameterization, and a rich plugin ecosystem.

  2. How does PyTest discover test files and functions by default?

    By default it collects files matching test_*.py or *_test.py, and within them functions prefixed with test_ (and methods in classes prefixed with Test).

  3. Why does PyTest not require special assertion methods like assertEqual?

    PyTest rewrites the plain Python assert statement to provide detailed introspection on failure, so you can just write assert x == y instead of using methods like self.assertEqual.

  4. What is a fixture in PyTest and how is one defined?

    A fixture provides a fixed baseline/setup (e.g. data, resources) for tests. It is defined with the @pytest.fixture decorator, and tests receive it by declaring its name as a function argument.

  5. In PyTest, which decorator is used for parameterized tests?

    @pytest.mark.parametrize, which runs the test once for each set of supplied argument values.

  6. In PyTest, how do you assert that a block of code raises an exception?

    Use the context manager: with pytest.raises(ExpectedError): ... - the test passes only if the expected exception is raised inside the block.

  7. What are PyTest fixture scopes, and name them from narrowest to broadest?

    Scope controls how often a fixture is set up/torn down: function (default), class, module, package, and session (broadest, once per test session).

  8. What is Postman primarily used to test?

    Postman is an API development and testing platform used to build, send, and automate HTTP requests to test REST, SOAP, and GraphQL APIs and their responses.

  9. In Postman, what is a Collection?

    A Collection is a group of saved API requests (optionally organized into folders) that can be run, shared, and automated together as a suite.

  10. In which scripting language are Postman test scripts written, and where do they run?

    They are written in JavaScript and run in Postman's sandbox - either as pre-request scripts (before the request) or as test scripts (after the response).

  11. In Postman, how do you write an assertion on a response?

    Using pm.test("name", function(){ ... }) with assertions like pm.response.to.have.status(200) or pm.expect(value).to.eql(expected).

  12. What is the purpose of environment and collection variables in Postman?

    They store reusable values (like base URLs, tokens, or IDs) so requests can be parameterized and easily switched between contexts such as dev, staging, and production.

  13. What is Newman in the Postman ecosystem?

    Newman is Postman's command-line collection runner, used to execute Postman collections from the terminal or a CI/CD pipeline.

  14. What is Selenium and what does it automate?

    Selenium is an open-source suite for automating real web browsers, primarily used for functional and end-to-end testing of web applications across different browsers.

  15. What is Selenium WebDriver?

    WebDriver is the core Selenium component/API that drives a browser natively by communicating with browser-specific drivers (e.g. ChromeDriver, GeckoDriver) to simulate user actions.

  16. Name several programming languages officially supported by Selenium WebDriver.

    Java, Python, C#, Ruby, and JavaScript (among others) - Selenium provides language bindings for each.

  17. In Selenium, what are locators and give common examples.

    Locators are strategies to find elements on a page. Common ones: id, name, className, tagName, linkText, partialLinkText, CSS selector, and XPath.

  18. What is the difference between implicit and explicit waits in Selenium?

    An implicit wait sets a global timeout to poll for any element before failing, while an explicit wait (WebDriverWait) waits for a specific condition on a specific element and is generally preferred.

  19. What is Selenium Grid used for?

    Selenium Grid enables running tests in parallel across multiple machines, browsers, and operating systems by distributing tests to remote nodes via a hub/router.

  20. What is Cypress and what type of testing is it designed for?

    Cypress is a JavaScript-based front-end testing tool built for fast, reliable end-to-end, integration, and component testing of anything that runs in a browser.

  21. A key architectural difference: how does Cypress run relative to the application, compared to Selenium?

    Cypress runs directly inside the browser in the same run loop as the application (in-process), whereas Selenium controls the browser remotely from outside over a wire protocol.

  22. In Cypress, what does the cy object represent?

    cy is the global command object used to issue Cypress commands, e.g. cy.visit(), cy.get(), cy.click(), and cy.contains().

  23. What is automatic waiting (retry-ability) in Cypress?

    Cypress automatically waits and retries commands and assertions until the element appears/condition is met or a timeout is reached, reducing the need for manual/hard-coded waits.

  24. In Cypress, how do you make assertions?

    Using .should() or .and() with Chai-style assertions (e.g. cy.get('.item').should('have.length', 3)), or explicit expect() inside .then() blocks.

  25. What is a major browser limitation of Cypress compared to Selenium?

    Cypress historically supports a narrower set of browsers (Chromium-family, Firefox, WebKit/Electron) and runs tests only in JavaScript, while Selenium supports more browsers and many languages.

  26. What is TestCafe and what is its standout setup advantage?

    TestCafe is a Node.js-based end-to-end web testing framework whose standout advantage is that it requires no WebDriver or browser plugins/extensions - it works out of the box.

  27. How does TestCafe inject its automation into the page without WebDriver?

    It uses a URL-rewriting proxy (a reverse proxy) that injects the driver script into the page, letting it drive the browser without any external driver or browser extension.

  28. In TestCafe, what do fixture() and test() define?

    fixture() declares a group of tests (a page/feature under test), and test() defines an individual test case, which receives a t test controller for actions and assertions.

  29. How does TestCafe handle waiting for elements and requests?

    TestCafe has built-in automatic (smart) waiting for page loads, XHR/fetch requests, and elements, so explicit sleeps are usually unnecessary.

  30. Compare Selenium, Cypress, and TestCafe by their core technology/language.

    Selenium uses the WebDriver protocol with bindings in many languages (Java, Python, C#, etc.); Cypress runs in-browser and is JavaScript/TypeScript only; TestCafe is a proxy-based Node.js tool written in JavaScript/TypeScript that needs no WebDriver.

Back-end Web Developement Testing FAQ

What is in the Back-end Web Developement Testing syllabus?

Back-end Web Developement Testing is split into 3 chapters: Unit Testing, Integration Testing and End-to-End Testing. Together they contain 7 topics.

How many chapters are in Back-end Web Developement Testing?

3 chapters, containing 7 topics. The largest chapter is Unit Testing, with 3 topics.

Are there flashcards for Back-end Web Developement Testing?

Yes — a 50-card Testing deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.