Robust Programs Flashcards

1
Q

What is Input Validation?

A

Checking that data input by the user meets specific criteria/rules before processing.

Input validation ensures that user input is safe and meets predefined standards.

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

What does Type Check verify?

A

Whether the input is an integer, real, or string.

Type checking helps prevent errors by ensuring the data type is appropriate for processing.

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

What is the purpose of a Range Check?

A

To determine if an input is within the correct range.

Range checks are crucial for numeric inputs to prevent out-of-bounds errors.

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

What does a Presence Check confirm?

A

Whether any data has actually been input.

Presence checks are important to ensure that required fields are not left empty.

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

What is the goal of a Format Check?

A

To verify if the input is in the correct format.

Format checks can include validating email addresses, phone numbers, and other structured data.

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

What does a Length Check assess?

A

Whether the input includes the correct/minimum/maximum number of characters.

Length checks help ensure data integrity and adherence to specifications.

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

What is meant by Anticipating Misuse in defensive design?

A

Planning for contingencies, such as preventing division by zero in a calculator.

This approach ensures that programs can handle unexpected user actions gracefully.

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

What should a program do in case of a Communication error?

A

Be prepared for the connection to drop, showing an error message or letting the user cancel.

Handling communication errors improves user experience and reliability.

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

What are Peripheral errors?

A

Issues where peripherals do not work, prompting an error message.

Programs should account for hardware failures to maintain functionality.

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

What should a program do to handle Disk errors?

A

Check files before using them and show an error if they are unusable.

Disk error handling is crucial for data safety and program stability.

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

What is the purpose of Authentication in programming?

A

To protect the program from online bots using software like reCAPTCHA.

Authentication mechanisms enhance security and prevent automated misuse.

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

What are the key aspects of maintainable code?

A

Comments, white space, indentation, descriptive variable names, and structured procedures/functions.

These practices improve readability and ease of updates.

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

What should comments in code explain?

A

The program’s purpose and sections of code (selections, iterations, procedures).

Clear comments help other developers understand the code’s functionality.

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

Why is white space important in code?

A

It makes program sections easier to see.

Proper use of white space enhances readability and organization.

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

What is the role of indentation in programming?

A

To visually separate selection and iteration branches.

Indentation is crucial for understanding code structure and flow.

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

What should descriptive variable names do?

A

Explain each variable’s purpose with a comment when declared.

Meaningful names improve code clarity and maintainability.

17
Q

What are procedures and functions used for in code?

A

To structure code and eliminate duplicate code.

They help organize logic and enhance reusability.

18
Q

What are constants in programming?

A

Values declared at the top of the program.

Constants provide clarity and prevent magic numbers in the code.

19
Q

What is Iterative testing?

A

Testing each new module as it is written and checking program branches for functionality.

This approach helps catch errors early in the development process.

20
Q

What does Terminal testing involve?

A

Testing that all modules work together (integration testing).

Integration testing ensures that individual components function as a cohesive whole.

21
Q

What is checked during Terminal testing?

A

That the program produces required results with normal, boundary, invalid, and erroneous data.

Comprehensive testing ensures robustness against various data types.

22
Q

What is the purpose of a beta test?

A

To find more errors before final release.

Beta testing allows real users to identify issues that may not have been caught during earlier testing phases.