Software Development
software
development
Software Development
1 - The Software Development Process
2 - Software Development Languages & Environments
3 - High Level Programming Language Constructs
4 - Standard Algorithms
Software Development
1 - The Software Development Process
Software Development
The 7 Stages of the Software Development Process
1 Analysis
2 Design
3 Implementation
4 Testing
The Iterative Process
5 Documentation
The SDP is described as iterative
because it stages may be revisited as
a result of information gained at later
stages.
6 Evaluation
7 Maintenance
E.g. An error found during the
Testing phase may cause the code
(Implementation) or even the
algorithm (Design) to be re-written.
Software Development
The 7 Stages of the Software Development Process
Stage
1 Analysis
2 Design
3 Implementation
4 Testing
5 Documentation
Key Task
Personnel
Documentation
To define the extent of the software
task to be carried out
Client & Systems Analyst
Software Specification
To design a method of solving the
stated problem
Systems Analyst & Project
Manager
Algorithm (Pseudocode,
Structure Diagram)
To write code in a chosen
programming language
Project Manager & Programmer
Program Code
To test that the program matches the
specification
(Programmer) and Independent
Test Group
Sets of Test Data and Test
Reports
To produce documentation to be
distributed with the software
Client, Systems Analyst and
Programmer
User Guide and Technical
Guide
6 Evaluation
To report upon the quality of the
software according to given criteria
7 Maintenance
To make changes to the software
after the product is handed over to
the client
Project Report/Evaluation
Varies depending on extent of
changes. Programmer and Client
are essential at this stage
Maintenance Report. May
involve re-write of above or,
more typically, details of the
upgrade.
Software Development
Documentation in the Software Development Process
Software Specification
Algorithm
A formal specification of the scope of the boundaries of the problem. It often
forms part of a legally binding contract between the client and the
development team.
A description of how the problem will be solved. It may be text-based (i.e.
pseudocode) or graphical (e.g. structure diagrams or flow charts).
Structured Listing
A formatted printout of the actual code. It is likely to include line numbers,
highlighting of key words (bold, capitals etc) indentation and blank lines (white
space).
Test Report
A list of test data with predicted and actual output. It may also include
comments on behaviour of software (memory, processor use, known conflicts
etc)
User Guide
A set of instructions on how to install and use the software. It may include
tutorials and FAQs.
Technical Guide
Evaluation Report
Maintenance Report
Includes descriptions of the technical requirements (RAM, disc space etc.) It
may also chart the development history, known bugs and fixes, upgrades etc.
A report accompanying the software for the client. It will compare the software
to the original specification and comment on the quality of the software
according to a number of criteria. See Evaluation section for criteria.
This is a short report detailing the maintenance and confirming that it has been
carried out.
Software Development
Personnel in the Software Development Process
Client
Systems
Analyst
Project
Manager
Programmer
Independent
Test Group
The client commissions the software, describing the scope and boundaries
of the problem to the analyst
The Systems Analyst agrees with the client the detailed specification of the
software to be written. This should be completed to the satisfaction of both
parties before the design or coding is carried out.
This individual is responsible for keeping the project on track, from receipt
of the software specification until software is delivered to the client.
Deadlines will be monitored and interim reports on progress delivered.
The programmer is responsible, individually or as part of a team for
converting the algorithm into program code.
The independent test group (ITG) carries out testing of the software. This
may involve modular or component testing (looking at subsections of code)
as well as testing of the finished product.
Software Development
1 Analysis
The analyst extracts information from the client, and other relevant people, during requirements
elicitation.
This may take the form of interviews with clients and their staff, observation of current system,
examination of an existing system and all paperwork (source documents).
It is important that the task is fully understood before any design starts.
The client and the analyst agree the scope and boundaries of the problem.
Any assumptions should be made clear at this point.
The program specification is produced as a result of this stage. It documents the Inputs, Processes
and Outputs.
It may form part of the software contract and it is therefore a legally binding document.
Software Development
2 Design
The Design Stage involves the designing the user interface as well as designing the structure and logic of the system.
Text-based Algorithm
Pseudocode is where the design is written in a code-like version of English. One line of pseudocode usually translates as one line of
program code.
Example of pseudocode algorithm used for input validation.
1 Start conditional loop
2 Get value from user
3
IF value < minimum OR value > maximum THEN Display error message
4 End loop when value > = minimum AND value <= maximum
Graphical Design Notation
This can be used to describe the overall structure of the proposed program without describing how the programs are solved as with
block diagram below. The notation might focus on the flow of control in the software or how data should flow around the system.
Carpet Area Calculator
Get Room Dimensions
Calculate Floor Area
Display Carpet Area Required
Each of the above is an example of top-down design. This is where a task is broken into smaller and smaller parts until the subtasks are very simple to solve.
The process of taking the stages and refining them further is also known as stepwise refinement.
Bottom-up design methodology also exists, although it is often considered inefficient or poor practice.
Software Development
3 Implementation
This stage involves the coding of the algorithm in a given language.
Some factors involved in choosing a language, other than programmer expertise could be:
- Type of problem e.g. Prolog in AI
- Hardware and software compatibility
- Datatypes available
- Features and constructs available
The table below shows a few programming languages and their uses. Note, there are many more:
Language
Source of name
Used for
Ada
After Countess Lovelace
US Military Systems
Logo
Greek for “thought”
Education
FORTRAN
FORmula TRANslation
Early Scientific Language
COMAL
Common Arithmetic Language
Education
Software Development
4 Testing
Testing should be both systematic and comprehensive. Systematic testing is carried out in a
methodical manner so that any errors found can be fully documented and the results repeated.
Comprehensive testing will cover all possible operational situations and a full range of input data.
Test data should cover normal, boundary and out-of-range data. Examples of each type are given
below, using whole number percentage data.
Type of Test Data
Description
Examples
Normal data
Data within expected/normal range
1, 23, 56, 73, 99
Boundary data
Data at limit of what is considered normal
0, 100
Out of range data
Data outside of expected/normal range
-1, 101, X, 2.6
After the program has been written, it is sometimes given to a group of trusted users so that they might
try it out under normal working conditions.
They can then pass information back to the development team so that they can make adjustments and
improvements to the software prior to full release. This is known as beta testing.
Acceptance testing must also be carried out to prove to the client that the software is fully implemented.
Software Development
5 Documentation
Software Specification
Algorithm
A formal specification of the scope of the boundaries of the problem. It often
forms part of a legally binding contract between the client and the
development team.
A description of how the problem will be solved. It may be text-based (i.e.
pseudocode) or graphical (e.g. structure diagrams or flow charts).
Structured Listing
A formatted printout of the actual code. It is likely to include line numbers,
highlighting of key words (bold, capitals etc) indentation and blank lines (white
space).
Test Report
A list of test data with predicted and actual output. It may also include
comments on behaviour of software (memory, processor use, known conflicts
etc)
User Guide
A set of instructions on how to install and use the software. It may include
tutorials and FAQs.
Technical Guide
Evaluation Report
Maintenance Report
Includes descriptions of the technical requirements (RAM, disc space etc.) It
may also chart the development history, known bugs and fixes, upgrades etc.
A report accompanying the software for the client. It will compare the software
to the original specification and comment on the quality of the software
according to a number of criteria. See Evaluation section for criteria.
This is a short report detailing the maintenance and confirming that it has been
carried out.
Software Development
6 Evaluation
The evaluation report will state whether the software is fit for purpose, that it does all the tasks defined
in the software requirements document.
The software is also evaluated in terms of robustness, reliability, portability, efficiency and
maintainability:
Evaluation Criteria
Robustness
Description
The ability of software to cope with errors during running. This might include
NOT crashing when out of range data is entered.
Reliability
How well the software operates without stopping due to design faults. The
software should not crash if the data entered is within acceptable limits, it
should also give a correct and predictable output as a result.
Portability
The ability of software to run on a system other than the one it was designed
for. If software is portable, it should require little or no change to enable it to
run on the new system.
Efficiency
The amount of memory and processor time the software uses.
Maintainability
The ease with which changes can be made to the software. Factors affecting
maintainability include:
Readability – internal commentary, white space, meaningful variable names
Modularity – use of functions or sub-routines
Language – Familiar language like VB or C, or something more obscure.
Software Development
7 Maintenance
Maintenance is the final stage of the process. It takes place from the point the software has been
delivered to the client and may go on for years afterwards. Professional software developers often make
more money from maintaining old software than writing new software from scratch!
The three types of maintenance are corrective, adaptive and perfective maintenance.
Evaluation Criteria
Corrective
Description
Fixes errors not found during the testing stage. The cost of making
these changes is the responsibility of the programming team.
Adaptive
Carried out to adapt the software to a change in its environment. For
example to cope with a new operating system or new item of hardware.
The costs of this type of maintenance are usually met by the client as it
is extra to the original specification.
Perfective
Carried out to add new features, or make other amendments,
requested by the client. As this is also beyond the original specification,
the client will usually pay extra for these changes.
Software Development
2 - Software Development Languages & Environments
Software Development
Software Development Languages & Environments
There are several classifications of programming language with which you should be familiar:
procedural, declarative, event-driven and scripting languages.
Procedural
Language
Example
Declarative
Language
Example
Event-driven
Language
Example
Scripting
Language
Example
This is the type of language that most programmers are familiar with. They are high-level
languages that use commands and keywords to describe instructions to the computer.
It usually has a sequence of instructions with clearly defined start and end points, with
each instruction leading to the next. Examples include PASCAL, TrueBasic, C and COMAL.
Declarative languages are very different from procedural. Programs in these languages are
generally a collection of facts and rules which fully describe the problem.
The user will then type in a query which the program will compare to the information it
knows about and returns an answer which matches the facts it holds. It will find this answer
by pattern-matching the query with the stored rules to find out the missing information.
Event driven languages are similar to procedural languages in the way that the commands
work. The difference is the way that applications written using them are designed and run.
Program code is tied to buttons or other on-screen objects, and the code is run when the
user performs a particular action (e.g. clicking a button or moving the mouse over an object).
Scripting languages are also like procedural languages, but the main difference is where
these small programs are used. Scripts are used to automate or extend the functionality of
an application. An example of this is the use of VBA in MS Excel, MS Word or MS Access.
The script might be activated through a keypress or by clicking a button.
Next >
Software Development
Procedural Language
Example
TrueBasic
PRINT “What is your name?”
INPUT name$
PRINT “Hello “; name$
END
<Back
Software Development
Declarative Language
Example
Prolog
male(john).
male(frank).
parent(john,ruth).
father(X,Y):-
parent(X,Y),male(X).
<Back
Software Development
Event-Driven Language
Example
Visual Basic
Dim score as Integer
Score = Inputbox(“Enter Higher Computing Score”)
Select CASE score
Case < 50
Msgbox(“Fail”)
Case < 60
Msgbox(“B”)
Case < 70
Msgbox(“B”)
Case ELSE
Msgbox(“A”)
End select
<Back
Software Development
Scripting Language
Example
VBScript
Sub ConvertTemp()
temp = Inputbox(“Enter temp in degrees F.”)
Msgbox(“The temp is “ & Celsius(temp) & “ degrees C.”
End Sub
<Back
Software Development
Compilers Vs Interpreters
There are 2 types of translator program covered in the Higher Computing course: Compilers and Interpreters.
Each translator functions differently and has its own advantages and disadvantages.
Compilers
Compilers take the whole program file (the source code) and translate it, producing a new
file (the object code). This new file is in an executable form for the processor on the
chosen platform. The main disadvantage is that the code will not run if there are any syntax
(grammar) errors in the code. The advantage is that, once translated there is no need for
further translation. This means faster execution of the program and no need to load the
translator program into RAM.
Interpreters
Interpreters take the whole program file and translate and execute each line in turn. No
object code is produced and the translator program must be present in RAM every time the
code is executed. The main disadvantage of an interpreter is that the translator must be
present and that each execution will involve translation, slowing the run down! However
the interpreter will run all or part of the code even if there are errors in it.
Consider the following example…
Example
The compiler translates all of the code before execution and therefore the
PRINT statement will be translated once and run 100 times. However, the
interpreter does not store the translation but translates and executes each
line in turn. Therefore the PRINT statement will be translated 100 times and
executed 100 times. That is 99 times more translations that the processor
will have to carry out!
Loop example in TrueBasic
FOR counter = 1 TO 100
PRINT “Hello Bob!”
NEXT counter
Software Development
3 - High Level Programming Language Constructs
Software Development
Simple Data Types
There are several datatypes with which you should be familiar:
String
Mainly used for text of
almost unlimited length
Single
Can store positive and negative
numbers with a decimal point
Integer
Used for positive and negative whole
numbers from -32768 to 32767
Boolean
Can have 1 of only 2
states True or False
Software Development
String Operations
String
Two operations that can be applied string variables are concatenation and the use of substrings.
Example
Dim first, second, whole As String
String Concatenation
Concatenation is the adding together of two strings.
first = "Bob"
second = "cat"
whole = first + second
The example opposite will display the word Bobcat
on the screen.
The add symbol( “+”) can be used in VB to
concatenate strings.
MsgBox (whole)
Example
Substrings
Substrings are often referred to as string slicing. This
is when parts strings are “pulled out” and used.
This code sample will display the words “Ruth and
John” on the screen.
Dim first, second, third, fourth As String
first = “Ruthless"
second = “St. Johnstone"
third = mid$(first,1,4)
fourth = mid$(second,5,4)
MsgBox (third & “ and ” & fourth)
Software Development
Formatting of Input and Output
Visual Basic contains standard functions to alter the way the text and numbers look on screen.
Number =
123.456
Format/Function Applied
Output
Int(number)
123
Round(number)
123
Round(number, 2)
123.46
Format(number, ".000")
123.456
Print Format(number, "000.0")
123.5
Print Format(number, "fixed")
123.46
Print Format(number, "currency")
£123.46
Print Format(number, "percent")
12345.60%
Print Format(number, ".00\s")
123.46s
Print Format(number, "\{00.00\}")
{123.46}
FontSize = 24
Print number
123.456
Software Development
Multiple Outcome Selection
To make a decision about which piece of code to execute next, programs may feature selection using IF or CASE.
Both options effectively do the same thing, but sometimes the CASE clause is easier to read.
Nested IF statements
If mark >= 70 Then
Print "A"
ElseIf mark > 60 Then
Print "B"
ElseIf mark >= 50 Then
Print "C"
Else
Print "Fail"
End If
CASE clause
Select Case mark
Case Is >= 70
Print "A"
Case Is >= 60
Print "B"
Case Is >= 50
Print "C"
Case Else
Print "Fail"
End Select
Software Development
Modularity
Modularity is a good thing in well-written code because it means that tasks can be divided amongst a team of
programmers who each write part of the solution.
Another good reason for using modules is that, should you need to change part of the program during the maintenance
phase, the affected part can be pulled out and the new one dropped into place. Just like building blocks!
Module Libraries
A module library contains pre-written and pre-tested sections, or modules, of code. The advantages of using module
libraries in the development of your software are:
- you do not have to write code for tasks that are already solved
- the code will already have been checked for errors
- the modules should be well documented
.dll files
Anyone who uses a PC will be familiar with .dll files.
These dynamically-linked libraries are sections of
code common to a number of pieces of software.
Using these files allows the modules to be used by
many programs and is more memory efficient.
Example of Input Validation Subroutine
Private Sub CommandButton_Click()
Dim num
Call get_value(num)
Print "Number is " & num
End Sub
Sub get_value(num)
Do
num = InputBox("Enter value 1-10")
If num < 1 Or num > 10 Then MsgBox ("Try again")
Loop Until num >= 1 And num <= 10
End Sub
Software Development
Local Variables Vs Global Variables
Local variables exist only within a single subroutine and cannot be accessed from elsewhere in the code.
Global variables are created in the main part of the program and are accessed from any part of the program.
Parameter Passing By VALUE
When a parameter is passed by value into a subroutine, an exact copy of the contents of the variable is used
by the subroutine. The original variable is not changed by what the subroutine does.
By Val
mynum
Main Program
Subroutine
Parameter Passing By Reference
When a parameter is passed by reference into a subroutine, the original variable and its contents are passed
and can be changed inside the subroutine.
By Ref
mynum
Main Program
mynum
mynum
Subroutine
Software Development
4 - Standard Algorithms
Software Development
Standard Algorithms
The standard algorithms with which you should be familiar with are:
Input Validation
Linear Search
Counting Occurrences
Finding Minimum
Finding Maximum
Software Development
Input Validation
Example
Asks user to enter a number between 1 and 10 until they input a valid number
Pseudocode
Start loop
Visual Basic
DO
Get number between 1 and 10
num = Inputbox(“Enter number between 1 - 10”)
IF number < 1 or number >10 THEN
IF num < 1 OR num > 10 THEN
Display “Invalid Number – Try Again!”
END IF
End loop when number >=1 and number <=10
Msgbox(“Invalid number – Try Again!”)
END IF
LOOP UNTIL num >= 1 AND num <= 10
Software Development
Example
myarray
Linear Search
1
2
3
4
5
Hibs
Hearts
United
Saints
Aberdeen
Searches for “Saints” in a list and displays appropriate message
Pseudocode
Visual Basic
Set target to “Saints”
target = “Saints”
Set position to 1
position = 1
Set found to False
found = False
Loop while Found is False and Not end of array
Do While found = False AND position <= 5
IF current element of array = target value THEN
IF myarray(position) = target THEN
Set found to True
found = True
Display position
Msgbox(target & “ found at position “ & position)
END IF
END IF
Add 1 to position
position = position + 1
End loop
Loop
IF found is NOT True THEN
IF found <> True THEN
Display “Not found” message
END IF
Msgbox(target & “ does not appear in list”)
END IF
Software Development
Example
myarray
Count Occurrences
1
2
3
4
5
Saints
Saints
United
Saints
Aberdeen
Counts number of times “Saints” appears in the list
Pseudocode
Visual Basic
Set target to “Saints”
target = “Saints”
Set counter to 0
counter = 0
For each element in the array
For element = 1 to 5
IF current element = target value THEN
IF myarray(element) = target THEN
Add 1 to counter
END IF
counter = counter + 1
END IF
Next element
Next
Display value of counter
Msgbox(target & “ appears ” & counter & “ times”)
Software Development
Example
myarray
Find Minimum
1
2
3
4
5
19
12
17
11
23
Finds and displays the value of the lowest number in a list
Pseudocode
Visual Basic
Set lowest to first element
lowest = myarray(1)
For each element in the array
For element = 2 to 5
IF current element < lowest THEN
IF myarray(element) < lowest THEN
lowest = current element
END IF
lowest = myarray(element)
END IF
Next element
Next
Display lowest value
Msgbox(“ The lowest value is ” & lowest)
Software Development
Example
myarray
Find Maximum
1
2
3
4
5
19
12
17
11
23
Finds and displays value of the highest number in a list
Pseudocode
Visual Basic
Set highest to first element
highest = myarray(1)
For each element in the array
For element = 2 to 5
IF current element > highest THEN
IF myarray(element) > highest THEN
highest = current element
END IF
highest = myarray(element)
END IF
Next element
Next
Display highest value
Msgbox(“ The highest value is ” & highest)
Software Development
Descargar

software development - Kinross High School