2.3 Flashcards

1
Q

What is a robust program?

A

A robust program is one that can handle errors and unexpected inputs gracefully without crashing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: Robust programs are designed to handle only valid user inputs.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is input validation?

A

Input validation is the process of ensuring that user input is correct and meets specified criteria before it is processed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: A program should provide __________ to users when an error occurs.

A

meaningful feedback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two main types of errors that can occur in programs?

A

Syntax errors and runtime errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is exception handling?

A

Exception handling is a programming construct that allows a program to respond to exceptional conditions (errors) during execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Multiple Choice: Which of the following is NOT a method of error handling? A) Try-Catch B) Input Validation C) Debugging D) Exception Handling

A

C) Debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does ‘defensive programming’ mean?

A

Defensive programming is a design philosophy that ensures a program continues to function under unforeseen circumstances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: Comments in code improve the robustness of a program.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What role does testing play in producing robust programs?

A

Testing helps identify and fix bugs before the program is deployed to users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Fill in the blank: Robust programs often include __________ to ensure that they can recover from errors.

A

redundancy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a user-friendly error message?

A

A user-friendly error message is a clear, concise message that explains what went wrong and how the user can correct it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Multiple Choice: Which of the following is a benefit of producing robust programs? A) More bugs B) Higher maintenance costs C) Increased user satisfaction D) Slower performance

A

C) Increased user satisfaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of logging in robust programs?

A

Logging helps track program behavior and errors for debugging and monitoring purposes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or False: All programming languages have built-in support for exception handling.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does ‘graceful degradation’ refer to in programming?

A

Graceful degradation refers to a program’s ability to maintain functionality even when some components fail.

17
Q

Fill in the blank: Robust programs often use __________ to manage memory efficiently.

A

garbage collection

18
Q

What is a boundary case in testing?

A

A boundary case is a test case that checks the limits of input values to ensure the program behaves as expected.

19
Q

Multiple Choice: Which of the following is an example of input validation? A) Checking if a number is within a specific range B) Writing comments C) Using exception handling D) None of the above

A

A) Checking if a number is within a specific range

20
Q

What is the difference between syntax errors and runtime errors?

A

Syntax errors occur during code compilation, while runtime errors occur during program execution.

21
Q

True or False: Robust programs can never fail.

22
Q

What is the significance of code reviews in producing robust programs?

A

Code reviews help identify potential issues and improve code quality before deployment.

23
Q

Fill in the blank: A robust program should be __________ to accommodate future changes.

A

maintainable

24
Q

What is the role of documentation in robust programming?

A

Documentation provides clear guidelines and explanations for using and maintaining the program.