Notes for P5, M1, D1

Download Report

Transcript Notes for P5, M1, D1

P5, M1, D1
• Explain where software design structures fit
into the systems development life cycle. (P5)
• Explain the importance of creating program
code which is of high quality. Describe how
the code quality can be improved. (P5, M1)
• Discuss the ways in which a programmer can
make codes easier to read. (D1)
Where possible include examples of the
methods for improving the quality and
readability of program code.
The software development Life cycle
• The SDLC is a process divided into a number of stages.
– there are usually 6 stages
1. Gather user requirements: understanding the scope
of the project
2. Create specification: identifying the requirements
3. Create design: designing the system
4. Write Programs: writing (coding) the programs
5. Test programs: testing the programs work properly
6. Maintain system: maintaining the system once it has
begun to be used.
Designing the system
• The software design and structure fit within the 3rd stage of the
SDLC, that is the…….
• You will need to draw up a design for the program which defines:
– The user interface that will be provided: this might include designs for
the screens that users will use to input data and the reports that will
be output from the system.
– The general structure of the program, including how it will be broken
up into procedures and how those procedures will relate to each other
(Structured Diagrams)
– The detailed design, showing how each of the procedures will carry
out their required tasks (structured Diagrams)
– How data will be stored by the system, including the variables that will
be used and the file structures required (Data Dictionary)
Designing the system
P5, M1, D1 - Readability
• Programmer comments: you have already demonstrated
this within the program you created in C++.
– Explains what that line of code does
– Makes it easier for other people to read
– Important if modifications needed to be done by other
programmer in order to maintain and fix bugs
• Using appropriate names for variables. Example using
‘Length’ instead of ‘a’. Again you have demonstrated this
within the codes you created.
– Programmers recommend prefixing the variable name with its
data type. E.g. integer variable called Points might be names
IntPoints
• Using indentation: this is normally used to indicate when a
loop or selection starts and ends making it easier to read.
P5, M1, D1 – Quality of Code
• Reliable and Robust: Although you might imagine users will use
the program in the way it was intended, sometimes they may
misuse it. For example, users may make a text input where a
numeric one is expected. A well written robust program will be
able to cope with such a user error and display an error message
rather than crashing. The best way to ensure a program is as robust
as possible, is by thoroughly testing it to ensure it works properly
and can cope with being used incorrectly.
• Usability: the best programs are easy to use and intuitive. There
are some easy things you can do when designing the user interface
to make program easier to use. Clearly labelled controls (Buttons,
text boxes etc.), logically arranged controls (that is arranged in
order they are likely to be used) and controls grouped by function
all make it easier for the user to figure out how the program is to be
used.
P5, M1, D1 – Quality of Code
• Portability: this is the ability of a program to run on
different hardware or software platforms. This maybe
important for some systems. Java for example can run
on multiple platforms.
• Maintainability: every commercial software product
needs to be maintained with updates, bug fixes and
new features. There are a number of things that can
be done to make software easier to maintain.
– These include: good detailed technical documentation
describing the design and implementation of the software.
– Well written programs- which we looked into earlier