Please select random order or first card below to begin studying 🤓
Congratulations! You have finished studying this set of cards
What are the two main tools we have to prevent software errors according to Code Craft?
Defensive programming and testing
What are the three classes of bugs according to Code Craft?
Failures to compile, run-time crashes, and unexpected behaviors
What is the nastiest type of bug according to Code Craft?
Unexpected behaviors
What is the most common type of program hang according to Code Craft?
An infinite loop
What type of variable, if you use it in a program, will cause the program's behavior to depend on the garbage value in the variable's memory location?
An unitialized variable
What is the first step when debugging some code?
Understanding the code
What error subtype of run-time crashes are usually caught by the compiler, but if they are not, are usually language grammar errors?
Syntactic errors
What is a common syntactic error that is a language grammar error that might happen in a conditional?
mistaking = for a ==
What error subtype of run-time crash would include a Rails app using a version of a gem that was installed from local development rather than the actual released version of the gem?
Build errors
An example of a basic semantic bug is using an uninitialized variable; what will the behavior of the program depend on in this case?
The garbage at the memory location
A common basic semantic fault related to floating point numbers is?
Comparing them for equality
What subtype of semantic bug is caused when memory locations not allocated for the program's use are accessed?
Segmentation faults
What type of semantic bug is when memory is written past what has been allocated for a data structure?
Memory overrun
What type of semantic bug includes infinite loops, deadlock and race conditions, and event-driven code waiting for an event that will never occur?
Program hangs
What is the key to find and fix faults quicker and also introduce less new faults as you do?
Pay attention on a microscopic level while also keeping in mind the big picture.
What is the golden rule of debugging according to Code Craft?
Use your brain
When a compile-time error results in the compiler spitting out a lot of error messages, usually the most important one to look at is:
The first one
What technique to investigate a run-time error has you play the role of the computer, trace program execution and compare your result with reality?
A dry run