Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in 'Defensive Programming' #692

noornk opened this issue Aug 16, 2019 · 0 comments


Copy link

commented Aug 16, 2019

Hi! So in "Defensive Programming", for the get_total() function, as it's not logical to have a negative number of cars, we should add an assertion, a precondition, to check that. Other thing is that we have a post-condition that checks if the total is bigger than zero, while it makes sense if the total is zero, but again if there was the pre-condition, it would help with this case too :)
"Defensive Programming":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.