Learn naming patterns for tests: should, given/when/then, behaviour description.
0 / 10 completed
1 / 10
Which test name follows the 'should' naming convention?
'should return zero when the cart is empty' follows the 'should' convention — stating what the system under test should do in plain English. It is readable as a specification.
2 / 10
Which test name follows the 'MethodName_StateUnderTest_ExpectedBehaviour' pattern?
login_whenCredentialsAreValid_returnsTrue() follows the MethodName_StateUnderTest_ExpectedBehaviour naming pattern, clearly stating what is tested and the expected result.
3 / 10
What is a 'test double' in TDD vocabulary?
A test double is any object that replaces a real dependency in a test. Types include: stub (returns fixed values), mock (verifies interactions), fake (simplified working implementation), and spy (records calls).
4 / 10
What does 'test isolation' mean in TDD?
Test isolation means each test sets up its own state and does not depend on or affect other tests. Tests should be runnable in any order and produce the same result.
5 / 10
What is a 'fast unit test' in TDD vocabulary?
Fast unit tests run in milliseconds because they test small units (functions, classes) in isolation with test doubles replacing real I/O. TDD relies on fast tests for a tight feedback loop.
6 / 10
During a code review of a new payment processing service, Alice comments on a test named 'Test_Payment_Successful'. Bob suggests renaming it. Which naming convention is Bob referencing?
Bob is referring to Behavior-Driven Development (BDD), a naming convention that emphasizes describing the *behavior* of the system under test. 'Should' describes a condition, while Given-When-Then outlines the steps in a test scenario. The 'Should' approach focuses on expressing what the code *should* do, not the specific details of how it does it.
7 / 10
You're writing a PR description for a new feature in your e-commerce platform. A colleague suggests using the 'MethodName_StateUnderTest_ExpectedBehaviour' pattern for test names. What is the primary benefit of this approach?
The 'MethodName_StateUnderTest_ExpectedBehaviour' pattern is designed for clarity. It explicitly states which method is being tested, the system's state before the test, and the expected outcome. This makes debugging failures much easier because you immediately know what to examine.
8 / 10
In a Slack channel discussing testing strategies, David says, "We need test doubles to isolate our business logic from external dependencies." What does David mean in this context?
A 'fake' or 'stub' test double is designed to mimic the *interface* of a dependency without actually implementing its full functionality. This isolation allows you to test your business logic independently, preventing external factors (like database connectivity issues) from causing false positives or negatives in your tests. Mocks and stubs are different types of doubles with different purposes.
9 / 10
During a standup meeting, Maria says, "I'm writing fast unit tests to quickly verify the core functionality of my API endpoint." What does 'fast unit test' typically imply in TDD?
'Fast unit tests' refer to tests designed for speed. They are usually short, simple tests focused on verifying the most critical functionality – primarily positive scenarios. The goal is quick feedback during development, not exhaustive testing of all possible edge cases, which would be handled by more comprehensive integration or end-to-end tests.
10 / 10
Reviewing a test case in a code review tool, you see the name 'Payment_Successful_Refund'. What aspect of test naming is this example illustrating?
This test name exemplifies Behavior-Driven Development (BDD). It clearly states what is being tested (Payment), the expected outcome (Successful), and the related scenario (Refund). The naming convention aims to describe the *behavior* of the system, making it easy for anyone to understand the purpose of the test.
What will I learn from the "Test Naming Conventions — Vocabulary and Language" exercise?
Learn naming patterns for tests: should, given/when/then, behaviour description.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall required.
How many questions are in this exercise?
This set contains 10 multiple-choice questions, each with a detailed explanation shown after you answer.
Do I need to create an account to track my progress?
No account is required. Your progress bar and score reset each time you reload the page, but you can retry the exercise as many times as you like.
Who is this TDD/BDD Language exercise for?
This exercise is built for IT professionals and non-native English speakers who need to read, write, and discuss tdd/bdd language topics confidently at work.
What happens if I answer a question incorrectly?
You will see the correct answer highlighted along with a detailed explanation of why it is correct -- so every wrong answer becomes a learning moment, not just a lost point.
Can I retry this exercise?
Yes -- click "Try again" on the results screen at any time to reset your score and go through all the questions again.
How long does this exercise take to complete?
Most learners finish all 10 questions in under 10 minutes, since each question is answered by clicking a single option.
Where can I find more TDD/BDD Language exercises?
See the full TDD/BDD Language exercises hub for more vocabulary drills on this topic.
Is this exercise mobile-friendly?
Yes -- the exercise works on any device with a modern browser, including phones and tablets, with no app download required.