Which layer of the Test Automation Pyramid typically contains the most tests and runs the fastest?
Think about which tests check small pieces of code and run quickly.
Unit tests are at the bottom of the pyramid, are the most numerous, and run the fastest because they test small parts of the code in isolation.
What is the main role of integration tests in the Test Automation Pyramid?
Integration tests check connections between parts, not just one part alone.
Integration tests verify that different modules or components work together correctly, which is the middle layer of the pyramid.
Given this test suite execution order, which layer is being tested first?
def run_tests(): print('Running unit tests') print('Running integration tests') print('Running end-to-end tests') run_tests()
Look at the first print statement inside the function.
The first print statement shows 'Running unit tests', indicating unit tests run first in the suite.
Which assertion correctly checks that a function add(a, b) returns 5 when called with 2 and 3?
def add(a, b): return a + b
Remember the syntax for equality comparison in assertions.
Option C uses the correct syntax and logic to assert the function returns 5.
In a continuous integration pipeline, which test type from the Test Automation Pyramid should run first to provide the fastest feedback?
Think about which tests are fastest and easiest to run automatically.
Unit tests run quickly and provide immediate feedback, making them ideal for early CI pipeline stages.