Podcast
Questions and Answers
What is troubleshooting?
What is troubleshooting?
Process of identifying and resolving a problem, error, or fault within a software or a computer system.
Which of the following are types of errors in programming? (Select all that apply)
Which of the following are types of errors in programming? (Select all that apply)
- Linker errors (correct)
- Compilation errors (correct)
- Logic errors (correct)
- Syntax errors
- Runtime errors (correct)
What are compilation errors?
What are compilation errors?
Errors reported when the code is compiled due to syntax errors.
What is the result of logic errors in a program?
What is the result of logic errors in a program?
What are runtime errors?
What are runtime errors?
Which of the following is a debugging technique? (Select all that apply)
Which of the following is a debugging technique? (Select all that apply)
To compile a program, click on Build --> ______ Solution.
To compile a program, click on Build --> ______ Solution.
To run a program continuously and debug, click on Debug --> ______ Debugging.
To run a program continuously and debug, click on Debug --> ______ Debugging.
What must be done to fix compiler errors?
What must be done to fix compiler errors?
Flashcards are hidden until you start studying
Study Notes
Troubleshooting
- The process of identifying and resolving problems, errors, or faults within software or a computer system.
Types of Errors
-
Compilation Errors: Reported when the code is compiled
- Compiler Warnings:
- Will not prevent code compilation.
- Should not be ignored, as they often indicate possible runtime or logic errors.
- Compiler Errors:
- Must be fixed for the code to compile.
- The result of syntax errors, where the code doesn't conform to the programming language's syntax and the compiler cannot understand it.
- Examples include extra brackets or missing semicolons.
- Normally include a line number where the error is found.
- Compiler Warnings:
-
Linker Errors: Occur at the linking stage.
- Indicate that the code compiles but functions, libraries, or global variables used by the program have been declared but not defined.
-
Logic Errors: Cause incorrect program output or results.
- Indicate that the code contains incorrect logic (aka "bugs").
-
Runtime Errors: Occur during the execution of the program.
- Caused by wrong user input, hardware failures (like lack of resources – memory space, disk space, etc.), network connection failure, or certain mathematical operations (e.g., division by 0, square root of a negative number, etc.).
Debugging
- The process of finding and removing errors, called "bugs", in a computer program.
- Errors must be corrected to allow proper program execution.
Debugging Techniques
- Local Debugging: Debugging a program on the same computer where the program is running.
- Remote Debugging: Debugging a program on a different computer than where the program is running.
- Breakpoints: Points in the code where execution is halted. Allows examination of program state.
- Trace Output: Printing statements to see what data is being processed.
- Dump Files: Files generated to capture program state at a specific point.
- Log Files: Text files that record events during program execution.
Using MS Visual Studio
- Compile a Program:
- Click Build ïƒ Build Solution (for a new program) or Build ïƒ Rebuild Solution (for a program previously compiled).
- Run a Program Continuously (and Debug):
- Click Debug ïƒ Start Debugging OR click on the green "play" button.
- Run a Program One Line at a Time:
- Click Debug ïƒ Step Into (or F11) and then click Debug ïƒ Step Over (or F10) to execute one line of code at a time.
- A yellow arrow points to the next statement to be executed.
- Monitor Variables:
- Click Debug ïƒ Windows ïƒ Watch ïƒ Watch 1 (or 2/3/4).
- Add variable names to the Watch 1 window to monitor their values.
- Be in debug mode to open the Watch window.
- Sequence:
- Step into program (Step Into – F11).
- Set up the Watch window and enter variables to monitor.
- Execute one line at a time (Step Over – F10) while monitoring variables.
- Stop Debugging:
- Click Debug ïƒ Stop Debugging.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.