| CMSC 201 |
Lab 8: DebuggingDebuggingIn this lab, you will be working on fixing two programs- one with syntax problems, and one with semantic problems. Ideally, all code you write should be tested incrementally. Incremental testing means that you write a small amount of code, test it, and once you know it's working you proceed. Another name for this is unit testing. Example of Unit Testing: First, we write some code:
def isNumEven(value):
if (value % 2 == 0):
return True
else:
return False
def main():
print("Is 2 even?",isNumEven(2))
print("Is 3 even?",isNumEven(3))
main()
Output: |