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.
27 exam-style questions on AQA GCSE Computer Science Robust and secure programming. Each one has a worked solution and a mark scheme showing where the marks go.