+ All Categories
Home > Documents > Software Development software development. Software Development 1 - The Software Development Process...

Software Development software development. Software Development 1 - The Software Development Process...

Date post: 26-Dec-2015
Category:
Upload: erick-palmer
View: 273 times
Download: 6 times
Share this document with a friend
40
Software Development software development
Transcript

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

1 Analysis

2 Design

3 Implementation

4 Testing

5 Documentation

6 Evaluation

7 Maintenance

The 7 Stages of the Software Development Process

The Iterative Process

The SDP is described as iterative because its stages may be revisited as a result of information gained at later stages.

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 Key Task Personnel Documentation

1 AnalysisTo define the extent of the software task to be carried out

Client & Systems Analyst Software Specification

2 DesignTo design a method of solving the stated problem

Systems Analyst & Project Manager

Algorithm (Pseudocode, Structure Diagram)

3 ImplementationTo write code in a chosen programming language

Project Manager & Programmer Program Code

4 TestingTo test that the program matches the specification

(Programmer) and Independent Test Group

Sets of Test Data and Test Reports

5 Documentation To produce documentation to be distributed with the software

Client, Systems Analyst and Programmer

User Guide and Technical Guide

6 EvaluationTo report upon the quality of the software according to given criteria

Project Report/Evaluation

7 MaintenanceTo make changes to the software after the product is handed over to the client

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 SpecificationA 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.

AlgorithmA 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 GuideA set of instructions on how to install and use the software. It may include tutorials and FAQs.

Technical GuideIncludes descriptions of the technical requirements (RAM, disc space etc.) It may also chart the development history, known bugs and fixes, upgrades etc.

Evaluation Report

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.

Maintenance ReportThis is a short report detailing the maintenance and confirming that it has been carried out.

Software Development

Personnel in the Software Development Process

ClientThe client commissions the software, describing the scope and boundaries of the problem to the analyst

Systems

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.

Project

Manager

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.

ProgrammerThe programmer is responsible, individually or as part of a team for converting the algorithm into program code.

Independent

Test Group

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 Analysis1 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

The Design Stage involves 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.

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 sub-tasks 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.

2 Design2 Design

Carpet Area Calculator

Calculate Floor Area Display Carpet Area RequiredGet Room Dimensions

Software Development

3 Implementation3 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

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

The table below shows a few programming languages and their uses. Note, there are many more:

Software Development

4 Testing4 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

Extreme data Data at limit of what is considered normal 0, 100

Exceptional 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 (independent test group)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

Software SpecificationA 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.

AlgorithmA 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 GuideA set of instructions on how to install and use the software. It may include tutorials and FAQs.

Technical GuideIncludes descriptions of the technical requirements (RAM, disc space etc.) It may also chart the development history, known bugs and fixes, upgrades etc.

Evaluation Report

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.

Maintenance ReportThis is a short report detailing the maintenance and confirming that it has been carried out.

5 Documentation5 Documentation

Software Development

6 Evaluation6 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 Description

RobustnessThe ability of software to cope with errors during running. This might include NOT crashing when out of range data is entered.

ReliabilityHow 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.

PortabilityThe 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

* Examples of inefficient programs include those that use multiple variables instead of arrays

(lucky prize draw, V1), those that use multiple IFs instead of CASE.

6 Evaluation6 Evaluation

Evaluation Criteria Description

RobustnessThe ability of software to cope with errors during running. This might include NOT crashing when out of range data is entered.

ReliabilityHow 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.

PortabilityThe 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 Maintenance7 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 Description

CorrectiveFixes 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.

PerfectiveCarried 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

Procedural Language

Basic

PRINT “What is your name?”

INPUT name$

PRINT “Hello “; name$

END

Example

<Back<Back

Software Development

Declarative Language

Prolog

male(john).

male(frank).

parent(john,ruth).

father(X,Y):-

parent(X,Y),male(X).

Example

<Back<Back

Software Development

Event-Driven Language

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

Example

<Back<Back

Software Development

Scripting Language

VBScript

Sub ConvertTemp()

temp = Inputbox(“Enter temp in degrees F.”)

Msgbox(“The temp is “ & Celsius(temp) & “ degrees C.”

End Sub

Example

<Back<Back

Software Development

Software Development Languages & Environments

ProceduralLanguage

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.

DeclarativeLanguage

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-drivenLanguage

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).

ScriptingLanguage

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.

There are several classifications of programming language with which you should be familiar:

procedural, declarative, event-driven and scripting languages.

ExampleExample

ExampleExample

ExampleExample

ExampleExample

Next >Next >

Software Development

Software Development Languages & Environments

Resume

Settings .

Restart

Quit

Next >Next >

Software Development

Software Development Languages & Environments

Resume

Settings .

Restart

Quit

Next >Next >

Event-driven?

Ease of creation of user interface

Ability to link objects to programming operations

Procedural?

modularity

Programming constructs – IF…THEN- REPETITION

Software Development

Compilers Vs Interpreters

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.

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.

Loop example in TrueBasic

FOR counter = 1 TO 100

PRINT “Hello Bob!”

NEXT counter

Consider the following 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!

Example

Software Development

3 - High Level Programming Language Constructs

Software Development

Simple Data Types

There are several datatypes with which you should be familiar:

Integer

Mainly used for text of almost unlimited length

Can have 1 of only 2 states True or False

Used for positive and negative whole numbers from -32768 to 32767

Can store positive and negative numbers with a decimal point

Boolean

String

Single

Software Development

String Operations

Two operations that can be applied string variables are concatenation and the use of substrings.

StringString

String Concatenation

Concatenation is the adding together of two strings.

The example opposite will display the word Bobcat on the screen.

The add symbol( “+”) can be used in VB to concatenate strings.

ExampleDim first, second, whole As String

first = "Bob"second = "cat"whole = first + second

MsgBox (whole)

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.

ExampleDim 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.

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 = 24Print number 123.456

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 CASE clause

If mark >= 70 Then

Print "A"

ElseIf mark > 60 Then

Print "B"

ElseIf mark >= 50 Then

Print "C"

Else

Print "Fail"

End If

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 filesAnyone 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 " & numEnd 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 <= 10End 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.

mynummynum

Main Program

By Val

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.

mynummynum

Main Program Subroutine

mynummynum

mynummynum

By Ref

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

Linear Search – V1

Example

Pseudocode Visual Basic

Set target to “Saints”

Set position to 1

Set found to False

Loop while Found is False and Not end of array

IF current element of array = target value THEN

Set found to True

Display position

END IF

Add 1 to position

End loop

IF found is NOT True THEN

Display “Not found” message

END IF

target = “Saints”

position = 1

found = False

Do While found = False AND position <= 5

IF myarray(position) = target THEN

found = True

Msgbox(target & “ found at position “ & position)

END IF

position = position + 1

Loop

IF found <> True THEN

Msgbox(target & “ does not appear in list”)

END IF

Searches for “Saints” in a list and displays appropriate message

1 2 3 4 5

Hibs Hearts United Saints Aberdeenmy

arr

ay

Software Development

Linear Search – V2

Example

Pseudocode Visual Basic

Set target to “Saints”

Set counter to 0

For each element in the array

IF current element = target value THEN

Display position

END IF

Next element

target = “Saints”

counter = 0

For element = 1 to 5

IF myarray(element) = target THEN

Msgbox(target & “ found at position “ & position)

END IF

Next

Searches for “Saints” in the list

1 2 3 4 5

Saints Saints United Saints Aberdeenmy

arr

ay

Software Development

Count Occurrences

Example

Pseudocode Visual Basic

Set target to “Saints”

Set counter to 0

For each element in the array

IF current element = target value THEN

Add 1 to counter

END IF

Next element

Display value of counter

target = “Saints”

counter = 0

For element = 1 to 5

IF myarray(element) = target THEN

counter = counter + 1

END IF

Next

Msgbox(target & “ appears ” & counter & “ times”)

Counts number of times “Saints” appears in the list

1 2 3 4 5

Saints Saints United Saints Aberdeenmy

arr

ay

Software Development

Input Validation

Example

Pseudocode Visual Basic

Start loop

Get number between 1 and 10

IF number < 1 or number >10 THEN

Display “Invalid Number – Try Again!”

END IF

End loop when number >=1 and number <=10

DO

num = Inputbox(“Enter number between 1 - 10”)

IF num < 1 OR num > 10 THEN

Msgbox(“Invalid number – Try Again!”)

END IF

LOOP UNTIL num >= 1 AND num <= 10

Asks user to enter a number between 1 and 10 until they input a valid number

Software Development

Find Minimum

Example

Pseudocode Visual Basic

Set lowest to first element

For each element in the array

IF current element < lowest THEN

lowest = current element

END IF

Next element

Display lowest value

lowest = myarray(1)

For element = 2 to 5

IF myarray(element) < lowest THEN

lowest = myarray(element)

END IF

Next

Msgbox(“ The lowest value is ” & lowest)

1 2 3 4 5

19 12 17 11 23my

arr

ay

Finds and displays the value of the lowest number in a list

Software Development

Find Maximum

Example

Pseudocode Visual Basic

Set highest to first element

For each element in the array

IF current element > highest THEN

highest = current element

END IF

Next element

Display highest value

highest = myarray(1)

For element = 2 to 5

IF myarray(element) > highest THEN

highest = myarray(element)

END IF

Next

Msgbox(“ The highest value is ” & highest)

Finds and displays value of the highest number in a list

1 2 3 4 5

19 12 17 11 23my

arr

ay

Software Development


Recommended