Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
25.1.1. Definition
This section
Practice test
11 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is unit testing?
Hint
Think about how you test your code while writing it.
- 2.
Name one key characteristic of unit testing.
Hint
In programming, what does 'unit' refer to?
- 3.
What does unit testing primarily focus on?
- Whole system
- Individual components
- User acceptance
Hint
Think about the smallest parts of a program.
- 4.
Unit testing is performed by:
- Developers
- Testers
Hint
Who is writing the code usually?
- 5.
Create a sample unit test for a method 'multiply(int a, int b)' that returns the product of two numbers.
Hint
What does your assertion look like in code?
- 6.
Explain how refactoring code might be impacted by the presence of unit tests.
Hint
Think about how tests provide feedback during development.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
1 more question available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting