Software Development Flashcards
What is a variable
Programmers use variables to store pieces of data whilst the program is running.
•If the user is asked to enter information into a program then it needs to be stored – so a variable is created.
•A variable is a temporary storage space that can store one piece of data.
The 6 different Variable types
oCharacter
oString
oInteger
oReal
oBoolean
o1-D Arrays
variable type-character
only stores one character. E.g. S, k, P
Variable type - string
can contain a mixture of letters, numbers and characters. E.g. hello, FK6 5EE, mrsbrown@hotmail.co.uk
Variable type- interger
whole numbers, both positive and negative. Cannot contain anything else. E.g. 11, 999, -128
Variable type - real
numbers that contain a fraction or decimal. E.g. 0.09, 10.2, 1567.87
Variable type - Boolean
has only two states, true or false.
Data structure - 1D array
(For the purposes of this course you only need to know about 1 Dimensional Arrays.)
•1-D Array – used to store a list of variables, that are all of the same data type.
•E.g. harry, sam, peter 12, 16, 18
What are the 6 stages of the software development process
Analysis - This is where the problem is analysed and the programmer ensures that they know exactly what they are meant to do.
Design – A solution to the problem is designed using a variety of design techniques. Design decisions are made at this stage.
Implementation – The solution is created.
Testing – Solution is tested using test data, errors are identified and corrected.
Documentation – The paperwork is completed. A technical guide and a user guide are written.
Evaluation – The solution is examined to make sure that it meets the specification and is fit for purpose.
Why is the Software development process known as an iterative process
The SDP has 6 stages that are worked through in order. However, sometimes new information means that a previous stage has to be revisited. This is iteration.
For example, During the testing stage it might be discovered that there is an error in the code. This would mean that the implementation stage needs to be revisited.
Test data types
normal, extreme and exceptional.
Test data - Normal
data that is within range, of the correct data type and should be accepted.
Test data- Extreme
data that is on the edge of what should be accepted but should be accepted
Test data - exceptional
data that is out of range or the wrong data type. It should not be accepted.
Different types of errors
Syntax,execution,logic
Error type - Syntax
where the rules of the programming language are broken. Commonly a spelling mistake, missing out an end if, a full stop in the wrong place
Error type - Logic
are mistakes in the design of the program. They are only spotted when the program is run because the program still works, but does not produce the expected result.
Error type - Execution
also known as a runtime error. These errors show up when the program is run. Perhaps there is not enough allocated space in memory and a large number cannot be stored accurately.
Evaluation- Fitness for Purpose
Does the program solve the original problem?
•Does the program meet the software specification that was created at the Analysis stage? Any differences should be accounted for.
•Do the actual test results match the expected test data results?
Evaluation- efficient use of coding constructs
•Is the program efficient?
•Does it have unnecessary lines of code?
•Do all the loops repeat the correct number of times?
•Could the code have been written more efficiently?
Evaluation- Robustness
•How does a program cope with an error when it is running?
•Does it fail and stop?
•Does it have input validation built in that allows data to be re-entered and the program to continue?
•If the printer jams or runs out of paper that should not stop a program from running. A robust program would contact the user and say that there was an error with the printer.
Evaluation- Readability
Readability is how straightforward it is for another programmer to look at code and understand the purpose of the code, or be able to fix an error.
Internal Commentary – Comment lines. This helps to explain what certain lines of code are actually doing. Comment lines do not affect the running of the program
Indentation – Indenting loops and if statements can help you to spot if and end if has been missed, or if code is outside a loop when it should be inside. It makes it easier for another programmer to follow the code.
What is a conditional loop
A Conditional Loop is a structure which is used when the number of times a section of code is repeated is not known, and depends on one or more conditions being met.
What is a fixed loop
A fixed loop is a structure in which the programmer sets the number of times a loop must be repeated. It is used when the programmer knows in advance how many times the code should be repeated. A loop variable keeps track of how many times the loop has executed
What is a 1D array ?
A 1-D array is an example of a data structure. It is used to store a list of items that are the same data type.
Each element in an array is identified by the variable name and the element number or index, which identifies the position of the element in the arra
How to declare an array
You should declare the array and its size at the start of a program, so the computer sets aside the correct amount of memory space (RAM) for the array
Example- products = [‘’] * 20