Shopping Cart – Part 1
Test-Driven Development: write tests before writing code.
Unit testing results in modular code. Modular code is:
- easy to test.
- immune to bugs.
- easy to understand.
- scalable.
Setup
Test Cases
Inside requirements.txt
, identify meaningful test cases:
- adding an item if not already added
[identify test case 1]
[identify test case 2]
- removing an item
[identify test case 3]
[identify state exception test case]
- checkout
[identify test case 5]
[identify test case 6]
[identify test case 7]
[identify state exception test case]
Should I test the getters/setters/constructors?
No. They don't offer meaningful logic that's worth unit testing.
Good Luck!
Feedback Summary
4.7
43 students
5
91%
4
2%
3
0%
2
0%
1
7%
Written Reviews
There are no written reviews yet.