Software development/section 1 Flashcards
Waterfall methodology
A several step process to deliver a product to a client
Stages of the waterfall methodology
Analysis, design, implementation, testing, documentation, evaluation
A Dance In The Dark Everyday
Analysis
The beginning stage of the design process, the developers and client will define the purpose and requirements of the software
Aspects of the analysis stage
Purpose, functional requirements, assumptions
Analysis stage
Purpose
A paragraph that outlines what the project is for, decided upon by the devcveloper and the client
Analysis stage
Functional requirements
The program is abstracted into inputs, processes and outputs, these are defined by the developer
Analysis stage
Assumptions
Anything that has not been made clear by the client
Can include: IT competency, software compatibility etc.
Design stage
The purpose and functional requirements are considered to create steps that are turned into code in implementation
Design stage
The design techniques
Structure diagram, flow charts, pseudocode
Design stage
Structure diagrams
A visual technique that shows the steps needed to solve a problem
Different shapes represent different techniques
Design stage
Flow charts
A visual design technique that shows the journey of a piece of software
Show the process not steps needed (steps needed is structure diagram)
Design stage
Psuedocode
A written design technique not based on any language
Design stage
Rules of psuedocode
Define and refine the main steps, variables are not declared, indentation to show loops and conditionals
Testing stage
To make sure a program runs as intended, you need to test various inputs to make sure they do what is expected
Testing stage
Normal cases
Any data you expect to work
Testing stage
Extreme cases
Data at the upper or lower limits of the program, the program should still work as intended
Testing stage
Exceptional cases
Any data just outsice of the limits, should not be accepted
Testing stage
Types of errors
Syntax errors, logical errors
Testing stage
Syntax errors
When the code cannot run because it is not written in the correct form
Testing stage
Logical errors
The code executes, but produces unexpected results
Such as using AND instead of OR
Documentation stage
A document that contains all analysis, design, implementation and testing
Evaluation stage
In this stage, the developer will compare the finished product with the analysis and other factors to evaluate whether the product meets expectation
Evaluation stage
Factors to evaluate
Fitness for purpose, efficiency, robustness, readability
Evaluation stage
Fitness for purpose
Compares the program to the purpose and functional requirements which must be met
Evaluation stage
Efficiency
Refers to demands on the processor and RAM, this demand must be as low as possible
Such as using loops where possible
Evaluation stage
Robustness
Describes whether a program can tackle errors or unexpected inputs
Such as by using inout validation
Evaluation stage
Readability
Makes code easier to read with internal commentary, meaningful variable names, indentation and whitespace which is evaluated
Implementation
Data types
Character, integer, string, boolean, real
Implementation
Character
A single character that can be a number, letter or symbol
Implementation
String
A whole number, positive or negative
Implementation
Real
Stores numbers that may have decimal places
Float or double in Python, SQA only accepts real
Implementation
String
Stores text in quotes, numbers should not be stored as strings
Implementation
Boolean
Stores true or false values
Can be stored as 0 and 1, where 0 is false and 1 is true
Implementation
Data structures
Allow you to store more than one value together
Lists, tuples and dictionaries in Python
Implementation
Lists
A list of values that can be different data types
~~~
fruit = [“apple”, “A”, 1.12, 3]
~~~
Lists store values in a specific order
Implementation
Tuples
Arrays that cannot be changed, the values always stay the same
tup = ("Apple", "B", 1.023, 3, True)
Tuples store values in a specific order
Implementation
Array indexes
Array indexes start from 0, so a list with 20 values has indices 0 to 19
~~~
list[0]
~~~
Implementation
Expressions to assign values
To declare a variable, you don’t need to specify the data type in Python
~~~
fruit = “apple” (Fruit is defined as the string “apple”
bank += 1 (This adds 1 to bank)
~~~
= is not the same as ==, = is assign while == is compare
Implementation
List of arithmetic operations
Add, subtract, multiply, divide, exponent, remainder
Implementation
Addition
a = 1 b = 2 print(a+b)
Output would be 3
To add, use the + symbol
Implementation
Subtraction
a = 3 b = 2 print(a-b)
Output would be 1
To subtract, use the - symbol
Implementation
Multiplication
a = 2 b = 3 print(a * b)
Output would be 6
To multiply, use the * symbol
Implementation
Division
a = 6 b = 3 print(a/b)
Output would be 2
To divide, use the / symbol
Implementation
Exponent
a = 2 b = 2 print(a ** b)
Output would be 4
To power, use the **
symbol
Finding 2 to the power of 2, in this example you are doing a^b
Implementation
Remainder
a = 11 b = 2 print(a%b)
Output would be 1
To find the remainder, use the % symbol
As 11 by 2 is 5 remainder 1, you are finding the remainder so answer s 1
Implementation
String concatenation
print("hello" + "hi")
Output would be “hellohi”
You can add strings together, so they join together
The whitespace has to be part of the string for words to be seperated
Implementation
Conditionals
If statements, elif statements, else statements
Implementation
<
Less than
Implementation
>
Greater than
Implementation
>=
Greater than or equal to
Implementation
<=
Less than or equal to
Implementation
==
Equal to
Implementation
!=
Not equal to
Implementation
If statements
if x:
y
~~~
If x is true, then y happens
Implementation
Elif statements
elif x: y
If an if/elif before is false, this conditional will be checked
Implementation
Else statements
else: y
If all if/elif statements before fail, this condition is carried out
Implementation
Logical operators
AND, OR, and NOT
For example, in x > 3 AND y <4, both conditions must be met
Implementation
Types of loops
For loop, while loop
Implementation
For loop
for i in range(5): y
y is completed 5 times
Fixed loop in SQA terms
Implementation
While loop
while x <= 5: y
While condition is met, y happens, loop stops when condition is false
Conditional loop in SQA terms
Implementation
Data type change
x = str(5)
In this, x is “5”
Can use int, str, char, bool, float
Implementation
Length function
if str(x).len() > 5: print(x)
If the length of the string is more than 5, prints
Length can count the chars in a string, whitespace included
Implementation
Random function
random.choice("hi", "hello, "bye") random.randint(0,50)
.choice chooses a random value from the ones given
.randint chooses a random value from the range specified
Implementation
Round function
round(1.23455, 2)
Will round 1.23455 to 2 decimal places
Implementation
Input validation
Makes sure an input meets a set of criteria
Implementation
Running total in a loop
In an array
values = [1,2,3,4] for num in values: total += values print(total)
You can index through the list, and add the values to a total value
Implementation
Running total in a loop
Set amount of loops
for i in range(5): num = int(input("Enter val: ")) total += num
In this exame, the value that was inputted is added to a total
Implementation
Traversing an array
values = ["hi", 1, 1.05] for i in values: if i.type() == int numCount+= 1
You can do things with interations of a loop