Introduction to Software Development - valerianweb.com · Introduction to Software Development by...

Preview:

Citation preview

Dr Derek Peacock 2014 1

Introduction to Software Development

by Derek Peacock

Dr Derek Peacock 2014 2

What is a Computer ?

Electronic InformationProcessingMachine

Dr Derek Peacock 2014 3

Basic System

InputData

(CPU)Processor

Output Data

Program

Dr Derek Peacock 2014 4

Computer Programs

A sequence of coded instructions fed into a computer to enable it to perform specified operations upon data

Program = Set of cooperating Classes

Class = Operations and Data

Dr Derek Peacock 2014 5

Operations

Procedures for the solution to a problem in a finite number of steps

1. Get the amount in GBP2. Get the exchange rate3. Calculate the amount in Euros4. Display the result in Euros

Dr Derek Peacock 2014 6

Data & Data Structures

ObservationsFactsMeasurementsAttributesValuesReal or imaginary

ListsQueuesStacksTablesRecordsTrees

Dr Derek Peacock 2014 7

Program Languages

Machine CodeC/C++/C#Visual Basic JavaPascal(Delphi)COBOLSQL

AssemblerPL/1ADASmall TalkSNOBOLFORTRANLISP

Dr Derek Peacock 2014 8

Machine Code (Low Level)

0E E8 D9 010E E8 45 02B8 3E 01 1E50 1E 50 B8

‘AssemblerLD A, 01LD B, 02Add A, B

Total FlexibilityVery FastMany InstructionsDifficult to readDifficult to Debug

Dr Derek Peacock 2014 9

Operations in English

Work out the equivalent amount in Euros for a given amount in GBP

Dr Derek Peacock 2014 10

English

ImpreciseAmbiguousVery Large DictionarySame word can have different meaningsRules of grammar complex and inconsistent

Dr Derek Peacock 2014 11

C#.NET

Easier to LearnVisual DesignObject OrientedMicrosoft Support .NET supportVisual Studio IDE

Dr Derek Peacock 2014 12

C# Operation or Method

Console.WriteLine("Starting Convert Pounds to Euros!");Console.WriteLine();

Console.Write("Enter amount in British Pounds £ >");string value = Console.ReadLine();pounds = Convert.ToDecimal(value);euros = pounds * 1.2471m;

Console.WriteLine("Euros = {0}", euros);Console.WriteLine();Console.WriteLine("Ending Convert Pounds to Euros!");

Dr Derek Peacock 2014 13

Java

Platform IndependentNot by Microsoft (by Oracle)Object OrientedWeb integrationVisual IDEsEnterprise Level and Mobile device support

Dr Derek Peacock 2014 14

Java Operation

private void calculate_Euros(){inputAmount = InputTextBox.getText()exchangeRate = RateTextBox.getText()

Euros = inputAmount * exchangeRate

OutputAmountTextBox.setText(euros)

}

Dr Derek Peacock 2014 15

C++

Leading LanguageSystems LanguageFast ExecutionObject Oriented

Main()

{

scanf(“%d”, &GBP);

scanf(“%d”, &ERate);

Euros = GBP * ERate

printf(“Euros = “);

printf(“%d”, Euros);

}

Dr Derek Peacock 2014 16

Compilation (translatation)

High LevelLanguage

Input Program

Compiler ObjectCode

Output

Dr Derek Peacock 2014 17

Linking (using pre-built libraries)

CompiledLibraries

MachineCodeLinker

ObjectCode

Input Program Output

Dr Derek Peacock 2014 18

Execution (Run Program)

Input Program Output

Data MachineCode Results

Dr Derek Peacock 2014 19

Software Development Life Cycle

Terms of Reference

RequirementsAnalysis

Software Design

Implementation

Testing

What ? (Outline)

What ? (Detail)

How ?

Dr Derek Peacock 2014 20

Terms of Reference

I need a program that I can use to calculate how many euros I will get for a given amount of British currency.

Dr Derek Peacock 2014 21

User Requirements

Dr Derek Peacock 2014 22

Software Design

EnterPounds

CalculateEuros

DisplayEuros

Dr Derek Peacock 2014 23

Delphi Implementation

procedure ConvertToEuros();var

pounds : currency;euros : currency;ExchangeRate : Double;

begin

pounds := GbpTextBox.Text;ExchangeRate := ExchangeRateTextBox.text;

euros := pounds * ExchangeRate;

EurosTextBox.Text := “Euros = ” & euros;

end;

Dr Derek Peacock 2014 24

Testing

Function Tested

Data Used Expected Result

Actual Result

Calculate GBP = 400Rate = 1.5

Euros = 600 Euros = 600

Calculate GPB = Rate =

Error Message

Error Message

Calculate GPB = -400Rate = 1.5

Error Message

Euros = -600