Programming · Both

Testing & Errors

Working code still needs testing. You must spot error types and choose sensible test data.

Error types

• **Syntax** – breaks language rules (won’t run) • **Logic** – runs but wrong result • **Runtime** – crashes while running (e.g. divide by zero)

Test data

• **Normal** – typical valid values • **Boundary** – on the edge of valid ranges • **Invalid** – should be rejected **Trace tables** follow variable values line by line.

Practice questions

1. Syntax vs logic error?

2. Name three types of test data.