The Software Development Process 4 hours - PowerPoint PPT Presentation

1 / 66
About This Presentation
Title:

The Software Development Process 4 hours

Description:

Here is the Fahrenheit conversion algorithm represented as pseudocode to be ... This chart shows the sequence of reading customer accounts and calculating the ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 67
Provided by: james230
Category:

less

Transcript and Presenter's Notes

Title: The Software Development Process 4 hours


1
The Software Development Process 4 hours
2
The Software Development Process
The SDP consists of seven main stages that are
followed to develop software. They are
  • Analysis
  • Design
  • Implementation
  • Testing
  • Documentation
  • Evaluation
  • Maintenance

Software Development Process
3
The iterative nature of the SDP
The SDP is iterative as any of the stages may be
revisited throughout the project. Example If
an error is found in the maintenance stage (after
release) then the implementation stage will be
revisited to fix the code.
Software Development Process
4
The Software Specification
The Software Specification is a document that
defines the scope and boundaries of the project
and becomes legally binding between the client
and the developers.
Software Development Process
5
Personnel involved the SDP
Client - commissions the software project as a
result of an identified need. Systems Analyst
Investigates the clients current system and
designs the new or upgraded system. Project
Manager Project leader who manages the project
and the development team. Ensures deadlines
being met and resources are in place. Programmer
Implements the designs (pseudocode etc.) into
program code. Independent Test Group tests the
software to identify any errors by testing
subroutines, modules and the completed program.
Software Development Process
6
Analysis
The Systems Analyst meets with the client,
interviews and observes users of the current
system and identifies what the program has to do,
in a process known as Requirements Elicitation.
The result is the production of the Software
Specification.
Software Development Process
7
Design
The design process is methodical and involves
designing and representing algorithms as
pseudocode and/or structure diagrams.
Software Development Process
8
Design
Algorithm An algorithm is a sequence of actions
that, when performed in the correct order, will
solve a problem or task in a finite number of
steps.
Example Here is a simple algorithm to convert
a Fahrenheit temperature to Celsius 1 Subtract
32 from Fahrenheit temperature 2 Multiply by
5/9ths to get Celsius temperature So, 98.6F -
32 66.6 66.6 5/9ths 37C What happens if
you swap steps 1 and 2 - do you get the same
answer?
Software Development Process
9
Design
Pseudocode Pseudocode is a design notation that
combines English language and Maths with
programming language constructs.
Software Development Process
10
Design
Pseudocode
Here is the Fahrenheit conversion algorithm
represented as pseudocode to be implemented as
program code
1.1 Get temp(F) 1.2 Set temp(F)
temp(F)-32 1.3 Set temp(C)
temp(F)0.556 1.4 Display temp(C)
Software Development Process
Note Pseudocode is not specific to any
programming language. It is a design notation
that can be implemented by programmers in any
programming language
11
Design
Structure Diagram A Structure Diagram is another
design notation that represents algorithms in a
chart or graphical form
Here is the Fahrenheit conversion algorithm
represented as a structure diagram to be
implemented as program code
Software Development Process
Covert F to C
1.2 Set temp(F) temp(F)-32
1.3 Set temp(C) temp(F)0.556
1.4 Display temp(C)
1.1 Get temp (F)
12
Design
Flow chart A flow chart is another design
notation that shows the sequence of operations
required to complete a task.
This chart shows the sequence of reading customer
accounts and calculating the amount due for each
customer. After an account has been processed,
the program loops back to process the next one.
Software Development Process
13
Design
Top-down design Is the process of breaking a
problem down in to sub-problems.
Top-down design is where a task or problem is
broken down into stages that can be solved as
individual parts.
Software Development Process
This structure diagram illustrates a top-down
approach to identifying the stages of the problem
solution.
14
Design
Stepwise Refinement Stepwise-refinement is the
process of refining stages down into steps. Each
step can then be coded in a programming language.
Software Development Process
15
Implementation
This is where the programmer(s), overseen by the
project manager, convert the pseudocode
(algorithms) into programming code e.g. Visual
Basic, C, Java etc.
Pseudocode 1.1 Get temp(F) 1.2 Set temp(F)
temp(F)-32 1.3 Set temp(C) temp(F)0.556 1.4
Display temp(C)
Software Development Process
Program Code tempF txtTempF.Text tempF
tempF-32 tempC tempF0.556 lblTempC temp(C)
A formatted printout of the program code is known
as a structured listing. It includes
indentation, white space and internal commentary.
16
Testing
Testing should be both systematic and
comprehensive i.e. methodical with test reports
of predicted and actual results kept, and tested
under all operational situations with a full
range of test data. The three types of testing
are normal, extreme and exceptional.
Example Program should only accept whole values
in the range 0 to 100 Normal data 2, 34, 66
etc. Extreme data 0,100 Exceptional -1, 156,
abc, 2.9 etc.
Software Development Process
Acceptance (beta) testing is when independent
test groups and/or the client try out the
software and report back any bugs to the
development team prior to final release.
17
Documentation
To produce documentation to be distributed with
the software. The two main documents are the
user guide and the technical guide.
1 User Guide A set of instructions on how to
install and use the software perhaps including
tutorials and FAQS. Can be in both a booklet or
electronic format.
Software Development Process
2 Technical Guide Describes hardware
requirements e.g. CPU, RAM space on hard disk etc.
18
Evaluation
An evaluation report is prepared and supplied to
the client with the release of the software.
Software Development Process
19
Maintenance
Begins once the software has been released and
put into use. Involves the client who uses the
software and the programmers to make any
necessary changes. There are 3 types of
maintenance.
Corrective Fixing any errors that were not
detected during the testing phase. Adaptive To
alter the software to work with a new operating
system or new hardware. Perfective Add new
functionality at the request of the client.
Software Development Process
Corrective maintenance is part of the contract
whereas adaptive and perfective are usually at
additional expense to the client.
20
Languages and Environments 6 hours
21
Procedural Languages
Programs follow a sequence from start to finish
and can be split into sub-programs called
procedures.
Languages and Environments
Languages such as Pascal, Comal and Basic are
procedural and nowadays are mainly used for
learning programming.
22
Declarative Languages
Declarative (logic) programming has no fixed
start or end point are collections of facts and
rules and use pattern matching to answer queries.
Here are some facts Parent (Liz, Tom).
means that Liz is a parent of Tom Female
(Liz). means that Liz is
female Male(Tom). Parent(Bert, Tom).
Languages and Environments
Here is a rule Mother(X, Y) -
means that X is a mother of Y IF
Parent(X, Y), Female(X) X is a parent of Y
AND X is female!
Query could be Mother(X, Tom) which would give
the answer XLiz
Declarative languages such as Prolog and LISP are
used predominantly in the field of Artificial
Intelligence.
23
Event-driven Languages
An object-oriented programming paradigm where
objects on the interface have their own code
attached e.g. a command button.
Languages and Environments
Visual Basic and Java are examples of
event-driven languages.
24
Translators
Programs written in high-level languages need to
be translated into low-level (machine code) for
processing and executing by the CPU. This is
done by a translator program.
  • There are two types of translator program
  • interpreters
  • compilers

Languages and Environments
25
Interpreters
Interpreter programs translate HLL code into
machine code one line at a time.
  • Advantages
  • easy to find errors
  • good for learners
  • Disadvantages
  • programs slow as have to be continually
    interpreted
  • interpreter program always in memory

Languages and Environments
26
Compilers
A Compiler program translates the whole program
(source code) into a machine code version (object
code) that can be run without the compiler being
present.
  • Advantages
  • programs execute fast as CPU ready
  • translator program only needed at the time of
    compiling
  • different compilers can be written for different
    platforms.

Languages and Environments
  • Disadvantages
  • slow to compile as whole program translated
  • also may not run if syntax errors.

27
Scripting Languages
Programs written as scripts are used to automate
or extend the functionality of software
applications.
  • A Macro is a script written in Visual Basic for
    Applications (VBA).
  • The user records a series of actions in an
    application such as MS-Excel.
  • Code is generated and saved as a program script.
  • The macro can then be assigned to a keystroke.
  • Used to simplify and repeat complex or frequently
    used commands.

Languages and Environments
28
Module Libraries
A Module Library is a pre-written and pre-tested
collection of subroutines and functions which the
programmer can use to aid the development of the
final program.
  • Advantages include
  • No code has to be written for problems already
    solved
  • The code will have been checked for any errors
  • The modules will be well documented

Languages and Environments
29
HLL Programming Constructs 14 hours
30
String Operations
The two string operations are concatenation and
substrings.
Concatenation is the joining together of two
strings.
This example will output Good morning! to a
text box.
HLL Programming Constructs
Substrings are parts of strings that are
extracted and used in some way.
This example will output PM to a label.
31
Formatting of Input / Output
Data can be input via text boxes, input boxes
etc. Data can be output to the screen by setting
properties such as font, colour
etc. Concatenation can be used to output strings
and numerical data.
HLL Programming Constructs
Use of pre-defined functions may also format
output.
Example txtAve.Text Format(average,.00)
32
Multi-way Selection
The CASE statement improves the IF..THEN..ELSE
construct where more than two conditions are
possible.
Algorithm using nested IFs If mark gt 70 Then
grade A" Else If mark gt 60 Then
grade B Else If mark gt 50 Then
grade C" Else grade Fail"
End If End If End If
Implement using CASE Select Case mark Case Is
gt 70 grade A" Case Is gt 60 grade
B" Case Is gt 50 grade C" Case
Else grade Fail" End Select
HLL Programming Constructs
CASE makes the code more readable so aids
maintenance.
33
Variables
A variable is the name used to store a single
item of data within a program.
Examples Integer variables store whole numbers
e.g. Dim age As Integer Real variables store
decimal numbers e.g. Dim price As Single String
variables store text e.g. Dim pname as
String Boolean variables store either TRUE or
FALSE e.g. Dim Swaps As Boolean
HLL Programming Constructs
34
1D Arrays
An array is a name given to a list of items of
data in a program. The list is stored in
contiguous memory locations. Here is an array
nums(10) of integers between 1 and 9
HLL Programming Constructs
Here is some VB code to setup and
array Example 1D array Dim nums(10) As Integer
Here is some VB code that would input data to an
array Example Input to array For c 1 To 10
nums(c) inputbox(Enter number etc.
List1.additem nums(c) Next c
35
Modularity
Well written code makes use of modular
programming. This simply means that programs are
organised into modules or sub-programs.
  • Advantages
  • Each sub-program can be developed and tested as a
    standalone program
  • Bugs can be located within a specific sub-program
  • Maintenance can be carried out on each
  • Programs can be sub-divided and developed by many
    programmers

HLL Programming Constructs
The two main types of modules are subroutines
(procedures) and functions.
36
Procedures
A procedure is a subroutine that performs a
specific task in a program.
Heres how to create a procedure in VB6 Private
Sub InputNames() Statements End Sub
HLL Programming Constructs
  • A procedure can be invoked by
  • an event e.g. Private Sub cmdCalculate_Click()
  • being called when needed e.g. Call Validate

37
Functions
A function is a subroutine that always returns a
value e.g. a function could be used to return the
result of a calculation.
Heres how to create a function in VB6 Private
Function CalcTax () As Single Statements End
Function
HLL Programming Constructs
If CalcTax()was a function then you could return
a value to a label e.g. lblAmount.Caption
CalcTax()
Note The value returned from the function must
always be assigned to a variable or a control!
or you could return a value to an expression
e.g. Amount Estimate .2 CalcTax() .14
38
User-defined Functions
A user-defined function is a subroutine that is
coded by the user and called by another section
of program code. It does not depend on an event.
HLL Programming Constructs
39
Global Variables
Global variables are declared at the start of a
program and can be used anywhere in the program.
HLL Programming Constructs
  • Pros and cons
  • Can be used anywhere in the program
  • Declared once at the start
  • If value changes then changes for the rest of the
    program
  • Can be changed by mistake

40
Local Variables
Local variables are declared within a procedure
or function and can only be used by that
subroutine.
HLL Programming Constructs
  • Pros
  • Different variables can have the same name
  • Save memory as created and destroyed during
    subroutine runtime
  • Make subroutines standalone so easy to reuse in
    other programs
  • Reduce risk of accidental change of global value

41
Parameter Passing
A parameter is simply the value of a variable
that can be passed between subroutines.
  • The two methods of parameter passing are
  • By reference (in and out)

HLL Programming Constructs
ii. By value (in)
42
By reference
Parameter passed is the actual variable itself.
Any changes to the parameter persist beyond the
call i.e. change the original value.
Subroutine A
HLL Programming Constructs
Note An array should always be passed by
reference due to memory overheads.
43
By value
A copy of the current value of parameter is
passed in and any changes do not affect the
original value.
Subroutine A
Subroutine B
alias
Private Sub check (ByVal a)
age 25
HLL Programming Constructs
age
a
a 42
Note In sub B the variable a is an alias i.e. a
copy of the actual parameter.
a
44
Advantages of parameter passing
  • There are a number of advantages
  • Greater control of data flow
  • Reduced risk of accidental change
  • More efficient use of memory
  • Sub-programs are more self-contained
  • Improved reliability and robustness

HLL Programming Constructs
Heres how to pass parameters in VB6 Call AddVat
(cost, total) Private Sub AddVat (ByVal c, ByRef
total) statements End Sub
45
Standard Algorithms 12 hours
46
1 Input Validation
Validates program input and rejects invalid data.
1.1 Get and store value 1.2 Loop WHILE data is
out with range 1.3 Display error message 1.4
Prompt user to re-enter value 1.5 End loop
Standard Algorithms
num InputBox (Enter number between 1 and
10) Do While num lt 1 Or num gt 10 MsgBox Must
be num between 1 and 10 Num InputBox
(Enter number between 1 and 10) Loop
47
2 Linear Search
Searches a list for a target value.
2.1 Get and store target value 2.2 Loop for each
item in the list 2.3 If current item target
value THEN 2.4 Display item and its
location in list 2.5 End if 2.6 End loop
Standard Algorithms
target InputBox (Enter target value) For p
1 To 10 If array(p) target Then
picResult.Print target found at position
p End If Next p
48
3 Counting Occurrences
Counts the number of times (frequency)
3.1 Set counter 0 3.2 Get and store target
value 3.3 Loop for each item in the
list 3.4 If current item target value
THEN 3.5 Increment counter 3.6 End
if 3.7 End loop
Remember to output e.g. to a label or control
array etc.
Standard Algorithms
times 0 target InputBox (Enter target
value) For p 1 To 10 If array(p) target
Then times times 1 End If Next p
49
4 Finding Maximum
Find largest value in a list.
4.1 Set max first item 4.2 Loop for each
remaining item in the list 4.3 If current item
gt max then 4.4 Set max current item 4.5
Set position counter 4.6 End if 4.7 End
loop
Standard Algorithms
max array(1) For p 2 To 10 If array(p) gt
max Then max array(p) pos p End
If Next p
50
5 Finding Minimum
Finds the smallest value in a list.
Standard Algorithms
51
5 Finding Minimum
Set min to first item in list
Standard Algorithms
52
5 Finding Minimum
Is 3 less than 21?
Standard Algorithms
53
5 Finding Minimum
If yes then set min as 3.
Standard Algorithms
54
5 Finding Minimum
Is 56 less than 3?
Standard Algorithms
55
5 Finding Minimum
If no then do nothing.
Standard Algorithms
56
5 Finding Minimum
Is 2 less than 3?
Standard Algorithms
57
5 Finding Minimum
If yes then set 2 equal to min.
Standard Algorithms
58
5 Finding Minimum
Is -9 less than 2?
Standard Algorithms
59
5 Finding Minimum
If yes then set min equal to -9.
Standard Algorithms
60
5 Finding Minimum
Is 5 less than -9?
Standard Algorithms
61
5 Finding Minimum
If no then do nothing.
Standard Algorithms
62
5 Finding Minimum
Is 3 less than -9?
Standard Algorithms
63
5 Finding Minimum
If no then do nothing.
Standard Algorithms
64
5 Finding Minimum
-9 is the smallest value in the list.
Standard Algorithms
65
5 Finding Minimum
Find smallest value in a list.
5.1 Set min first item 5.2 Loop for each
remaining item in the list 5.3 If current item
lt min then 5.4 Set min current item 5.5
Set position counter 5.6 End if 5.7
End loop
Standard Algorithms
min array(1) For p 2 To 10 If array(p) lt
min Then min array(p) pos p End
If Next p
66
TASK Find Min and Max
  • Write a program that will
  • allow the user to input 10 scores between 1 and
    6. The scores can be real i.e. 2.3, 5.6 etc.
  • Calculate the total score i.e. each of the scores
    totalled up!
  • Find the minimum and maximum score and subtract
    from the overall total to obtain a final score.
    Hint final total (min max) Use a function!
  • Display all the scores on screen, along with the
    minimum, the maximum and the final score.
  • Extension Adapt the program to display each
    score on screen in ascending (sorted) order as it
    is entered by the user.
  • Have fun!!!
  • McLean

Standard Algorithms
Write a Comment
User Comments (0)
About PowerShow.com