Cards (63)

  • The purpose of debugging is to verify code correctness and performance.
    False
  • Match the error type with its description:
    Syntax Error ↔️ Violates grammar rules
    Logic Error ↔️ Incorrect reasoning
    Runtime Error ↔️ Occurs during execution
  • Testing verifies that code behaves as expected under different conditions.
    True
  • What type of error occurs when code violates the programming language's grammar?
    Syntax error
  • What is the primary focus of unit testing?
    Testing individual units
  • What are the three main types of programming errors?
    Syntax, Logic, Runtime
  • What happens during a runtime error?
    Program crashes or behaves unpredictably
  • What does unit testing verify?
    Individual code units
  • Steps for writing and running unit tests
    1️⃣ Choose a unit testing framework
    2️⃣ Write test cases
    3️⃣ Use assertion functions
    4️⃣ Run the tests
  • What are the three categories of bugs in programming?
    Syntax, Logic, Runtime
  • What is code review useful for in debugging?
    Catching obvious mistakes
  • What is the primary purpose of debugging in programming?
    Fixing errors
  • What is the goal of testing in programming?
    Verify code behavior
  • Division by zero is an example of a runtime error.
  • Debugging focuses on finding and fixing specific errors
  • Match the error type with its example:
    Syntax Error ↔️ Missing semicolon
    Logic Error ↔️ Incorrect loop condition
    Runtime Error ↔️ Division by zero
  • Integration testing verifies the interaction between different units of code.

    True
  • Syntax errors occur when the code violates the programming language's rules
  • Match the debugging technique with its description:
    Print Statements ↔️ Output variable values or program flow
    Debugger ↔️ Step through code line by line
  • What does integration testing ensure?
    Units work together correctly
  • Which unit testing framework is commonly used for Python?
    pytest
  • Inserting print statements is a debugging technique called tracing.
  • Tracing code involves inserting print statements at key points to monitor variable values and execution flow.
  • Match the debugging strategy with its description:
    Code Review ↔️ Reviewing the code for errors
    Tracing ↔️ Using print statements to track variable values
    Debugger ↔️ Stepping through code line by line
  • Debugging tools are used to identify the root causes of issues in code.

    True
  • Match the type of error with its description:
    Syntax Error ↔️ Violation of language grammar
    Logic Error ↔️ Incorrect algorithm behavior
    Runtime Error ↔️ Error during program execution
  • In Python, the `pdb` module is used to set a breakpoint in code for debugging.
  • In unit testing, assertion functions are used to verify if the actual output matches the expected output.
  • Code review is useful for catching obvious mistakes and improving code clarity
  • A debugger allows programmers to step through code line by line and examine variables
  • What are the three categories of bugs in programming?
    Syntax, logic, runtime
  • What is the purpose of branching in source control systems?
    Experiment with new features
  • Debugging and testing ensure code quality and reliability
  • Debugging involves tracing code flow using debug tools
  • Steps for debugging using print statements:
    1️⃣ Insert print statements at strategic points
    2️⃣ Execute the code
    3️⃣ Analyze the output
    4️⃣ Identify the error location
    5️⃣ Fix the bug
  • Debuggers allow you to step through code and inspect values.
  • The objective of integration testing is to ensure units work together.
  • Logic errors result from incorrect reasoning or algorithms in the code.

    True
  • A debugger allows you to set breakpoints
  • Unit testing and integration testing complement each other to improve code reliability.

    True