1.4 Video Notes

  • types of errors:
    • Logic Error= mistake in the algorithim or program that causes it to behave incorrectly or unexpectedly
    • Syntax Error= mistake in the program where the rules of the programming language are not followed (like missing a ;)
    • Run-time Error(bug)= a mistake in the program that occurs during the execution of a program (program lang. define own runtime errors)
    • Overflow Error= an error that occurs when a computer attempts to handle a number that is outside of the defined range of values
  • Effective ways to find and correct errors:
    • test cases, border cases (ex. )
    • hand tracing
    • visualizations
    • debuggers
    • adding extra output statement(s)
  • Syntax errors= usually info is provided by integrated development environments to programmer to the line where error occurs
  • logic errors= not always noticed immediately, so use test cases= how do we know the program doesn’t work?, use multiple tests, figure out how to correct error
  • hand tracing= most useful for iteration (loops)= writing out the values of the variables within loop as it iteraties to determine if outcome is correct
  • Visualizations/Debuggers= show graphs, images, color, etc. that help determine if a program is working correctly
  • Testing uses defined inputs to ensure that an algorithim or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs.
  • degined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes of input data
  • program requirements are needed to identify appropriate defined inputs for testing
  • program specifications list the behaviors, events, and corresponding responses/outputs the program is to support (are these met?)

Identifying and Correcting Errors Quiz

I feel like these questions are better than the more conceptual quizzes because you are able to look at code and determine what the errors are instead of writing the code or describing what is happening.