Recall & Review
beginner
What is unit testing?
Unit testing is the process of testing small parts of a program, called units, to make sure each part works correctly on its own.
Click to reveal answer
beginner
Why do we write unit tests?
We write unit tests to catch mistakes early, make fixing bugs easier, and help keep code working well when we change it later.
Click to reveal answer
beginner
What is a test case in unit testing?
A test case is a set of instructions that checks if a small part of the program behaves as expected with certain inputs.
Click to reveal answer
beginner
What does it mean if a unit test fails?
If a unit test fails, it means the part of the program tested did not work as expected and needs fixing.
Click to reveal answer
beginner
Name one benefit of automated unit testing.
Automated unit testing saves time by running tests quickly and often without needing a person to do it each time.
Click to reveal answer
What does a unit test check?
✗ Incorrect
Unit tests focus on small parts, or units, of the program to verify they work correctly.
When should unit tests be run?
✗ Incorrect
Running unit tests often during development helps catch problems early.
What is a test case in unit testing?
✗ Incorrect
A test case defines inputs and expected results to check if code works as intended.
If a unit test fails, what should you do?
✗ Incorrect
A failing test means something is wrong and needs fixing.
Which is a benefit of automated unit tests?
✗ Incorrect
Automated tests save time by running tests fast and often without manual effort.
Explain what unit testing is and why it is important.
Think about testing one small piece of a program at a time.
You got /4 concepts.
Describe what a test case is and what it should include.
A test case is like a recipe for checking if code works.
You got /4 concepts.