A Syntax error is an error that occurs in the source code of the program. A syntax error prevents the program from being compiled as the computer cannot comprehend the task. A syntax error occurs when the programmer enters code into the program that does not follow the rules set by the programming language. Syntax errors are the products of human mistakes not mechanical.
A run-time error occurs while the program is running, this type of error would occur when the program understands what's being coded but has an issue while debugging the program. A type of run-time error would happen when a memory leak has occurred. This takes up more RAM space while the program is running and cases an infinite loop and prevents deallocating unused memory. This type of error occurs when the program is being debugged.
An error that occurs within the source code is being executed. When this occurs, the program will be producing incorrect behaviours and producing the incorrect outputs which lead to the application crashing. It is harder for a programmer to detect this as it will come up as a valid statement within the code but will have a different meaning. An example of this would be using the incorrect amount of equal sings such as "==" refers to as "is equal to", while "=" refers to "becomes".
The term ‘tracing output’ within this context is similar to ‘desk checking’ as you are ensuring your code works before compiling it with common knowledge. This is the same as the previous picture i’ve shown, but it’s the most simplistic way of showing how desk checking works.
This shows the line number, the calculation, the conditions and the input / output. This helps to ensure your code is possible to be executable to ensure no errors will be present.
The term systematically refers to a fixed plan or system, methodically. This term in coding refers to the steps the program takes to show you syntax errors and the way in which you can eliminate the error to allow the program to be executed. An example of this is in WordPress, it shows you the syntax error and gives you the following path in which you can fix the issue.
This applies to almost all coding platforms which have a compiler, because it won’t let the program run unless the syntax works properly. This prevents issues with certain parts of the program not working, as there is no point in a program to run incorrectly.
One way you can detect runtime errors is using boundary values. A boundary value is an extreme value that is still acceptable within the code.
Through boundary values, we test how well the code runs when the largest and lowest possible number is input. This allows us to detect whether there are runtime errors, specifically, whether if it crashes and if the input registers properly.
An example of where boundary values would need to be used is making passwords. In the example, partitions would have to be used which is demonstrated by the number line.
The number line tells us that scenarios where the number of characters are 0 and 7 would need to be tested and should be invalid. Then scenarios where the number of characters are 8 and 100 need to be tested and should be accepted. Finally, 101 and 107 characters need to be tested and should be invalid.
Through doing this, we are checking if the number of characters inputted and the action associated with them occurs, therefore reducing runtime errors.