Higher CS Software Design Development
Higher CS Software Design Development
SDD
Programming – March ‘18
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).
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
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.
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
4
Agile Methodologies:- A group of software development methods.
Iterative & incremental development.
Continually collaboration between teams to “evolve” a solution.
e.g.
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.
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
7
Stage 4 Testing
Normal:- 7
Extreme:- 1 & 10
Exceptional:- 1000000000, or “banana”
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
8
Error Types:- Syntax
Execution, (Run-Time)
Logical
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.
Advantages:- • You can see what the code will do before executed;
• Helps spot errors in coding.
9
Stage 5 Documentation
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
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:-
12
Stage 7 Maintenance
13
b) Coding Theory
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:-
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.
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.
Control Structures:- These are methods which allow the program to perform basic
operations.
i.e. Sequence
Selection
Repetition
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
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)
• 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).
16
Data Flow
Parameter Passing:- the name given to the process of transferring, (passing), data,
(Parameters/variables), from one program/sub-program to another.
Advantages
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;
Therefore:-
18
Input Validation NAT 5
Pseudocode
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
19
Linear Search
Pseudocode
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
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
21
Finding Maximunm
Pseudocode
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
22
Finding Minimum
Pseudocode
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
23
c) Types of Programming Languages
24