software development process - higher
DESCRIPTION
TRANSCRIPT
Software Development Process
Higher
Material by S. Whyte of Gracemount High School. Adapted to presentation format for ease of teaching.
What is the Software development process?
The Software Development Process (SDP) can be split into 7 main steps which are carried out in order.
These steps should be carried out when creating any software project.
We can remember this by remembering the saying:
A Dance In The Dark Every Midnight
Stage 1 – Analysis (A) A statement about what your program is going to do.
You will also include a description of the main steps of the problem.
Step 2 – Design (Dance) This involves designing both the user interface and the structure of the
program code.
So for a program you will draw the user interface to show what it looks like and plan out the programming code by writing out the Pseudocode.
Step 3 – Implementation (In) The implementation stage involves keying in the program code using the
built in text editor within the programming environment. We will use LiveCode to create our programs.
Step 4 – Testing (The)Testing is an important part of any project. Testing ensures that your program is reliable and robust in the sense that it should produce the correct results and not crash due to unexpected input.
We should test our program with three sets of test data. These are:
Normal (accepted data within a set range)
Extreme (accepted data on the boundaries)
Exceptional (data that is not accepted).
Step 5 – Documentation (Dark)Documentation is usually produced in the form of a user guide and a technical guide.
The user guide shows the user how to use the functions and features of the software.
The technical guide gives the user information on how to install the software as well as the minimum system requirements.
Step 6 – Evaluation (Every)An evaluation is usually a review which shows that your program is fit for purpose, in other words, it does exactly what it was designed to do.
The evaluation should also focus on the readability of your program code. For example, if another programmer was asked to maintain your program code at a later date, would they be able to understand what was going on?
You should always ensure your program is readable by doing the following Use of meaningful identifiers for variable and array name.
Use of internal commentary ( // This subroutine will do the following....)
Effective use of white space between subroutines to space out the program.
Indentation to show the start and end of any control structures such as a fixed loop.
Step 7 - Maintenance (Midnight) Maintenance is performed at the very end of the project.
You will not be required to perform any maintenance on your programs but you will need to know about Corrective, Adaptive and Perfective maintenance.
Reminder – What are variables? To put it simply, a variable is like a “box” into which data can be placed
whilst a program is running.
We give variables names (identifiers) which suggest or give us a clue as to what data is being held in the variable.
Reminder - Variable types
Variables can be store different types of data, LiveCode supports:
Text (known as strings), e.g. Steven, Jim, or Hello etc. Real numbers, (numbers with a decimal point) e.g. 3.14,
5.7 or 11.16, etc. Integer numbers, (whole numbers) e.g. 5, 7 or 102, etc. Boolean (two state values), e.g. Yes/No, True/False, 1/0, etc.
Reminder – Declaring Variables in Livecode
Put 0.00 into RoomLength - To declare real numbers
Put “” into PlayerName - To declare strings
Put 0 into NumberCorrect - To declare integer
Put False into found – To declare a false boolean
Put True into found - To delare a true Boolean
Reminder: LiveCode Commands and Loops
ASK - ASK is a command that allows the programmer to ask the user a question or ask the
user for a response. For example:
Ask "Please enter the length of the room in metres“
PUT - PUT is a command that allows the programmer to transfer the users response (it) into a meaningful variable. For example:
Put it into RoomLength
INTERNAL COMMENTRY - // are used to put internal commentary into a program or to space out different parts of the program to make it
easier to read. For example:
// Display the volume of the room
On and End - are used to start and end of a subroutine. A subroutine must be started
and ended, for example:
On Display_Room_Volume
Put "The room volume is " & RoomVolume into field “Output”
End Display_Room_Volume
An IF - THEN - ELSE - END IF statement - is a control construct which can be used to make a decision in a program. For example:
IF total > 20 THEN
Put "Your total cost is: £" & total & ". You can download an extra app free!"
ELSE
Put "Thank you for your custom, you have spent £" & total
END IF
Reminder: LiveCode Commands and Loops
The two main types of loop are: a fixed loop and a conditional loop.
A REPEAT with loop can be used to repeat a piece of code as many times as the user sets it up for. In the example below, the loop is fixed at repeating the message “Hello World!” 4 times only.
REPEAT with loop = 1 to 4
Put "Hello Word!"
END REPEAT
A REPEAT until loop can be used to repeat a line of code until a certain condition is met. In the example below, the loop will not finish until the user enters a valid number between 0 and 100. This is the condition.
Ask "Please enter a number between 0 and 100.”
Put it into StudentMark
REPEAT until StudentMark >= 0 and StudentMark <= 100
Ask "Invalid number. Please re-enter a mark between 0 and 100."
Put it into StudentMark
Reminder: LiveCode Commands and Loops
Classification of VariablesLocal VariablesA local variable is one which only exists within one subroutine, function or procedure.
Local variables are created when the subroutine is called (run) and are then destroyed when the subroutine terminates. They cannot be accessed or assigned a value except within that subroutine.
On Get_Users_Name
// Setup the local variable to be used in this subroutine
Local KeyPressed
REPEAT until KeyPressed = "Y" OR KeyPressed = "y"
Ask "Please enter the name of the student: "
Put it into StudentName
Ask "Are you happy with the name entered? (Y or y for Yes): "
Put it into KeyPressed
END REPEAT
End Get_Users_Name
This local variable is unique to this subroutine and cannot be used in any other subroutine.
The advantage of using local variables is that it prevents them from being used elsewhere in the program and possibly having their contents accidentally changed. It is therefore good practice to make use of local variables in large programs.
Classification of Variables
Global Variables
A global variable is one which can be accessed and altered from any part of the program, even from another script/event so long as it is declared at the very start.
Global variables should always be used with care as their values may accidentally change if the programmer forgets that they have already used them in another subroutine.
// Setup the global variables to be used in this event
Global StudentName, StudentAge, StudentAddress
These variables can be used in any subroutine and in any LiveCode event so long as they are declared at the start of the event in the same way as shown above.
Classification of Variables
Parameter Passing
What is a Parameter?A parameter can either be a variable or an array. When a parameter is used, it can be passed into a sub-routine and not changed (passes by value) or passed into a subroutine and changed (passed by reference).
Only global variables and arrays can be parameter passed because (as you have already learned), only a parameter that is global can be used in more than one subroutine.
For Higher Computing, you need to demonstrate both parameter passing by value and by reference within the programs you create. It is vital you understand how it works.
Parameter Passing by ValuePassing a parameter by value is used when a parameter is needed in a subroutine but its value is not going to change in the subroutine.
The subroutine will be passed a copy of the original parameter, so that the original parameter remains unchanged.
Parameter Passing by ReferencePassing a parameter by reference is used when a parameter is needed in a subroutine and its value is going to change in the subroutine when it is passed in.
The subroutine will be passed the original parameter and any changes made in the subroutine will result in a change to the original value(s) held within the parameter.