wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

grade 9 week 7

Total questions: 52

Worksheet time: 52mins

Name
Class
Date
1.

What is the main purpose of a test plan?

a)

To design the program

b)

To check if the program works correctly

c)

To write user documentation

d)

To speed up coding

2.

Which of the following is usually included in a test plan?

a)

Test cases and expected results

b)

Programmer's biography

c)

Computer specifications only

d)

A list of future updates

3.

Why is testing important in programming?

a)

To make the program look nice

b)

To ensure the program produces correct results

c)

To make the program shorter

d)

To remove comments

4.

In testing, "expected output" means:

a)

The result we predict

b)

The actual result produced

c)

The error message only

d)

The program code

5.

In testing, "actual output" means:

a)

The result predicted

b)

The result produced when running the program

c)

The correct mathematical formula

d)

The test plan

6.

What does validation check?

a)

If the input is sensible and acceptable

b)

If the program is beautiful

c)

If the output is correct

d)

If the computer is fast

7.

Which is an example of valid input for age?

a)

-5

b)

25

c)

200

d)

"abc"

8.

If a program rejects "-10" as an age, what concept is this?

a)

Debugging

b)

Validation

c)

Compilation

d)

Normalization

9.

What would happen without input validation?

a)

The program always runs faster

b)

The program may crash or give wrong results

c)

The program will be shorter

d)

The program is always correct

10.

Which of these is NOT a validation check?

a)

Range check

b)

Type check

c)

Presence check

d)

Multiplication check

11.

What is "normal data"?

a)

Data that is expected and typical

b)

Data at the edge of input range

c)

Data that is incorrect

d)

Data that is random

12.

What is "boundary data"?

a)

Data at the limits of acceptable input

b)

Data that is always wrong

c)

Data from outside the program

d)

Data used for debugging only

13.

What is "erroneous data"?

a)

Valid data

b)

Data outside the acceptable range

c)

Data in the middle of the range

d)

Data that gives correct results

14.

Example of normal test data for a rectangle area program (length × width):

a)

(5, 10)

b)

(0, 5)

c)

(-3, 5)

d)

("abc", 5)

15.

Example of boundary data for a rectangle area program:

a)

(5, 10)

b)

(0, 10)

c)

(-3, 10)

d)

(100, 200)

16.

Example of erroneous data for a rectangle area program:

a)

(5, 10)

b)

(0, 5)

c)

(-2, 5)

d)

(3, 3)

17.

Which test data type checks "program at the edge of valid input"?

a)

Normal

b)

Boundary

c)

Erroneous

d)

Random

18.

If age = 0 is used as input, what type of test data is it?

a)

Normal

b)

Boundary

c)

Erroneous

d)

Random

19.

If age = -5 is used as input, what type of test data is it?

a)

Normal

b)

Boundary

c)

Erroneous

d)

Correct

20.

If age = 25 is used as input, what type of test data is it?

a)

Normal

b)

Boundary

c)

Erroneous

d)

Invalid

21.

What is debugging?

a)

Writing documentation

b)

Finding and fixing program errors

c)

Creating a test plan

d)

Running the program only

22.

A syntax error is:

a)

Mistake in program logic

b)

Mistake in program grammar or code

c)

Mistake in user input

d)

Mistake in test data

23.

A logic error is:

a)

The program runs but gives wrong results

b)

The program does not run at all

c)

The computer is too slow

d)

The test plan is missing

24.

Which tool is often used to find errors in code?

a)

Calculator

b)

Debugger

c)

Compiler only

d)

Printer

25.

Debugging is important because:

a)

It removes test plans

b)

It ensures the program works correctly

26.

What tool is often used to find errors in code?

a)

Calculator

b)

Debugger

c)

Compiler only

d)

Printer

27.

Debugging is important because:

a)

It removes test plans

b)

It ensures the program works correctly

c)

It makes the program longer

d)

It removes expected output

28.

If expected output = 50 but actual output = 45, what should the programmer do?

a)

Ignore it

b)

Debug the program

c)

Change the test plan only

d)

Stop testing

29.

If expected output = actual output, it means:

a)

The program is correct for that test case

b)

The program is wrong

c)

The test plan is invalid

d)

Debugging is required

30.

Why compare expected and actual output?

a)

To find if the program is correct

b)

To make code shorter

c)

To make program run faster

d)

To remove validation

31.

Expected output is written:

a)

Before running the test

b)

After running the program

c)

By the compiler

d)

By the debugger

32.

Actual output is collected:

a)

By predicting results

b)

By running the program

c)

By reading the test plan only

d)

By validation

33.

Formula for rectangle area is:

a)

length + width

b)

length × width

c)

length − width

d)

length ÷ width

34.

If length = 8 and width = 5, what is the area?

a)

13

b)

40

c)

80

d)

3

35.

If length = 0 and width = 5, what is the area?

a)

0

b)

5

c)

Error

d)

10

36.

If length = -4 and width = 5, the input is:

a)

Normal

b)

Boundary

c)

Erroneous

d)

Valid

37.

Which test case is normal data for area of rectangle?

a)

(-5, 5)

b)

(10, 10)

c)

(0, 10)

d)

(abc, 5)

38.

What is the result of calculator(10, 5, "add")?

a)

5

b)

15

c)

50

d)

Error

39.

What is the result of calculator(20, 5, "divide")?

a)

4

b)

5

c)

15

d)

Error

40.

What happens if we try calculator(10, 0, "divide")?

a)

0

b)

Error: Cannot divide by zero

c)

10

d)

Infinity

41.

What happens if we try calculator("a", 5, "add")?

a)

5

b)

a5

c)

Error: Inputs must be numbers

d)

10

42.

What happens if we try calculator(10, 5, "power")?

a)

100000

b)

15

c)

Error: Invalid operation

d)

2

43.

If age = 15, the program outputs:

a)

Error

b)

Valid age: 15

c)

Age too high

d)

Negative age

44.

If age = 0, the program outputs:

a)

Error

b)

Valid age: 0

c)

Invalid

d)

Too high

45.

If age = -3, the program outputs:

a)

Valid age: -3

b)

Error: Age cannot be negative

c)

Valid age: 0

d)

Age too high

46.

If age = 120, the program outputs:

a)

Error

b)

Valid age: 120

c)

Invalid input

d)

Too low

47.

If age = 150, the program outputs:

a)

Error: Age is unrealistically high

b)

Valid age: 150

c)

Valid age: 120

d)

Error: Negative age

48.

Which step comes first in testing?

a)

Write code

b)

Write expected output

c)

Debug the program

d)

Compare actual output

49.

Which of the following is NOT a type of test data?

a)

Normal

b)

Boundary

c)

Erroneous

d)

Regular

50.

What does "Pass" mean in a test plan?

a)

Actual output = expected output

b)

Test not completed

c)

Program failed

d)

Program crashed

51.

What does "Fail" mean in a test plan?

a)

Actual output = expected output

b)

Actual output ≠ expected output

c)

Program is correct

d)

Program runs faster

52.

Why do programmers use boundary data?

a)

To check extreme cases

b)

To test only normal input

c)

To make program shorter

d)

To avoid debugging