Collaboration Program Function and Purpose Program Design and Development Identifying and Correcting Errors

CollegeBoard Unit: Identifying and Correcting Errors

Errors in programming happen all the time but many people have a very hard time understanding what errors there are and how to solve them. Understanding the different errors is essential to becoming a proficient programmer. CRD - 2.I.1 says that a logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly. CRD 2.I.2 says that a syntax error is a mistake in the program where the rules of programming language are not followed. CRD - 2.I.5 says that test cases, hand tracing, visualizations, debuggers, and adding extra output statements are effective ways to find and correct errors. CRD - 2.J.2 is defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes of input data.

CollegeBoard Videos 1.4 Videos 1, 2, and 3

Video 1:

  • There are 4 types of errors, a logic error, a syntax error, a run-time error, and an overflow error
  • Programmers that are proficient should be able to notice all three types of errors
  • Logic Error: Caused by the programmer making a mistake in the algorithm which causes the program to behave unexpectedly
  • Syntax Error: A mistake when a programmer makes a typo or writes some code or forgets to write code, or maybe wrote code that doesn’t follow the program’s language rules and cause the program to fail
  • Run-Time Error: This causes the program to fail while running and is commonly known as a bug and to identify it, the program runs initially but fails and can’t complete its processes
  • Overflow Error: An overflow error is when a program is required to perform a calculation that is outside of defined range of values. Due to memory allocation constraints that programming languages require, certain values are too big to calculate or display.

Video 2:

  • The easiest error to identify is usually the syntax error
  • Most IDE’s display information when there is no syntax error
  • The error usually shows where the error happened and tells people what to fix
  • Logic Errors are hard to find and correct which are not always noticed all the time and using test cases is the first strategy programmers use to find logic errors
  • A logic error is immediately noticed and using test cases is the first strategy programmers use to find logic errors
  • Hand tracing is another strategy and is useful with iteration or loops
  • Hand tracing can be useful for small code segments and loops that iterate a small number of times
  • Hand tracing can show that the algorithm was actually just displaying the last time a number was less than number after the list
  • Visualizations show graphs, images, color, and etc that can help determine if a program is working correctly
  • Debuggers use software designed to run a program allowing it to be paused and tested in the midst of running to determine if it is working properly

Video 3:

  • Developers must start testing the program and need to think about it
  • The program specifications list the behaviors, events, and corresponding reponses/outputs the program is to support
  • Programmers need to define inputs that will determine whether or not the specifications are met
  • Once inputs and corresponding outputs are determined, programmers test, test, and test
  • After testing, programmers use the results the revise, refine, and improve their programs
  • Programmers have to test a program many times to make sure that everything is working
  • Programmers have to test and then the users have to test and then the programmers change even more
  • After a lot of testing, the program is finally released to other people

CollegeBoard Quiz: Identifying and Correcting Errors Quiz

I took the CollegeBoard quiz about Identifying and Correcting Errors and out of the 3 questions, I got 3 of the questions right showing that I understand the topic and I can use what I learned to make myself a better developer and understand what errors happened and how to fix them. This quiz was a little hard especially on the first question because I did not really know how to do it, and I was between two answers, but now I understand it.

Takeaways

Developers face errors all the time and they need to make sure that they have to test a program a lot. There are many types of different errors like the logic error, syntax error, run-time error, and the overflow error. They have to test the program as much as they can and they test it and then get some users to test the program and find errors. When you get an error, there are many changes you can make, and the first step is to identify what the error is and how to solve it. The process of code is long and they need to make sure that everything is working. There are many ways to solve an error and one of them is hand tracing and you can use that to improve your code.