Kablow!

Testing, debugging and error types

邊玩邊學

回答這些題目賺取能量,接著就能釣魚、探索。不需要帳號。

給教育者: 為 Testing, debugging and error types(Computer Science、Programming)準備好可直接使用的課程投影片, 複習筆記——用於你的課程,或把這個主題當成互動班級活動,讓學習者以即時遊戲的方式進行。

課程筆記

Types of error

  • A syntax error violates language grammar, such as a missing required bracket; a compiler or interpreter reports it before executing the affected code.
  • A logic error produces unintended behaviour despite syntactically valid code.
  • A runtime error arises during execution, such as a rejected out-of-range access. Errors can be handled; they do not invariably crash the whole application.

Program error types

Program error types

Testing

  • Test data types: normal (valid), boundary (at the edge of valid ranges) and erroneous (invalid). For age 18-65: normal 30; boundary 18, 65 (and 17, 66 as invalid boundaries); erroneous "abc".
  • A test plan lists inputs, expected outputs and actual outputs.
  • Iterative testing: testing during development. Final/terminal testing: at the end against the specification.

Test data categories

Test data categories

Debugging tools

  • Trace tables, breakpoints, stepping through code, watch windows, print statements; IDE error messages.

Debugging tools

Debugging tools

Good practice

  • Write comments, meaningful names, modular code; test each module; fix one error at a time.

Defensive design

  • Anticipate misuse and handle errors gracefully.

投影片

Sign up free to view the lesson slides

Step through every slide for this topic — plus flashcards and revision notes — with a free account.

練習題

免費預覽——33 題中的 8 題。註冊即可查看全部。
  1. 1.What is a bug?

    Easy
    • Aan error in a program
    • Ba feature
    • Ca variable
    • Da loop
  2. 2.What is debugging?

    Easy
    • Afinding and fixing errors
    • Bwriting code
    • Ccompiling
    • Drunning
  3. 3.A program runs to completion but calculates the wrong result because its algorithm is incorrect. What type of error is this?

    Easy
    • Alogic error
    • Bsyntax error
    • Cruntime error
    • Dhardware error
  4. 4.Which error is caused by a missing bracket?

    Easy
    • Asyntax error
    • Blogic error
    • Cruntime error
    • Dnone
  5. 5.What is erroneous test data?

    Easy
    • Ainvalid data that should be rejected
    • Bvalid data
    • Cboundary data
    • Dno data
  6. 6.For valid ages 18 to 65, which is boundary data?

    Easy
    • A18
    • B30
    • C"abc"
    • D100
  7. 7.For valid ages 18 to 65, which is normal data?

    Easy
    • A30
    • B17
    • C66
    • D"abc"
  8. 8.What does a breakpoint do?

    Easy
    • Apauses the program at a chosen line
    • Bends the program
    • Cadds a loop
    • Ddeletes code

Unlock all 33 questions & more

建立免費帳號,即可查看這個主題的所有題目、投影片、字卡與複習筆記。

歷屆試題

這個主題的歷屆試題練習即將推出。
即將推出