You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides some guidance on how to write tests that cover four categories:
Normal Cases: Typical input that should follow the main path through the code.
Opposites: Cases that return opposite outputs (e.g. TRUE and FALSE).
Large Cases: Typical input, but of a larger size than usual. This ensures that bugs don’t appear after multiple iterations.
Edge Cases: Pairs of inputs that test different choice points in the code. For example, if a condition in the problem checks whether n < 2, two important edge cases are when n = 2 and n = 3, which trigger different behaviors. Other edge cases include the first / last characters in a string or items in a list.
Special Cases: Some inputs need to be special-cased for many problems. This includes negative numbers, 0 and 1 for integers, the empty string (""), and input values of different types than are expected.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context
Provides some guidance on how to write tests that cover four categories:
URL
https://p4a.jhelvy.com/testing-debugging#test-case-types
Suggested labels
Best Practice, Testing, Code coverage
Beta Was this translation helpful? Give feedback.
All reactions