A software engineer is developing a robust payment processing system. During test execution, two distinct bugs are identified:
Which statement correctly classifies these bugs and describes how they interact with translation (compilation/interpretation) and defensive programming?
Bug 1 is a runtime error and Bug 2 is a logic error. A standard compiler or interpreter cannot detect either of these bugs during translation; instead, input validation and defensive programming are required to prevent Bug 1.
Bug 1 is a syntax error and Bug 2 is a logic error. The compiler's syntax analyzer will fail to translate the program if a division by zero is mathematically possible, whereas Bug 2 can only be caught using exception handling blocks.
Bug 1 is a runtime error and Bug 2 is a syntax error. Bug 2 will prevent successful compilation because the tax rate multiplier violates the language rules, whereas Bug 1 requires a dry run with trace tables to identify.
Bug 1 is a logic error and Bug 2 is a runtime error. Both errors will cause the interpreter to halt execution immediately, and both can be successfully prevented by incorporating strict type checking at the compilation stage.
Practise AQA GCSE Computer Science Robust and secure programming with exam-style questions for GCSE Computer Science. 28 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.