1.0 Software Development and Design Flashcards

1
Q

1.5 Explain the benefits of organizing code into: functions

A

This help with the D.R.Y principle (Don’t Repeat Yourself). Functions are actions that you can call (use the function with provided inputs). Instead of writing 10 lines of code each time to do the same thing(ex: filter/sort/change) on 5 objects you can just make a function and then call it in one line of code.

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

1.5 Explain the benefits of organizing code into: classes/objects

A

These help with the D.R.Y principle (Don’t Repeat Yourself). Example: A class could be a car, meaning you define the make, model, color, type, etc…
an object would be a specific instance of a class. example: a White Toyota Camry

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

1.5 Explain the benefits of organizing code into: modules

A

This help with the D.R.Y principle (Don’t Repeat Yourself). A module is a library that you can import, allowing use of prebuilt functions otherwise unavailabe.

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

1.6 Identify the advantages of common design patterns: Observer

A

It allows observers (objects or subscribers) to receive events when there are changes to a object that is being observed.

The benefit is that observers get real time data from the subject when any change happens. This is going to provide better performance than polling.A pattern where dependent objects are updated or notified by one or more subject objects.

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

1.6 Identify the advantages of common design patterns: MVC

A

Model – The model is the data structure of the application. It gets input from the controller.
View – The visual representation of the data. It gets input from the model.
Controller – Takes user input and changes it to the format for the model.

The benefit is that the components can be built in parallel and the components to not need to be aware of the implementation within the other components.

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

1.7 Explain the advantages of version control

A

Maintains a history of changes for reference or rollback.

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

1.8a Utilize common version control operations with Git: Add/remove

A

Add/Remove a file to/from staging Git for version controlling.

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

1.8c Utilize common version control operations with Git: Commit

A

This will take all staged files and snapshot them into Git for version control. This will not update non-staged(added) files.

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

1.8g Utilize common version control operations with Git: diff

A

This command will show any changes that have been made since the last commit. It will list every file that has been changed and display what have been modified inside said files.

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

1.8a Utilize common version control operations with Git: clone

A

This command creates a local copy of a remote directory. Additionally it synchronizes it with the remote repository. Allowing for push/pull.

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

1.8d Utilize common version control operations with Git: push/pull

A

Push: Forces your changes to a repository to the synchronized remote server.
Pull: Updates your repository from a synchronized remote server.

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

1.8e Utilize common version control operations with Git: branch

A

Branches are parralel working enviroments to your master branch. Once you make a second branch everything you do on that branch will not affect the original one, and visa versa. You can still work on both, but the will not affect each other.

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

1.8f Utilize common version control operations with Git: Merge

A

Merging combines two branches
1. recieving branch: where the changes are being pulled into
2. target branch: where the changes are being pulled from.

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

1.8f Utilize common version control operations with Git: handling conflicts

A

Conflicts occur when two merging branches both have changes to the same code in the same file and need to figure out which ones to keep. The way to fix this is after you use the merge command an error will appear and give you the option to choose which you would like to keep, choose one and the conflict is resolved.

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

1.1 Compare data formats: YAML

A

YAML is highly human readable, compact and is ideal for configurations. It uses dashes (-) and seperate lines.

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

1.1 Compare data formats: XML

A

XML is best used for legacy systems and SOAP (API web based protocol). It looks similar to html, using <>, </>

17
Q

1.1 Compare data formats: JSON

A

JSON is native to JavaScript making it the defacto language for webpages. It uses brackes [], {}

18
Q

1.2 Describe parsing of common data format (XML, JSON, and YAML) to Python data
structures: JSON

A
  1. import json
  2. with open(json_file, ‘r’) as data:
    python_file = json.load(data)

.loads for strings and .load for file

19
Q

1.2 Describe parsing of common data format (XML, JSON, and YAML) to Python data
structures: XML (lxml)

A
  1. from lxml import etree (optionally as ET)
  2. with open(xml_file, ‘r’) as xml:
    open_file = etree.parse(xml.read())
20
Q

1.2 Describe parsing of common data format (XML, JSON, and YAML) to Python data
structures: XML (xmltodict)

A
  1. import xmltodict
  2. with open(xml_file, ‘r’) as xml:
    open_file = xmltodict.parse(xml.read())
21
Q

1.2 Describe parsing of common data format (XML, JSON, and YAML) to Python data
structures: YAML

A
  1. import yaml
  2. from yaml import load, load_all
  3. with open(yaml_file, ‘r’) as n_yaml:
    python_file = load_all(n_yaml, Loader=yaml.FullLoader)
22
Q

1.2 When parsing a JSON file what does an Array translate into?

A

List

23
Q

1.4 Compare software development methods (agile, lean, and waterfall): Waterfall

A

Do the four basic steps in order: Requirements, Design, Implementation, and Verification then at the end release and get customer feed back. No additional steps. Example: develop a product over a year and release it to get feedback.

24
Q

1.4 Compare software development methods (agile, lean, and waterfall): Lean

A

This method heavily focuses on cutting out excess in the product such as: Unpopular features, partially done work, extra tasks, etc…

25
Q

1.4 Compare software development methods (agile, lean, and waterfall): Agile

A

Method where teams are broken up to smaller units called scrums. Scrums develop smaller features on shorter timelines called sprints. The team has short meetings every day.

26
Q

1.3 Describe the concepts of test-driven development

A

TDD is centered around the idea of constantly testing as your are developing the application.
1. Create a new test: This test should capture a requirement of the application code we are going to write.
2. Run tests: If there are any failures, correct the tests. Failures here are acceptable.
3. Write code to pass the new test: Add nothing more to the application code except what is required to pass the test.
4. Run tests: If any tests fail, fix the application code and re-run tests.
5. Refactor and improve code: Re-run tests each time the application code is improved and fix the code for each failure.

27
Q

1.2 When parsing a JSON file what does an Object translate into?

A

Dictionary