0% found this document useful (0 votes)
30 views

Higher CS Software Design Development

The document discusses the software development process, including analysis, design, and different methodologies like iterative and agile development. It explains the key stages of analysis including requirements specification, scope, boundaries and functional requirements. Design involves pseudocode, structured diagrams, refinements and user interface wireframing. Agile methodologies emphasize iterative development, client involvement, and evolving solutions incrementally through frequent testing and feedback.

Uploaded by

Quesy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Higher CS Software Design Development

The document discusses the software development process, including analysis, design, and different methodologies like iterative and agile development. It explains the key stages of analysis including requirements specification, scope, boundaries and functional requirements. Design involves pseudocode, structured diagrams, refinements and user interface wireframing. Agile methodologies emphasize iterative development, client involvement, and evolving solutions incrementally through frequent testing and feedback.

Uploaded by

Quesy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Higher Computing Science

SDD
Programming – March ‘18

a) Software Development Process

Stage 1 Analysis

Analysis:- Studying the problem and coming up with a written description of EXACTLY
what is being asked for by the client.
Involves:- Interviewing client to extract exact requirements of software/purpose of program
Producing the requirements specification
Identifying inputs/processes/outputs
Identifying the scope, ( )
Identifying the boundaries, ( )
Detailing the functional requirements, (What it should be able to do).

Should Include:- Purpose


Scope
Boundaries
Functional requirements

Purpose:- A general description of the purpose of the software. 

Scope: A list of the deliverables that the project will hand over to the client and/or
end-
user,
eg design, completed program, test plan, test results and evaluation report.
It can also include any time limits for the project. 

Boundaries: The limits that help to define what is in the project and what is not. It can also
clarify any assumptions made by the software developers regarding the client’s
requirements. 

Functional requirements: The features and functions that must be delivered by the system in terms of
inputs, processes and outputs. 

Client:- Person or company who wants a program written to perform tasks within their own
company.

Software company:- The company paid to produce the software to do the tasks set by the
client.

Program Specification:- This states SPECIFICALLY what the client and software company
have agreed to provide/pay for. This will form part of a LEGALLY BINDING
CONTRACT.

Iterative:- Ongoing.
Must return to previous stages of development process in light of new information
i.e. Analysis, Design, implementation, Testing

1
2
Stage 2 Design

Design:- Plan

PseudoCode:- Numbered list of instructions written in English type statements.


Half way house between analysis, (sentences written in English) and code.
Must include:- Top Level Design
Data Flow
Refinements

Stepwise Refinement:- Used in Structured diagrams & Pseudocode.


AKA Top-down design
A problem is broken down into smaller parts.
These smaller parts can be broken down further into even small parts.
Tiny parts should be easy to solve.

Bottom-up Design:- Designer looks at all the small parts already solved.
Builds new solution from bits of older solutions.
Parts will need to be adapted to new solution.

In reality – solutions are a mixture of top-down and bottom-up design.

Structured Diagrams:- Can also be used to plan a program.


e.g. Example below also shows data flow

Refinements can be shown separately from the top level design.


e.g.

3
Wire Framing:- This is a diagram to represent the user interface, can be used for web sites and databases
also.
Considerations:- Navigational Structure
Presentation of data
Interface design

User Considerations:- Users with Visual Impairments


Users with Hearing Impairments
Users with Motor & Dexterity Impairments

4
Agile Methodologies:- A group of software development methods.
Iterative & incremental development.
Continually collaboration between teams to “evolve” a solution.

• Essential that client is fully involved.


• Programmers divided into teams with small targets achievable by
the end of the day.
• Games are developed this way.
• Programs evolve and can change along the way.
• Provides regular opportunities to assess development/success.
• Shorter iterations of work = quicker response to change.
• Gather requirements at the same time as developing software.

e.g.

RAD:- Rapid Application Development


Aka Joint Application Development
Requires continual input from client and developers
Uses minimal planning
Requires event driven languages
Iterative process

Advantages:- • Projects tend to be finished quickly;


• Clients feel involved;
• Time isn’t wasted on creating unwanted parts;
• Prototypes can stimulate interest in the software.

Disadvantages • Software can be patchy as it represents a series of ad-hoc


solutions.
• Can be difficult to debug.

5
Differences between Waterfall, (aka iterative) and Agile Methodologies

Iterative Agile
Client The client is heavily involved in the The client is involved throughout the process,
Interaction initial analysis stage and at the end of giving constant feedback on prototypes of the
development, when evaluating if the software during development. This feedback is
software meets their needs and acted upon, quickly ensuring the software
matches the agreed specification.  evolves throughout the project. Changing goals
during the development can be positive in terms
of final client satisfaction with the product. 

Teamwork Teams of analysts, programmers, Teams of developers communicate and


testers and documenters work collaborate, rather than teams of experts
independently on each phase of operating in isolation. 
development. Teams mainly work in During a project, fast, face-to-face
isolation with some communication communication between individuals with
required between each phase.  different skills is an important factor in
progressing the project quickly. 
Documentation A detailed project specification is While modelling solutions remains important,
created at the beginning of a project. creating large documents that are never updated
Significant time is spent during the or referred to again upon completion of the
project on design, program project are not. 
commentary and test plans.  Agile focuses on reducing documentation. It
spends time on small cycles of coding, testing
and adapting to change. 
Any documentation produced (for example
internal commentary in code) should focus
purely on progressing the project. 

Measure of Follows a strict plan, with progress Breaks a project down into a series of short
Progress measured against timescales set at the development goals (often called “sprints”). This
beginning of the project.  involves cross-functional teams working on:
planning, analysis, design, coding, unit testing,
and acceptance testing. 
Progress is measured by the time it takes to
produce prototypes or working components of
the software. 
Agile focuses on delivering software as quickly
as possible. 
Adaptive Vs A predictive methodology, focusing An adaptive methodology, focusing on adapting
Predictive on analysing and planning the future quickly to changing realities. When the needs of
in detail and catering for known a project change, an adaptive team changes as
risks.  well. 
Predictive methods rely on effective An adaptive team has difficulty describing
early phase analysis and if this goes exactly what they will do next week but could
very wrong, the project may have report on which features they plan for next
difficulty changing direction.  month. 
Predictive teams often institute a The further away a date is, the vaguer an
change control board to ensure they adaptive method is about what will happen on
consider only the most valuable that date. 
changes. 
Testing Testing is carried out when the There is no recognised testing phase, as testing is
implementation phase of the project is carried out in conjunction with programming. 
complete. 

6
Stage 3 Implementation

Implementation:- The creation of a program, (code).

Program needs to be:- • Fit For Purpose - Meets the specification.


• Maintainable - Later changes can be done easily and quickly.
• Reliable - Free from bugs.
• Readable - Can be easily understood by other people.
• Portable - Can be adapted to run on different types
computers.
• Efficient - Does not require excess processor time & memory
disproportional to the scale of the program.

Language Choice:- Depends on:- • Type of problem;


• Hardware & Software compatibility;
• Data types available;
• Features and constructs available;

7
Stage 4 Testing

“Testing can only convince us of the presence of


errors, and not of their absence”

Testing Types:- Normal - Testing using expected inputs.


Extreme - Testing using boundaries of expected inputs.
Exceptional Testing using unexpected inputs.

E.G. Enter a number between 1 and 10

Normal:- 7
Extreme:- 1 & 10
Exceptional:- 1000000000, or “banana”

Test Plan:- Testing should follow a plan.


Should include:- • Part of program being tested;
• The expected output from the test;
• Should include normal, extreme & exceptional test
data.

Acceptance Testing:- Client should be involved in acceptance testing as:-


• Software can be tested on clients systems;
• Software can be tested on eventual users;
• Can provide feedback to software development company;
• Client needs to agree that software meets their needs before
accepting/paying for it.

Usability Testing:- Set of users given the same series of tasks to perform.
Tasks should encompass all functional requirements of software.
Should have combination of novice and expert users.
Allows developers to make changes based on feedback

Beta Testing:- Last stage of testing prior to release.


“Trusted” users test first draft of program.
Tested under “normal” conditions for the program.
Allows developers to make changes based on feedback before general
release.

8
Error Types:- Syntax
Execution, (Run-Time)
Logical

Syntax Error:- Mistakes in the “grammar” of the programming language,


e.g. typing errors.
Reported by the translator, (interpreter or compiler).

Execution Error:- Not detected by translator.


Detected when program is run.
Causes program to crash
e.g. dividing by 0
reading a file when file cannot be found
Good software should have error-tapping techniques to avoid these errors.

Logical Error:- Mistakes in the actual way the solution has been thought out.
Not detected by translator.
No error is reported.
However, wrong results produced.
e.g. adding two numbers instead of dividing them.

Dry Runs:- Requires test data & a listing of the program code being tested.
Developer calculates EXACTLY what happens as the data passes through the part
of the program.
Pencil & paper exercise.
Trace Table can be used to identify variables and data expected to be held.

Trace Table:- Used to test algorithms, (code).


Used to test for LOGICAL errors.
Shows each variable and the subsequent values as they pass through the
algorithm.
Can be used with a dry run.

Advantages:- • You can see what the code will do before executed;
• Helps spot errors in coding.

Breakpoints:- An intentional stopping or pausing place in a program for debugging


purposes.
Used to identify the point at which errors occur.
e.g. Stop program at line 458

Watchpoints:- A conditional breakpoint. A breakpoint for data rather than code.


Stops the program when a particular variable(s)’ data matches certain criteria.
e.g. Stop program if variable score < 0

9
Stage 5 Documentation

Documentation - “Paperwork” which accompanies the product.


Now provided digitally.

i.e.

User Guide:- Describes to the eventual user how to operate the program.
Ideally would include tutorials.

Technical Guide:- Describes to the user how to install the program on their system.
Should include a trouble shooting section.

10
Stage 6 Evaluation

Evaluation:- Working out whether the program is “good” or not.

Questions to ask when evaluating:- Is the program FIT FOR PURPOSE?


Is the program using EFFICIENT CODING CONSTRUCTS?
Is the program USABLE?
Is the program MAINTAINABLE?
Is the program ROBUST?

Fit for purpose:-  This reflects whether the software carries out all the tasks required of the software
specification. 
Your evaluation should identify any discrepancies between the software specification and
the completed software. 

Efficient coding constructs:- An efficient program should not waste memory or processing time on
unnecessary tasks or repetitions.
This reflects whether the software writers have used their knowledge of
constructs to help them create efficient code. For example using: 
 suitable data types or structures 
 conditional or fixed loops 
 arrays 
 nested selection 
 procedures or functions with parameter passing 

Your evaluation should identify where your coding has been efficient. 

Usability:-  This reflects how intuitive the software is from a user’s perspective and should include: 
 the general user interface 
 the user prompts 
 the screen layout 
 any help screens 

Your evaluation should identify features of the software that have enhanced usability for the
user. 

Maintainability:- This reflects how easy it is to alter the software. The factors affecting maintainability
include: 
 readability of the code — made easier by using meaningful variable names,
comments, indentation and whitespace 
 amount of modularity — using functions and procedures effectively 

Your evaluation should identify how your code helps with the maintainability of the
software. 

Robustness:-  This reflects how well the software copes with errors during execution including: 
 exceptional data, eg the computer crashing if “out of range” 
 incorrect data entered 

Your evaluation should reflect the testing that has been undertaken to meet the specification, as
well as to demonstrate some degree of robustness. 

11
Evaluation Report:- Should be carried out by the developer and given to the client.
This explains the evaluation in terms of:-

• Fitness for purpose;


• User Interface;
• Readability;
• Robustness;
• Reliability;
• Portability;
• Efficiency;
• Maintainability.

12
Stage 7 Maintenance

Maintenance:- Changing to correct mistakes or to improve/change.

3 types of maintenance:- • Corrective;


• Perfective;
• Adaptive.

Corrective:- Fixing bugs that appear once the program is in use.


Cost is responsibility of programming team.

Perfective:- Adding new features


Altering due to issues raised during evaluation
Re-released as new version.
Cost is usually met by client.

Adaptive:- Changed due to new conditions e.g. New hardware/software


Cost usually met by the client.

13
b) Coding Theory

Data Types:- Real - Stores decimal numbers


Integer Stores whole numbers
Character Stores a single letter or symbol
String Stores list of characters e.g. a word
Date Stores a valid date
Boolean Stores one of two possible values, e.g. True or False
Sample Audio or Video clip
Array a set of data items of the same data type.
Record multiple arrays which can be accessed using the same index.
Parallel 1D Arrays This is when a collection of arrays are used together to represent a
single array of records, (but it is not records!!!)
Each array should have the same number of data items.
e.g. 3 separate arrays forename surname class
these 3 arrays can be used together to display information
about 1 pupil

forename[3] & Surname[3] & class[3]

Array of Records This is simply more than 1 record stored as a single entity.
The array stores many records, each record storing many data
Items
e.g. ExamDates can be records storing 4 fields per exam
– subject, day, month & year
e.g. Pseudocode for creation of Examdates Records:-

• Set up the record structure:-

RECORD examdata TO {subject, day, month, year}

• Setup up number of records:-

SET examdates[4] AS examdata creates an array of


5 records, 0,1,2,3,4

• Place data in records

SET examdates[1] TO examdata (“Computing”, 08,05,17)


SET examdates[2] TO examdata (“Art, 09,05,17)

Array Advantages:- • Only one line of code required to create multiple values;
• Can be traversed using loop structure
• Parameter passing easily implemented with one line of code;
• Code is very efficient;
• Each individual element of the array can be referenced by indexing.

Disdavantages:- • Can only store 1 data type.

Variables:- This is how data is stored in memory by a program


Each variable should have a name and a data type.

14
Local Variable:- Only used within the sub-program it is declared in.
Advantages:- • Allows variables with same name to be used in different procedures
• Aids modularity.
• Saves memory as when the subprogram is complete the area in memory
used by the local variable is freed up.

Global Variable:- Can be used throughout the entire program passing from one sub-program to
the next.
Inefficient as it needs to be held in memory for the duration of the whole program.

Variable Scope:- The area of code in which a variable is usable.


e.g. • a local variable’s scope is only the sub-program it is declared in.
• A formal parameter which is usable within that procedure/module.

Control Structures:- These are methods which allow the program to perform basic
operations.

i.e. Sequence
Selection
Repetition

Sequence:- This basically means that one instruction follows another.


The computer carries out one command at a time in the order the developer states.

Selection:- This allows the program to make a decision.


e.g. IF statements
CASE/SWITCH statements

Repetition:- This allows the program to carry out the same commands over and over again
without having to type up the commands in the program over and over again.
These are called LOOPS.

Fixed Loop:- This is when we know in advance the number of times we need to loop.
e.g. Loop 10 times

Conditional Loop:- This is when we don’t know how many times we need to loop, it
depends on something happening or not, a condition.
e.g. Loop UNTIL number1 > 100
Repeat WHILE number1 >1000

Complex Condition:- Contains multiple conditions which have to be met.


Can be used in Selection (IF’s and conditional loops)
e.g. age >17 AND age < 100

Concatenation:- Joining two or more strings.


e.g. Forename = John Surname = Smith
put forename into fullname
put “ “ after fullname
put surname after fullname
fullname = John Smith

Procedure:- A sub-section of code.


Usually designed to perform a particular task.

15
Function:- A piece of code, written by the programmer, which returns a single value

Pre-Defined Function:- A piece of code, built into the software language, which returns a single value.
e.g. length, round, random
creating substrings
convert character to ASCII
convert ASCII to character
modulus
convert floating-point numbers to integers (INT & ROUND)

• Substrings:- A character or a group of characters being removed from a string.


e.g. put ‘abcde” into alphabet
put char 1 to 3 into line 5 of field “output”
abc would be displayed in screen

• Convert Characters to ASCII:- This pre-defined function returns a character into its equivalent ASCII
numeric value
e.g. A = 65
a = 97
• Convert ASCII to Characters:- This pre-defined function returns an ASCII numeric value into it’s
equivalent character
e.g. 65 = A
97 = a

• Modulus:- This pre-defined function returns the integer remainder from a division
e.g. 15 divided by 2 equals 7 remainder 1
the modulus is 1

• Converting floating point to integers:- This pre-defined function returns an integer value when given a
decimal value.
This is done by removing the decimal digits, NOT ROUNDING.
e.g. decimal = 99.99 integer = 99

Formatting of I/O:- A developer has to take into account the format of data being read
into the program, (INPUT), and data being outputted/displayed, (OUTPUT).

Modularity:- Splitting the program into sub-programs, (sub-routines).


These sub-programs can be worked on by different teams.
They can be called upon many times within a program.
Types:- Procedures
User-defined Functions, (created by developer, only returns a
single value).
Pre-defined Functions, (built into programming language, only
returns a single value e.g. random, length etc.).

16
Data Flow

Data Flow:- The movement of data between sub-routines.

Parameter Passing:- the name given to the process of transferring, (passing), data,
(Parameters/variables), from one program/sub-program to another.

Advantages

• Data flow is clearer so program is more readable and easier to maintain.


• Portability is improved as code can be reused without altering variable names.
• Aids modularity.
• Reduces clashes between variable names.
• Reduces impact or load on main memory.

Formal Parameters:- parameters used in the sub-routine definition

Actual Parameters:- parameters passed into the routine when called from another sub-
routine.

Passing Data by Value:- This allows a variable to be passed into a sub-routine, but not passed
back out again, (IN).
The sub-routine is given a value, the original value is not affected!!!
Can be more demanding when using arrays because:-
• a copy of the data has to be created.
• copy takes up RAM space.
• increases number of instructions required.

Passing data by Reference:- This allows a variable to be passed into a sub-routine, updated,
and passed back out again, (IN/OUT).
Arrays are always passed by reference.
The sub-routine is given the address of the original variable, it can be
changed/updated.

Sequential Files:- These can be used as input for a program or output from a program.
READ - Input data
WRITE - Output data
CREATE
CLOSE
OPEN

17
Standard Algorithms

Standard Algorithms:- A piece of code which is used on a regular basis in most programs.
These are usually stored as templates and can be adapted to suit the
current program’s specifications.
i.e Input Validation; (NAT 5)
Linear Search.
Counting Occurences;
Finding Minimum;
Finding Maximium;

You need to be able to describe and give examples of these


standard algorithms in pseudocode & code.

Therefore:-

Memorise the pseudocode & code for these!!!!!!!!!!

It’s a common exam question.

18
Input Validation NAT 5

Pseudocode

1 RECEIVE mark FROM KEYBOARD


2 REPEAT UNTIL mark is between 0 & 30
3 SEND error message to DISPLAY & RECEIVE mark FROM KEYBOARD
4 END REPEAT
5 RETURN mark

Algorithm in LiveCode

1 Function input_validation
2 Ask "Please enter a whole mark for the exam between 0 and 30: "
3 Put it into mark
4 Repeat until mark >= 0 and mark <= 30
5 Ask "Invalid mark, please enter a whole number between 0 and 30: "
6 IF the result = "Cancel" THEN exit to top
7 Put it into mark
8 End Repeat
9 Return mark
10 End input_validation

Explanation of Working

• Mark typed in by user


• Conditional loop started – will not come out of loop until mark is between 0 & 30
• Error message displayed and user asked to reenter mark.
• Continues until valid mark entered
• Valid mark returned

19
Linear Search

Pseudocode

1 RECEIVE StudentID FROM KEYBOARD


2 SET counter TO 1
3 SET found to false
4 REPEAT until found = true OR counter = 20
5 IF arrayID[counter] equals StudentID THEN
6 SET found to true
7 END IF
8 SET counter to counter + 1
9 END REPEAT

Algorithim in LiveCode

1 Function linear_search
2 Ask "Please enter the ID of the student: "
3 Put it into StudentID
4 put 1 into counter
5 put false into found
6 Repeat UNTIL found = true OR counter = 20
7 IF arrayID[counter] = StudentID THEN
8 Put true into found
9 END IF
10 put counter + 1 into counter
11 End Repeat
12 End linear_search

Explanation of Working

• Search data asked for – entered by user


• Counter set to 1 to set up variable to keep track of how many students have been checked.
• Boolean variable set to false
• Each student is checked in the array
• Loop stops if ID is found or counter gets to 20 (all students checked).

20
Counting Occurances

Pseudocode

1 SET PassedExam to 0
2 REPEAT 20 times
3 RECEIVE arraymark[loop] FROM KEYBOARD
4 IF arraymark[loop] >50 THEN
5 Add 1 to running total (PassedExam)
6 END IF
7 END REPEAT

Algorithm in LiveCode

1 Function counting_occurances
put 0 into PassedExam
2 Repeat with loop = 1 to 20
3 Ask "Please enter the Computing mark of student number: " & loop
4 Put it into arrayMark[loop]
5 IF arrayMark[loop] > 50 THEN
6 Add 1 to PassedExam
7 END IF
8 End Repeat
9 Return PassedExam
10 End counting_occurances

Explanation of working

• The counter, (i.e. PassedExam), is initialised to zero.


• For each pupil (20) their mark is entered
• IF their mark is above 50, 1 is added to the counter
• Once all pupils have been entered, the counter records the number of pupils who have passed.
• Function passes out this number (those who have passed).

21
Finding Maximunm

Pseudocode

1 SET maximum to arraymark[1]


2 REPEAT 19 times
3 IF arraymark[loop] > maximum THEN
4 SET maximum to arraymark[loop]
5 SET position to loop
6 END IF
7 END REPEAT
8 RETURN position

1 Function finding_maximum
2 Put arrayMark[1] into Maximum
3 Repeat with loop = 2 to 20
4 IF arrayMark[loop] > Maximum THEN
5 Put arrayMark[loop] into Maximum
6 Put loop into Position_of_Max
7 END IF
8 End Repeat
9 Return Position_of_Max
10 End finding_maximum

Explanation of Working

• Set the firstmark to be the biggest mark


• Start repeat loop to check all other marks
• If current mark is greater than the current maximum, change the maximum to new mark
• Record position of new maximum in the array
• Return the position of the maximum value in the array

22
Finding Minimum

Pseudocode

1 SET minimum to arraymark[1]


2 REPEAT 19 times
3 IF arraymark[loop] < minimum THEN
4 SET minimum to arraymark[loop]
5 SET position to loop
6 END IF
7 END REPEAT
8 RETURN position

Algorithim in LiveCode

1 Function finding_minimum
2 Put arrayMark[1] into Minimum
3 Repeat with loop = 2 to 20
4 IF arrayMark[loop] < Minimum THEN
5 Put arrayMark[loop] into Minimum
6 Put loop into Position_of_Min
7 END IF
8 End Repeat
9 Return Position_of_Min
10 End finding_minimum

Explanation of Working

• Set the firstmark to be the smallest mark


• Start repeat loop to check all other marks
• If current mark is less than the current minimum, change the minimum to new mark
• Record position of new minimum in the array
• Return the position of the minimum value in the array

23
c) Types of Programming Languages

Procedural High Level Language

High Level:- • Commands are similar to English.


• Easy to program in comparison with Low Level Languages.
• Portable.
NB Most languages used are High Level Languages. E,g, LiveCode, HTML

Procedural/Imperative:- Use command and keywords;


Solution is an algorithm;
Split into separate “chunks”,
aka procedures; routines; sub-routines; methods, etc.
Typical Features:- Data Types
Operations, (+, -, *, /, AND, OR, NOT)
Sequencing
Looping
Procedures/subroutines
Parameter passing

e.g. BASIC PASCAL


C++ FORTRAN
LiveCode

24

You might also like