Defensive Design (Robust Programs) Flashcards

1
Q

What is meant by defensive design?

A

Making programs more robust/stronger using maintainability features such as verification, validation and error handling.

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

What is meant by “maintainability”?

A

The ease with which the source code can be understood, modified, and extended over time by developers.
How easy it is to read the code

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

What is verification?

A

Verification refers to the process of confirming whether something is true.

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

What is validation?

A

Checking that the data entered is valid/as expected.

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

What is data validation?

A

Ensuring that user-provided data is in the correct format or falls within acceptable ranges

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

What is input validation?

A

Verifying that the input provided by the user or from external sources is valid and safe to use.

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

What is file validation?

A

Checking if a file exists, is accessible, or has specific properties before performing operations on it.

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

What is password verification?

A

Checking if a password meets specific criteria, like length, containing certain characters, or fulfilling complexity requirements. (CW: 8 characters - capital letter, number (not consecutive numbers).

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

What is error handling?

A

Handling and logging errors helps to identify and resolve issues more efficiently.

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

What is the purpose of testing?

A

Maintainable code often comes with comprehensive testing (iterative - during and terminal - at end).

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

What is modularity?

A

Code should be organised into small, independent modules or functions to make development easier.

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

What is the purpose of comments?

A

Well-documented code includes clear explanations of the purpose, describes what the code does.

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

What is exception handling?

A

Exception handling in Python allows you to handle errors and unexpected situations that may occur during the execution of a program.

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

What syntax is used for exception handling in Python?

A

The basic syntax for exception handling in Python uses the ‘try’, ‘except’, ‘else’, and ‘finally’ blocks.

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