Chapter 6 - Inputs & Outputs Flashcards

1
Q

What must defensive design do?

A

-Ensure the software does not have bugs or any backdoor access that would allow hacking and cyberattacks while running .
-prevent the program from behaving in an unintended way, e.g. crashing, as a result of unexpected inputs
-Check that all commands and inputs are sensible (input validation)
-Handle any invalid or absurd inputs sensibly, if they are not filtered our beforehand.

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

What is defensive design

A

The process of designing robust programs not susceptible to the above risks.

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

What is paranoid?

A

don’t trust any user (or any fellow coder on your team) not to try to break the program
Assuming everyone is an idiot, and that they cannot read manuals, instructions or error messages. Expect them to enter rubbish inputs and code for that eventuality
Expecting hackers to try to gain entry into your computer systems, or DDoS attack you.
Distributes Denial of Service Attack(DDoS) attack

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

What is security vulnerability

A

Code written in such a way as to cause a security issues

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

Name two ways users can break the username/password procedure

A

Keep trying - set up a program to try thousands/millions of username/password combinations will successful.
A DDoS attack - Same as above, but spamming log in attempts to bring the website down, rather than attempting to find a username/password combination.

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

How can you improve the procedures defensiveness?

A

A presence check - filters out login attempts with a blank username
a length check - filters out usernames that are too short or long.
A range check - filters out usernames containing non alpha-numeric characters

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

What are “a presence check”,”a length check” or a “a range check” called?

A

input validation checks

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

what happens if the user passes these input validation checks?

A

-server will search for username match
-if there is one it will ask for password
-reduces load on the server as only searches for matching fields one at a time
-user will only have certain number of login attempts before website kicks them off
-prevents hackers from using automatic scripts to DDoS attack the website

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

What are good coding practices

A

Sub-programs, variable identifier naming conventions, indentations and comments

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

what is sub-programs?

A

Functions, procedures or even splitting your program into different scripts. Each sub-program has its own purpose that is easy to follow. The #MainProgramCode section is small - the sub-programs are called from it

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

What is variable identifier naming conventions?

A

It is easier to follow the logic of a program if all identifiers are chosen using the same convention, and follow the rules from chapter 1

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

What are indentations?

A

These not only make python code work, but also let people clearly see the code logic

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

What are comments?

A

Comments don’t seem important when writing code, but are invaluable when trying to understand it later

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

What is modular testing

A

Testing a block of code of sub-program. The code is small, allowing any bugs to be fixed easily

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

What is iterative testing

A

Testing the whole code many times throughout its development, so bugs to be fixed easily

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

What is final testing

A

Once a program is complete (or, at least up to a particular initial stage), final testing can begin:

17
Q

What is alpha testing

A

Whole program testing performed by the programmer and team

18
Q

What is beta testing

A

Testing done by a selected group of individuals to receive feedback about how well the program works

19
Q

What is syntax errors

A

Grammatical mistakes - spelling, capital letters, commas, quotes etc. These are normally quickly picked up as they stop the program from running

20
Q

What is logic errors?

A

The program does not run, but not in the way intended. It produces incorrect or unexpected behavior. These are often harder to find and may require a thorough program test to find

21
Q
A