NEW
Font size
Worksheetsgrade 9 week 7
Total questions: 52
Worksheet time: 52mins
What is the main purpose of a test plan?
To design the program
To check if the program works correctly
To write user documentation
To speed up coding
Which of the following is usually included in a test plan?
Test cases and expected results
Programmer's biography
Computer specifications only
A list of future updates
Why is testing important in programming?
To make the program look nice
To ensure the program produces correct results
To make the program shorter
To remove comments
In testing, "expected output" means:
The result we predict
The actual result produced
The error message only
The program code
In testing, "actual output" means:
The result predicted
The result produced when running the program
The correct mathematical formula
The test plan
What does validation check?
If the input is sensible and acceptable
If the program is beautiful
If the output is correct
If the computer is fast
Which is an example of valid input for age?
-5
25
200
"abc"
If a program rejects "-10" as an age, what concept is this?
Debugging
Validation
Compilation
Normalization
What would happen without input validation?
The program always runs faster
The program may crash or give wrong results
The program will be shorter
The program is always correct
Which of these is NOT a validation check?
Range check
Type check
Presence check
Multiplication check
What is "normal data"?
Data that is expected and typical
Data at the edge of input range
Data that is incorrect
Data that is random
What is "boundary data"?
Data at the limits of acceptable input
Data that is always wrong
Data from outside the program
Data used for debugging only
What is "erroneous data"?
Valid data
Data outside the acceptable range
Data in the middle of the range
Data that gives correct results
Example of normal test data for a rectangle area program (length × width):
(5, 10)
(0, 5)
(-3, 5)
("abc", 5)
Example of boundary data for a rectangle area program:
(5, 10)
(0, 10)
(-3, 10)
(100, 200)
Example of erroneous data for a rectangle area program:
(5, 10)
(0, 5)
(-2, 5)
(3, 3)
Which test data type checks "program at the edge of valid input"?
Normal
Boundary
Erroneous
Random
If age = 0 is used as input, what type of test data is it?
Normal
Boundary
Erroneous
Random
If age = -5 is used as input, what type of test data is it?
Normal
Boundary
Erroneous
Correct
If age = 25 is used as input, what type of test data is it?
Normal
Boundary
Erroneous
Invalid
What is debugging?
Writing documentation
Finding and fixing program errors
Creating a test plan
Running the program only
A syntax error is:
Mistake in program logic
Mistake in program grammar or code
Mistake in user input
Mistake in test data
A logic error is:
The program runs but gives wrong results
The program does not run at all
The computer is too slow
The test plan is missing
Which tool is often used to find errors in code?
Calculator
Debugger
Compiler only
Printer
Debugging is important because:
It removes test plans
It ensures the program works correctly
What tool is often used to find errors in code?
Calculator
Debugger
Compiler only
Printer
Debugging is important because:
It removes test plans
It ensures the program works correctly
It makes the program longer
It removes expected output
If expected output = 50 but actual output = 45, what should the programmer do?
Ignore it
Debug the program
Change the test plan only
Stop testing
If expected output = actual output, it means:
The program is correct for that test case
The program is wrong
The test plan is invalid
Debugging is required
Why compare expected and actual output?
To find if the program is correct
To make code shorter
To make program run faster
To remove validation
Expected output is written:
Before running the test
After running the program
By the compiler
By the debugger
Actual output is collected:
By predicting results
By running the program
By reading the test plan only
By validation
Formula for rectangle area is:
length + width
length × width
length − width
length ÷ width
If length = 8 and width = 5, what is the area?
13
40
80
3
If length = 0 and width = 5, what is the area?
0
5
Error
10
If length = -4 and width = 5, the input is:
Normal
Boundary
Erroneous
Valid
Which test case is normal data for area of rectangle?
(-5, 5)
(10, 10)
(0, 10)
(abc, 5)
What is the result of calculator(10, 5, "add")?
5
15
50
Error
What is the result of calculator(20, 5, "divide")?
4
5
15
Error
What happens if we try calculator(10, 0, "divide")?
0
Error: Cannot divide by zero
10
Infinity
What happens if we try calculator("a", 5, "add")?
5
a5
Error: Inputs must be numbers
10
What happens if we try calculator(10, 5, "power")?
100000
15
Error: Invalid operation
2
If age = 15, the program outputs:
Error
Valid age: 15
Age too high
Negative age
If age = 0, the program outputs:
Error
Valid age: 0
Invalid
Too high
If age = -3, the program outputs:
Valid age: -3
Error: Age cannot be negative
Valid age: 0
Age too high
If age = 120, the program outputs:
Error
Valid age: 120
Invalid input
Too low
If age = 150, the program outputs:
Error: Age is unrealistically high
Valid age: 150
Valid age: 120
Error: Negative age
Which step comes first in testing?
Write code
Write expected output
Debug the program
Compare actual output
Which of the following is NOT a type of test data?
Normal
Boundary
Erroneous
Regular
What does "Pass" mean in a test plan?
Actual output = expected output
Test not completed
Program failed
Program crashed
What does "Fail" mean in a test plan?
Actual output = expected output
Actual output ≠ expected output
Program is correct
Program runs faster
Why do programmers use boundary data?
To check extreme cases
To test only normal input
To make program shorter
To avoid debugging
