Você está na página 1de 35

Software Design and Development Study

Notes
Development and Impact of software solutions
Social and Ethical Issues
Rights and Responsibilities
The Developers of Software solutions have many rights, which they own and
owe towards the users of their software. These rights and responsibilities are:
 Authorship
 A developer has the rights to own the ideas and software that they develop
 The developer has a responsibility to protect their interests in the
development of the software and the rights of the people who are involved in
the development of the product
 The right of authorship is known as copyright
 Future developers must respect copyright issues if they wish to use new
ideas or modules in their software.
 Copyright means that people cannot use any items in the product
 Reliability
 Reliability refers to the guarantee of the product to run as advertised and
according to the manual for a certain period of time
 Under the reliability issues the software developer has the responsibility to
provide service updates for any faults in original product for at least the
duration of the warranty
 The software must be able to function with acceptable response time, and
fail to crash or une
 Quality
 The software must fulfil software standards
 Quality ties in closely with reliability. The quality of the product must be
satisfactory so that it is able to be reliable under general circumstances
 The software must be consistent within the program and compared to other
programs performing similar function. It must also be consistent with the
typical design interface of the operating system on which the program runs
 The program must have quality documentation available to the user. The
quality of the documentation is defined by how well it helps the user perform
the basic tasks of the program. How the documentation deals with common
troubleshooting problems. Finally how easy the user manual is to understand
relative to the experience of the users of the program
 Response to problems
 The developer has the responsibility to provide adequate response to
problems users of the software encounter
 They must attempt to rectify all security issues especially in software
accessing the internet or running over a network
 Developers must implement problems identified in the program as quickly as
possible
 Code of Conduct
 The developer has the responsibility to make sure that all aspects of their
software cohere to all legal issues such as intellectual property and copyright

-1-
 They must acknowledge all people who contributed to the production of their
software
 Adhere to privacy laws and rights
 Use of appropriate prompts and language used in both internal and external
documentation such that it is not racist, offensive or in any way degrades any
persons of society, especially the users of the software
 Viruses
 Developers must make sure that their software does not pose any problems
to the functioning of their computer. The software must not carry any viruses
 Developers must ensure that viruses cannot be spread or created by the use
of their software

Piracy and copyright


Software piracy is the theft of computer programs from the developers.
Such piracy can include the illegal installation of files on one machine or a group of
machines that is outside the terms of the license agreement of the software. It is
also the illegal sale and distribution of copyrighted software. Either of these
actions results in an increase in the price of the product for ethical users of the
software as the company is not receiving the profits necessary to develop the
software further. Two aspects of piracy are intellectual property and plagiarism
 Intellectual property - is the personal ownership of the creative ideas that
develop from an individual’s mind or intellect. Types of property include
patents, trademarks, designs and confidential business information.
However in today’s computer world determining intellectual property is a
hard task as many people will create software based on specific ideas.
This is why copyright and plagiarism laws have been put in place to
protect this intellectual copyright
 Plagiarism – is the theft of the ideas and expressions of another person.
Often this includes the steeling of code and design in programs. To
prevent plagiarism and protect intellectual property license agreements
and copyright laws have come of place as outlined below

License Agreements
Licence agreements give the user different rights according to the conditions
of the use and purchase of the software. The three main types of agreements are
shareware, freeware and public domain software
 Freeware – gives the user complete access to the program without having
to pay any money. However any of the code cannot be copied or modified.
However the program can be freely distributed
 Shareware – is distributed software for trial purposes before purchase. It
can be freely distributed, but after the trial period is up the person user
must pay an amount of money – generally less than the cost of commercial
products directly to the developer. The code again cannot be copied or
modified
 Public domain software – are any programs that are freely available for
copying and modification. Such software comes about because the owner
has forfeited copyright or has been dead for over 50 years. Such software
are good tools for new developers.
Networks be coming increasing common so many programs have evolved to
encompass network use. This is done is one of two ways. The program either has
centralised software where a single copy is run from a central computer. The
software license then needs to cover the each machine that uses the software. The
second method is distributed software where each computer has a copy of the
-2-
program on the machine but runs the program from a central database of
information.
EULA – End User License Agreements are used to prevent the illegal re-
distribution of software. There are three types of EULA agreements.
 Single Use licences – allow the purchaser to install one copy of the
software on one computer only
 Multi-use licences – provide one copy of the software to be distributed on
a specified number of machines
 Network licences – provide the use of the software across a network with
a specific number of computers

Copyright
Copyright is the legal protection of computer programs against illegal
plagiarism or piracy. It provides the developer legal right to control the use of
their product. The protection given by copyright does not usually protect the idea
behind the program, but the way in which the idea is expressed. Current copyright
laws allow the user to:
 Make or have backup copies of the original program in case the original
software is damaged
 Use a copy of the program for research or study purposes. Ie look at the
code and layout of the software to see how such programs interact.
However the code cannot be modified, copied or changed

Reverse Engineering
Reverse engineering is the process of reading source code and translating it
to an algorithm. Reverse engineering is only illegal if it has been carried out by a
person who does not own the program and then redistributed the code in another
language or different format.

National/International views to piracy and copyright


There are many current day events that effect the issues of piracy and
copyright. Some examples are highlighted below:
 In Indonesia in 2005 to prevent the use of pirated software which was a
major problem. To overcome this issues Microsoft charged people in
Indonesia about $1.50AU to legally own the software and reduce the rates
of piracy in the country.

Application of software development approaches


There are four different types of approaches to software development. The
four different types are Structured, Prototyping, Rapid Application (RAD) and End
User (EUD). Below is a summary table of the of each types of approach
Approac Advantages Disadvantages
h
Structur Thoroughly tested Costly
ed Should meet the exact Time consuming
requirements of users Required a wide range of
Uses a range of experts different people with different
skills
Prototypi Relatively fast development Many be difficult to implement as
ng Models a larger project, thus a full working program
allows easier modification and
visualisation of the end product

-3-
RAD Fast development (RAD) Many not meet exact program
Relatively cheap requirements
Uses considerable amount of Many involve copyright and
existing reusable code intellectual property of others.
(Developers must be careful not
to break laws)
End-user Should meet exact user Limited to simple project and
requirements limitations of application
Quick and cheap programs

Structured Approach
The structured approach follows
the software development cycle. It
considers the program on a whole and
takes logical steps to arrive at the end
product. The process is time consuming
and costly and necessary and suitable to
tackle a large program.
Because the process is long a
complex often a team of people is
required to tackle the problem. Some of
the people include: system analyst,
designers including software engineers,
programmers, graphic designers and
consultants, managers, trainers and
users. The software analyst is the person
who is generally given control of the
management of the project and is the first level of communication between the
management and development team.
In development the structured approach follows the development cycle as on
the right. Each step is explained in more detail below:

Phase 1: Defining the problem


This step is used to help the team thoroughly understand and define the
problem itself. If the problem is not properly understood the program may end up
solving a different problem than the one that needs to be solved. If this step is not
properly sorted out, it will take considerable time and cost to fix the problem later
on. Management is also completely involved in this process

Phase 2: Planning the solution


This step involves a further understanding of the needs and requirements of
the end users. This step also looks at the choice and methods of how the problem
will be solved. To get the needs of the end user four main tools are used: written
documents, questionaries/surveys, interviews and observations.
Planning is a complex phase during which each of the following steps will be
undertaken:
 Planning the data and program structures to be used
 Designing algorithms
 Planning the user interface
 Scheduling the project
 Choosing a programming language
The above will be looked at in more detail later on
-4-
Phase 3: Building the solution
This step requires the full involvement of the development team (analyst,
designers, programmers, users and management). Each member must have a clear
understanding of the goals and the overall plan for the project.
The solution to the large program is usually broken down into smaller
modules. This process is called step-wise refinement. This makes the program
much simpler to tackle. The reasons for refining the problem are:
 Greater efficiency as each module can be separately designed and tested
 All members of the team can be involved at the same time
 Modules can be separately testes and modified without affecting the
entire project
 It is easier to debug if one module is tested at a single time
 Modules can be reused or modified and reused at some other similar point
in the project or in other projects.

Phase 4: Checking the solution


Checking the solution is a continuos part of the cycle. This testing involves
the program using real data and can include acceptance and beta testing.
Acceptance testing involves users to test custom software. Beta testing is used in
application software development with the potential users of the product. The
point of all testing is to make sure the program meets the requirements of the
originally defined program. After all testing has been done and errors fixed, the
program will be passed to management who will approve and implement the
program.

Phase 5: Modifying the solution


Often it is necessary to modify the program after it has been implemented so
it works more efficiently, copes with improvements in hardware and software
changes or expansions to cover more tasks. Changes at this stage can be very
costly and are only undertaken is they are small or crucial to the operation of the
program. Otherwise the analyst will suggest the cycle be started again and a new
version of the program released.

Prototyping Approach
The prototyping approach involves building a working model of the program
that is evaluated by the users. Usually the model is then modified and evaluated
further, and may finally become the entire solution. The approach usually involves
a small team of programmers and one or more users. Beta testing is often used by
such an approach.
Prototyping is used for many reasons including quick development of the
program, a clear view of product requirements, to allow trial-and-error testing for
new concepts, for demonstration purposes or to use as a substitute for a more
expensive program. This approach is also often used a the beginning or planning
stages of the structured approach.
Two types of prototypes are used:
 Concept prototypes – are prototypes developed to gather information to
be used in another program. The program is not intended for a full
working program itself. 5GL languages are often used for this approach
because they are more dynamic and allow better feedback.
 Evolutionary prototypes – are prototypes, which will later become full
working programs. A model is produced and then later refined This
approach is used is the planning stages do not provide enough
information on the requirements of the program.
-5-
Some aspects to note in this approach are that the emphasis of the program
is on the menus, windows, input and output processes. Little security or error
recovery is considered. There is also reduced documentation compared to the
structured approach, which leads to harder maintenance of the system.

RAD approach
The RAD approach is any method of software design that uses tools to
quickly generate a program for a user. The approach uses existing solutions or
code, CASE tools and templates. RAD also lacks formal programming stages.
This approach involves a very small team, low budget and minimal time on
small-scale projects. It is taken across a range of coding languages.

End user development approach


EUD is where the user adapts existing software tools to suit their needs or to
obtain a solution to a problem, which they have. This is an informal program
production usually written in 4GL languages. Programs usually written include
adding menus to applications for additional functions or repetitive actions, or
adding macros to larger programs. One disadvantage is that end users often
duplicate the same tasks.

Methods of Implementation
There are many ways in which a new software solution can be implemented.
These methods are:
Direct – the new software takes over from the old software solution from a
particular date onwards

OLD NEW

Phased – the new software solution is gradually introduced into the


environment one step or item at a time while the old system is gradually phased
out
OLD OLD OLD NEW
OLD OLD NEW NEW
OLD NEW NEW NEW

Parallel – both new and old systems run at the same time. This is helpful in
many ways. If the new system has an error or flaw this can be picked up while the
old system is still running, therefore data is not lost. It can also see if the new
software solution is appropriate for the environment in which it is running. If the
new system is then to be used, the old system is directly removed and the new
system takes over, vice versa if the new system does not function properly or does
not meet the needs of the user
OLD
NEW
NEW

-6-
Pilot – a complete section of the environment or organisation is directly
converted to the new system to see if the new system works in the organisation. If
the new system is appropriate then the entire organisation is converted to the new
system

OLD OLD NEW NEW

OLD NEW NEW NEW

Current Trends in software development

Outsourcing
Outsourcing is the process whereby a company needing software services
hires an outside organization to handle all or part of these services. The range of
activities performed includes regular maintenance of systems, modifying or
installing programs etc. Contracts can range from 1 to 10 years.
The reasons for outsourcing include:
 New technology is readily available
 Development time is faster
 Gaining experts in the field
 Cheaper
 Higher quality results
 Resources not available internally
 Better response to change
The advantages of outsourcing include saving of money on as a result of
lower staff numbers and effective use of scarce technological assets.
Disadvantages include the difficulty in breaking unsatisfactory contracts; the
outsourced company may not understand the ethos of the organization, and the
organization can loss control of the system and be unable to fix any minor
problems.

Popular approaches
 Increased ability for EUD
 Editors and compilers for ‘non-programmers’ to generate simple
programs and websites
 Greater distribution of code libraries
 Use of hypermedia – the use of multimedia in which a user can browse a
program at their whim

Popular languages
 3GL-5GL languages
 BASIC/QB/VB
 C/C++
 Prolog
 SQL
 Java
 Cobol

Employment trends
Employment in the software development field has been increasing over the
last few years since the .com crash. This comes about due to the increase of the
-7-
use in computer technology in many other areas, rather than just the creation of
computers. Science and medical fields are increasingly requiring processor
technology, increasing the number of jobs available.
The jobs available also have changed where many programmers work on
short contracts with companies, or as consultants. More skilled jobs, and
management positions are looking for higher education graduates, simply for the
training and skills they have.

Networking
Networks in work places are becoming increasingly abundant, so software
developers have developed ways to cope which such systems. These include the
development of operating systems specifically run networks or have the inbuilt
capability to provide small networks with adequate security. Also application
software has been developed to cope with networks and the use of many
peripheral devices.

Customised off-the-shelf packages


These types of products are becoming more readily available, and are often
offered as suites of packages with integration with each other to perform a wide
range of tasks. These types of software are often more reliable (being tested in a
wide area of applications), reduce costs for the end user, can be available earlier
and more easily updated that custom software produced for the company.

The use of CASE tools in software development


CASE Tool stands for (Computer-Assisted Software Engineering). These tools are
designed to aid the software developers in the design of their applications and
Hardware
The purposes of CASE Tools are:
 Problem-tracking tools
 Data modelling
 Document generation for the creation of user manuals, installation
instructions and troubleshooting issues
 Reverse engineering tools to convert existing code into algorithms
 Tools for structured analysis of design and scripts
 Simulation tools such as those tools that allow prototypes to be built
 Help the maintenance team to improve bugs and issues within existing
programs. These include the use of
 Simulators
 Debuggers
 Test drivers
 Instrumentation
CASE Tools allow and provide the following
 Show the relationship between global variables and various parts of the
program
 Identified problems within the program
 Support for design specifications including the preparation of documents and
their diagram tic forms
 Produces uniform design across a program
 Support for software design
Support for design implementation including language-specific editors that provide
some support for the coding phase etc…

-8-
The Software Development Cycle
Defining and Understanding the problem

The software
development cycles first
step is to define the
problem that the software
needs to be solved. This
stage of the cycle involves
being able to understand
the software being
developed such that the end product is:

 Dependable: the program should be reliable, secure and safe


 Efficient: the program should not waste resources, such as memory
 Usability: the program should be straight forward for the program to
use
 Robustness: the program should not fail under normal circumstances
of use or by minor errors made by users
 Maintainability: the program should be able to evolve to suit the
users changing needs

The defining and understanding the problem stage involves looking at


multiple issues involved with the program including the needs, screen design,
objectives, boundaries, determining feasibility and social and ethical issues.

Needs
A need is anything that is a necessity for the program. This can include
output being shown as two decimal places, or the requirements of the user to
operate the program for extended periods without suffering strain or injury. They
are different to Preferences of the user, which are elements of the program that
the user would rather work with. Needs are based around the health and safety of
the computer user and are essential to the operation of the program

Screen Design
Aspects of screen design include the layout of the screen including fields,
button and menu layout. Colour design and aesthetics are also an important issue.
Other aspects of screen design are appropriate and concise messages providing
useful feedback for the user that does not use technical language beyond the
capabilities of the user. The message should also not blame the user for the error.
Also appropriate icons and images for shortcut menus or actions should match the
outcome of the programming

Objectives
The objectives of the program are the aims and outcomes, which the
program must achieve. All objectives should meet the needs of the user. Objectives
must
 Meet social and ethical issues
 Use appropriate methods of information display
 Providing adequate input and output methods
 Use of relevant data types for information display
-9-
 Providing clear and understandable methods of navigation between
screens

Boundaries
The boundaries are the limits or borders in which the program can operate.
The borders are determined by what is feasible for the program and what the
needs of the users are. The boundaries of the program are also determined by the
hardware restrictions the program needs to run on. For example if the program
runs over a network. On home computers or on high powered operating systems

Feasibility
Feasibility determines whether the
problem is worth solving and whether a
software solution can be adequately
developed and fit into the above criteria.
There are two issues that must be
considered. Can the program actually be
developed, and is it worth proceeding
with the program depending on the
requirements of creating it. The specific
issues in feasibility are:
 Constraints – these are any
restrictions or limitations
placed on the production of the
software such as money and
time
 Budgetary feasibility – this
determines wether or not the
program can be designed, built
and put into practice within the budgetary constraints of the project
 Operational feasibility – this refers to the skills and resources
needed to create the program and maintain it. If the program requires a
greater range of skills and resources than can be gathered, the program
cannot be built. This skills and resources also refer to those of the user.
This asks whether the user has the skills, time, money and resources to
firstly run the program, and then maintain it.
 Technical feasibility – the availability of hardware and software for
the product. Can the program run on the software that the intended users
have without having major problems
 Scheduling feasibility – refers to the time constraints of the
development of the program. This is determined by when the program
must be released, or depending on how much money the project has, the
cost of employing the programmers, installations and other aspects may
constrain how long these people can be employed for, and therefore how
long the program can have for it to be constructed
 Possible alternatives – this looks at the other options available to
solve the problem. This could help in the saving of time, money and effort
to make the development of the program easier and quicker. However,
each of the other available options must be studied and advantages and
disadvantages, to determine whether this program is a better choice than
the one currently being studied

- 10 -
While all of these are areas of feasibility, there are four main areas of
feasibility. These areas are Budgetary, Operational, Technical and Scheduling
feasibility

Social and Ethical issues


Social and ethical issues must be taken into consideration. All the issues
should be considered, but the following two should be especially considered in the
when defining and understanding the program.
 Lifestyle – how the program effects the lifestyle of the end user. If the
program drastically alters the lifestyle of the user and their interactions
with the world in a way that they do not want, then the program may not
be useful. The advantages of the program must outweigh the
disadvantages of the program on the impact of the end user’s lifestyle.
 Work – how the computer program impacts the work and working
opportunities of the end user. As a results of program, jobs are lost
through the automation of tasks, but other jobs are created as people are
required to use and maintain the new software solutions. Programs can
mean that through e-mail the work of a user can be taken with them
everywhere, and the entire world is always connected.
The major concern with all the program software in reference to the above
two categories is whether the actions and effects on both the lifestyle and work of
the end user is unethical. Programs that are written to destroy the jobs of people
or create havoc in the home and office are unethical. In a moral sense the issue of
cutting jobs by releasing new software must also be considered.

Design Specifications
Design specifications involve that data types, data structures, the types of
algorithms to be used, and other aspects of software design such as the physical
representation of the programs over algorithm are needed to be considered when
understanding and defining the program. See the Programming Elements notes for
more information on this section.

Data types
There is a range of data types that include
Data Type Characteristics Example/s
Integer Positive or negative whole number -23475
Floating Real or decimal number 45.994
point
Character Any letter, number, command, $^&*
punctuation or symbol
String Sequence of characters with a single Hello
identity World!
Boolean Variable with one of two possible outputs True or
False

- 11 -
Data structures
There are four types of data structures
Data Characteristics
Structure
Array Variables of the same type stored in sequential memory
locations
Record Set of related fields storing data of different types
Array of Set of related records stored as one entity
Records
File Set of related data items of various types stored as one entity
eg sequential files

Algorithms
There are three types of algorithms that can be used:
 Sequence – a logical order of commands
 Selection – the carrying out of commands based of a choice
 Repetition (iteration) – the continual carrying out of commands until a
criteria is met

Data validation
This involves the checking of data to see if it is the correct type and meets
any restrictions imposed by the program. There are two types of checks:
 Reasonableness check – to check the input against the data type
 Range check – to check the input data against the boundaries of the data
type. The makes sure no limitations of calculations, output etc. are
exceeded

The user’s perspective


The important aspects to the user must be considered in the design
specification. These include
 The appearance of the program and the ease of use – the user interface
must be ‘user friendly’ containing drop down menus, clickable icons and
keyboard shortcuts. The interface must be intuitive and have simple
navigation
 The programs functionality – this refers to the programs ability to carry
out the required tasks. This should be designed such that the tasks is
carried out in the easiest and simplest way
 The programs scope – this refers to the boundaries of the program and
the range of tasks carried out. The users would want to know if future
needs and any maintenance requirements can be done so in an easy and
convenient way.

Modelling
A system is a collection of interacting parts working together to achieve a
particular task. Such aspects include, coding, hardware, procedures, raw data and
personal. All these actions can be modelled in different ways

- 12 -
IPO (Input-Process-Output) Diagrams
Shows the connection between any input, the process to be carried and the
output achieved

Story Boards
Shows the designs of the screen of the program and the link between them.
They can be linear or non-linear

Data flow diagrams


These diagrams provide detail to the handling of data in the program. There
are four symbols used and these are as follows

A Process An external entity

Data flow Data Storage

Context diagrams

A Process An external entity

Data flow

System Flowchart
Is a diagrammatic way of representing the flow of both data and logic
through a system. This is the primary tool for documenting systems. There are
many different symbols that can be used, but below are the main ones

Input/Outp Manual
ut Operation

Paper Direct access


Document storage device

Online
Decision
display

Online Telecommunica
Input tions link

- 13 -
Magnetic Tape
Process
Output

Structured diagrams
This models the hierarchy and sequence of processes to be carried out

Communication Issues

The need to empower the user


The user needs to be consulted on a regular basis so that the user feels ‘in
control’ of the software development. Ideas from the user should be included in the
software, or where ideas have been left out, reasoning for this should be explained
to the user. Further users should be provided with a choice of functional option
within the final product. Satisfaction with the end design is decided by the user.

The need to acknowledge the user’s perspective


The user does not need to know the technical information about the
software, however they will be the ones using the software. Therefore specific
requirements set by the users that will make the program function better for them
should be taken into consideration

Enabling and accepting feedback


Feedback should be encouraged, as it is cheaper and easier to solve
problems early on in the development cycle. Prototypes are effective ways of
noting user reaction and help clarify development needs.

- 14 -
Planning and design of software solutions
Processing strings

Extraction of data from a string


This process removes a string or set of characters from a string to use in
another. This is equivalent to the copy command. The original characters are left in
the string
BEGIN ExtractString(start, length, data)
Temp() is an empty array
Index = Start
Characters = 0
WHILE Characters < Length
Temp(Characters) = Data(index)
Increment index
Increment Characters
END WHILE
Data = temp
END ExtractString

Insertion of data into a string


This is the process of placing strings or characters into a string. This is
equivalent to the paste command, where the characters are inserted into the
correct position in the existing string. This process often involved multiple steps
BEGIN InsertString
Last = number of items in array – 1
Start = index of location where strings are to be inserted
ExtractString2(start, last)
InsertNew
ReplaceString
END

BEGIN ExtractString2(Start, last)


Index = start
Counter = 0
WHILE index <= last
Temp(counter) = array(index)
Increment counter
Increment index
END WHILE
END ExtractString2

BEGIN InsertNew(Start)
Index = start
counter = 0
last2 = number of items in arrayinsert – 1
WHILE index <= last2
Array(index) = arrayinsert(counter)
Increment counter
Increment index
END WHILE
Start = index //returns the value of start via the parameters
END InsertNew
- 15 -
BEGIN ReplaceString(Start)
Index = start
Last3 = number of items in array Temp – 1
Counter = 0
WHILE count <=last3
Array(index) = Temp(counter)
Increment index
Increment counter
END WHILE
END ReplaceString

Deletion of data from a string


This is the process of removing certain values from a string. This process
generally creates a second array to place the new string in minus the characters
that are to be removed

BEGIN DeleteString(Start, Length)


READ Data
Last = number of items in array – 1
Index = 0
WHILE index < Start
NewArray(index) = Array(index)
Increment index
END WHILE
NewIndex = index
Index = index + Length
WHILE index <= last
NewArray(NewIndex) = Array(index)
Increment NewIndex
Increment Index
END WHILE
END DeleteString

- 16 -
Standard searching algorithms

Linear Search
BEGIN
First = 0
Last = number of items in array –1
Index = first
READ targetValue
WHILE index <= last
IF array(index) = targetValue THEN
**insert code depending on actions of finding value
END IF
Increment index
END WHILE
END

Binary Search
BEGIN BINARY SEARCH

BEGIN INITIALISA TION


set Lower to first position
set Upper to last position
set Foundlt to FALSE
get the Target name
END INITIALISATION

REPEAT

set Middle to (Upper + Lower) divided by 2


set Middle to integer part of Middle

IF Target = data at Middle position THEN


set Foundlt to TRUE
set PositionFound to Middle
ELSE
IF Target < data at Middle position THEN
set Upper to Middle - 1
ELSE
set Lower to Middle + 2
ENDIF
ENDIF

UNTIL Foundlt OR Lowe r> Upper

IF Foundlt THEN
report PositionFound
ELSE
report Target not present'
ENDIF

END BINARY SEARCH

- 17 -
Sorting Algorithms

Bubble Sort
BEGIN BUBBLE SORT

BEGININITIALISATION
set End to last position
END INITIALISATION

WHILE End > first position


set Current to first position

WHILE Current is less than End


IF data at Current > data at (Current + 1) THEN
Temp = Current + 1
Current + 1 = Current
Current = Temp
ENDIF
increment Current
ENDWHILE

decrement End
ENDWHILE
END BUBBLE SORT

Selection Sort
BEGIN SELECTION SORT
INITIALISA TION
set EndUnsorted to last position
END INITIALISATION

WHILE EndUnsorted > first position


set Current to first position
set Largest to data at Current
set PositionOfLargest to Current

WHILE Current < EndUnsorted


increment Current
IF data at Current> Largest THEN
set Largest to data at Current
set PositionOfLargest to Current
ENDIF
ENDWHILE

Temp = PositionOfLargest
PositionOfLargest = EndUnsorted
EndUnsorted = Temp
decrement EndUnsorted
ENDWHILE
END SELECTION SORT

- 18 -
Insertion Sort
BEGIN INSERTION SORT
INITIALISA TION
set First to first position set Last to last position
set PositionOfNext to Last - 1
ENDINITIALISA TION

WHILE PositionOfNext >= First


set Next to data at PositionOfNext
set Current to Position Of Next

WHILE (Current < Last) AND (Next > data at (Current + 1))
increment Current
set data at (Current - 1) to data at Current
ENDWHILE

set data at Current to Next


decrement PositionOfNext
ENDWHILE
END INSERTION SORT

Customised-design logic used in software solutions


This section includes identification of inputs, processes and outputs,
representation as an algorithm, definition of required data structures and thorough
testing. These areas are described elsewhere. The below two sections are specific
issues

Access the data structures – specifically files


There are two ways through which data can be accessed. These are:
 Sequential – the search starts at the beginning of the file and goes
through all the data in order until the required data is located
 Random – in this context is direct access to the storage location of the
data. Such location is difficult, so hashing is used, whereby the number of
data storage elements needed is set before the data is stored. The
addresses have a range of values and the data is located within this range.
This access is also relative access.

Using random numbers


Random numbers are very important for many programs that rely on chance
or random events. Most languages have a simple syntax used for generating
random numbers. Care must sometimes be taken when programs generate random
numbers. Sometimes these numbers occur in the same sequence.

Standard modules (library routines) used in software solutions


Standard modules are very useful especially for commonly done tasks.
However when creating a library routine, certain elements must be considered.

Identification of appropriate modules


Factors that determine whether modules can be reused include:
 Choice of language for implementation
 Type of interface, since some modules may be adapted better for different
methods of display
- 19 -
 Social and ethical issues such as intellectual property and copyright
 The specific task being performed
 Standard methods of construction of modules so other programmers can
understand them

Consideration of local and global variables and parameters


The use of global and local variables must be carefully considered as to
whether the data contained within the variables will be required to other aspects
of the program. Also depending on the amount of times the variable is required,
the use of parameters may be considered to pass this value and reduce the overall
size of the memory required for the program

Appropriate testing using drivers


A driver is a special subprogram that is used as a temporary code to test the
execution of a module. A driver allows a module to be tested without the mainline
of the program. The driver passes values to the module and provides a target for it
to return its values

Customisation of existing software solutions


Commercial packages and software are increasingly providing the means for
end users to create customised software for their particular problems. Many
programmers are choosing to use off the shelf customisable packages since they
are cheaper and easier to use than creating the software from scratch. Providing
the intellectual property and copyright laws are not broken, this is often a viable
alternative

Selection of language to be used


When writing a program the development team must decide which language
and language type they will use. One of the considerations is how the program
operates on a whole. The two options are
 Sequential – a language where the programmer defines the order in which
modules are executed. Some examples include Qbasic, C, C++
 Event Driven – these languages are where the operator of the program
determines the order in which modules are executed. As the name says
code is executed based on the events of the program determined by the
user. Examples include Visual Basic, Prolog

Selecting a language will have ramifications for the hardware required to run
the program. Some examples in how the language effect hardware include:
 Amount of memory that is required for the program to run
 The processor speed of the computer depending on the operations the
program is performing. Such as high speeds for graphics or design work
compared to lower speeds for word processing
 The size of the hard drive which the computer has to store the necessary
data for the program on the machine

Documentation of software solution


The documentation includes the representation of the software solution. This
section includes the other diagrams as above in the notes. Also data dictionaries
are includes, as described below

- 20 -
Data Dictionary
The data dictionary can be used to show the information and type of
variables or in showing the information in a database. An example of the data
dictionary is below. There are four fields that are Field Name, Data Type, Size and
Description
Field Data Size Description
Name Type
User String 8 Stores the user name of the user
Name
Password String 8 Stores the password of the user
Administr Boolean 3 Stores whether the person is an
ator administrator or not

Implementation of Software Solutions


Interface design in software solutions

Identification of data required


The type of data required to be input into the program initially influences
screen design. Graphics, text, sound and mouse movement all need to be handled
differently. Once this data is determined it can be easier to design the layout of the
screen, and also the style of programming to be used (sequential or even-driven)

Current popular approaches


Popular approaches often influence screen design. GUI systems are the most
common at present, therefore new software will need to have a interface that will
be able to cope with such an environment. Other designs change if the system is
implemented on a microwave or other microchip device. Other issues include the
location of menus (eg the File menu is located at the top left and always contains
the save, open and new commands). Other trends include the use of highlights to
show which menu item the mouse is over, the use of keyboards shortcuts to menus
and the implementation of hierarchical menus.

Design of help screens


All interfaces require a help system. The design of the help system should
consider the following:
 Non-intrusive – operational only when requested by the user
 Flexible sizing
 Consistency – always appearing in the same location, with similar colours
and layout
 Navigation – ease of moving around the help application with links,
buttons and tabs
 Simplicity – providing basic explanations of solution to a problem
 Contextual – help is structured to the task being performed
 Style – help should be positive and provide actions of course.
There are also a variety of ways in which help can be provided to the user
 Context help – small assistants within the program when a specific
problem is encountered
 Browser help – large help screens and a database of information, often
with a search function
 Procedural help – screens that take users step by step through a problem
 Tutorials
- 21 -
 Error messages

Audience identification
The interface also depends upon the audience who will use the program.
Factors include
 Age
 Level of expertise
 Language level (use of jargon)
 Disabilities
 Level of human interaction

Consistency in approach
At all times the interface must be consistence within the program. This
includes adhering to traditional methods of use and design, such as Command-S
and a disk icon for Save. Also consistency with colour, font, and background are
important

Language syntax required for software solutions

Meta Languages: BNF (Backus Naur/Normal Format) and EBNF

- 22 -
Meta Languages: Railroad Diagrams

The Role of the CPU


There are many sections of the CPU, which are used when procedures are
carried out. These sections are listed below along with an outline of their function
 ALU (Arithmetic logic unit)
 This performs the arithmetic calculations, logic operations and controls the
speed of operations
 Registers
 Temporary storage holding areas. The register stores the address locations
for instructions, results of calculations and flags which indicate the results of
comparisons
 Accumulator
 A special register which holds the result of the last computation carried out
by the CPU
 Buses
 Pathways that join components of the computer

The CPU also must deal with the instruction, which are given to it. The
instruction is given in machine code (object code). Each character in the code is
represented by a byte (a group of 8 bits). The Computer Word is the number of bits
that a can be processed at one time
The CPU operates on the commands that are sent to it. The CPU follows the
same process each time a new command is received. This process is called the
Fetch-Execute cycle. The cycle is outlined below
 Fetch
 The instruction is retrieved from the main memory.
 The program counter register stores the memory address of the next
instruction to be carried out
 Decode
 The type of instruction to be carried out needs to be decoded
 The Opcode is a set of binary digits which tell the CPU what process to carry
out
 The two Operands are the data which needs to be processed
 Execute
- 23 -
 This stage carries out the instructions
 Store
 The stores the result of the instruction carried out in the accumulator.
 The data in the accumulator is then copied to the RAM or registers

During the operation of a program, it may call upon subprograms contained


within the CPU to perform specific tasks they different types of subprogram are
 Subprograms written by the programmer as part of the program
 Subprograms included in the development structures of the programming
language. These generally form part of a library. An example includes producing
a random number
 Subprograms built into the operating system. An example would be the print
command.
DLL’s are common files used in modern programs to reduce the need for
multiple subprograms DLLs can be called from any application and a simple ways
of performing common tasks, especially within the operating system.

The Translation Process


The process of converting source code into object code is called translation.
There are three types of translation outlined below
 Interpretation
 Each line of the code is translated and the immediately executed. (Line by
line translation)
 The advantages are:
 Errors are quickly identified and corrected
 Syntax errors and runtime errors can be checked for line by line and
identified immediately
 Flags and the debugging output statements to check for correct outputs is
easier
 The disadvantages are
 Program execution is slower
 Code can be stolen by other people much easier
 Interpreted code usually takes up more space
 Compilation
 All code is translated before program execution
 Advantages:
 Programs are executed quicker
 Complied code is usually smaller than source code
 The program can be easily distributed
 Disadvantages:
 Code is harder to modify during runtime
 Error can only be detected after compilation
 Any code changes require the program to be re-compiled
 Testing can be a longer process due to re-compilation
 Incremental interpretation/compilation
 Program statements/modules are compiled and stored as they are written
and then the whole code is executed
 Advantages:
 Commonly executed modules are complied and stored
 The mainline of the program is all that needs interpretation
 Execution can be faster for short testing of program sections
 Disadvantages:
- 24 -
 Interpreted sections of code can still be easily stolen
 Any modules which have been changed still need to be recompiled

The translation process involves a series of stages before object code is


produced. These stages and the elements of them are outlined below
 Lexical Analysis
 This is the first stage and involves the reading of the code. The code is read
character by character according to the syntax rules of the programming
language. White space is omitted
 Other elements of the code are given tokens according to the type of
characters they are; language elements, syntax, constants, operators,
variables
 Each statement is identified and separated for the next stage of translation
 Syntactical analysis
 This stage arranges the tokens in a way which can be understood by the
processor
 Parsing (the use of a parse tree) creates a hierarchy of each section (token)
of the code so that it can be interpreted in the same way each time
 Type checking is then carried out. Each of the data types in a statement are
passed to the translator. Each statement is checked to make sure the
operations being performed are valid according to the data type. Error
messages are returned to confliction occurs
 Traversing then generates the code by moving from the top left of the parse
tree down from left to right. Each token in the tree is subsequently converted
to machine code

The translation process is a very complicated one. High-level languages


contain feature that help in this process. These elements are outline below
 Linker
 The linker creates links between the mainline to other processes, such as
calling the operating system, linking to other modules or to library routines
 The link is placed in the mainline of the program where the other operation
would be placed
 Loader
 This calls a small program called a load module. The load module sets the
memory locations to run from main memory. This allows relative address to
be used rather than absolute addresses.
 The loader id held in the main memory at the start of execution. It allocated
memory locations for code to be executed and prevents memory addresses
interfering with each other
 Optimiser
 This is used to reduce redundant code and improve overall runtime
 This feature is not found on an interpreter, but is used in compliers

Hardware environment to enable the implementation of software solutions


There is a range of issues concerning hardware that must be addressed
before the implementation of a software solution. Some of the requirements
include:
 Platform – The specific operating system to be used
 Configuration – the processor, clock seed and RAM of the intended
platform
 Memory
- 25 -
 Peripherals
 Communications – access to the internet or other network systems
When creating a software solution, the developer needs to state to the user
the minimum system requirements for the program to operate efficiently. This does
not mean the software will run on systems with lower standards, but the developer
does no guarantee the software to operate efficiently
Some software also requires the presence of additional hardware such as
peripheral devices or video cards. The developer may also include drivers and
extensions with the software package that talk between the program and the
operating system. This allows the software to effectively operate on other systems.

Testing and Evaluation of Software Solution


There is a range of tests, which can be performed to determine if each item
specified in the design specifications has been achieved, and performs as expected.
Testing is usually done incrementally by modules or procedures before integrating
them into the program. Testing involves generating relevant test data,
benchmarking and quality assurance

Generating Test Data


Complex solution involve many variables that is can be impossible to test
every aspect. For this reason two main testing techniques are used to isolate and
identify most errors
 Black-box testing
 This checks the inputs of each modules with the expected and actual outputs
 It is not concerned with the procedures themselves
 Types of checks which occur include
 Range checking – data respective to the upper and lower ends of legal
values are tested
 Critical value checking – values which determine results are considered
critical
 Equivalence partitioning – data is sorted according to its type and then a
suitable combination of test data is taken from each group
 This testing is also called functional testing
 If after this testing no discrepancies occur then tests may proceed no further,
otherwise they move onto the next stage of testing
 White-box testing
 This checks the procedures within each module to determine their
correctness
 This is also called structural testing
 The types of tests which are performed include
 Statement coverage testing – test data is chosen so that each statement in
a module is executed during the test procedure
 Decision condition testing – test data is selected to test each decision
within the module

Levels of Testing
Complex solutions are tested at various levels before the final product is
released. These levels are explained below starting from the lowest of the three
levels and working upwards
 Unit or module testing
 Each module is tested separately to make sure it works correctly
 This level uses both black and white box testing
- 26 -
 Drivers can also be used at this stage to substitute for the mainline of the
program
 Program testing
 This testing ensures that the modules work well together and the mainline of
the program performs correctly. It can also use black and white box testing.
 This testing can be done in two different ways
 Bottom-up testing – incorporates each module into the program one step
at a time from the lowest modules to the higher level modules. This makes
it easier to detect lower level modules which conflict with other modules.
The main program is the last to be tested
 Top down testing – this starts with the main program and uses stubs for
some modules as it links each module to the mainline. The main program
is tested first and each module in turn. Any problems are then likely to
occur with recent additions and can be rectified easily. This can be more
useful is libraries of common routines already exist
 System testing
 This stage is the checking of the system in environments outside the
development environment.
 It can involve testing on different processors and different hardware types
 It is often done by people outside the development team and is sometimes
called acceptance testing
 Alpha testing is done where the program is tested under controlled situations
and conditions
 Beta testing is the second stage and is conducted with volunteers and
conditions are open and not regulated. This testing will be wider for off-the-
shelf software compared to custom software

Benchmarking and Quality assurance


Benchmarking is the comparison of a program against a set of established
standards. These can include quality of the product and performance. In-house
standards are those set by the development company
Quality assurance is a part of benchmarking and attempts to assure the
quality of a product. There is a range of quality factors listed below
 Consistency – the program carries out its operations in the same way each time
 Documentation – all internal, external and user documentation if available
 Independence – ability of the program to function on the full range of
processors for which it was designed
 Integrity – ability for the program to protect itself against corruption, security
breaches or power spikes
 Interaction with other software – the program can interact with common
software without conflict
 Maintenance coverage – the program can be easily kept up to date and
debugged when problems are encountered
 Memory requirements
 Performance – speed of processing and response time to meet user
requirements is acceptable
 Recovery – the ability of the program to recover from a failure
 Stress resistance – ability of the program to handle larger than expected
processing demands
 User response – program is easy to learn and answers the users needs
regarding functionality
 Validity – measures the ability of the program to meet user specifications

- 27 -
Evolution of Programming Languages
Historical reasons for the development of the different paradigms

The need for greater productivity


As the popularity of computers began to grow, there was demand for ability
of the software on the computers to increase. This includes an increase in
productivity to allow computers to be involved in many of the mundane jobs. This
need led to development of many different types of programming languages that
could handle the new tasks. The programming languages are divided into five
generations of lanugaes. These are outlined below

Low-Level Languages
Low-level languages are the two earliest forms of languages for a computer.
There are two generations of low-level languages. These are 1GL and 2GL.
A 1GL is the most basic language used by a computer. The features of a 1GL
are:
 Binary/Machine Code (1s and 0s)
 Can be immediately decoded by a processor
 Machine/processor specific

A 2GL language is slightly more advanced language than 1GL. It has some
simple commands that can be used and interpreted by programmes. The features
of a 2GL language are:
 Assembler – used to translate the object code into machine code
 Used symbolic words (mnemonics)- abstraction. (eg using LD to stand for
Load from register/memory etc…)
 Machine/processor specific
Require some form of translator to convert simple words into machine code.

High-Level Languages
High-Level languages came later in history with one main difference. The
code syntax that was used was more like normal human language. A translator was
required to convert the object code into machine code. This was a major leap in
terms in the evolution of languages. However, from a technical point of view the
most significance difference between low and high level languages, was that high-
level languages are not processor specific. This means that the program can be run
on all different processor chips – ie Intel, AMD etc… The limitation of the language
is that they are operating system specific. There are three generations of high-level
languages, which are 3GL to 5GL

A 3GL language was the major leap in development from 2GL in terms of the
above information. The main aspects of a 3GL language are:
 Commands and syntax structures are look much more like ‘normal’
language
 Programming is easier as operations can be easier seen
 Not processor specific – operating system specific
 The level of operations is the same as 2GL, but the abilities the language
could perform were expanded because the program could be spanned
over multiple computers, thus incentive programs was increased. Also
since the language was easier to discern, more complex structures could
be created easier than before.
- 28 -
 Examples of 3GL include – Visual Basic, Qbasic. COBOL, Pascal, C/C++,
FORTRAN

A 4GL language takes the abilities of a 3GL language further. The main
difference and advance of 4GL languages is that language focuses more on what
the program needs to accomplish rather than the process of how the program must
accomplish a task. Therefore the coding syntax is very similar to human speech
where the task the processor must accomplish is given to the processor, not where
how the processor must accomplish is given to the processor. A 4GL is a non-
procedural language. These languages are also generally written to solve a
particular problem, or perform a particular task such as a database program, or
printer descriptions.
4GL simply the development of programs for the end user. This is because
the end user does not need to have an advanced understanding of a programming
language to be able to customise the application. The features of 4GL languages
are:
 Concentrates on What rather than How
 Task specific – these languages are created to carry out one specific role.
Eg SQL is solely used for working with databases. Postscript is specific to
sending data to a printer.
 Still have some functions and arguments which the program carries out
 Examples include LISP, SQL, Postscript, Hypertalk

A 5GL language is the pinnacle of modern day languages in terms of what


they are able to accomplish and how these tasks are accomplished. These
languages use a programming logical called declarative. They concentrate on the
outcomes and leave the processor to determine how to achieve this within a set of
given specifications. The features of a 5GL language are:
 Have levels of Artificial Intelligence
 Uses Natural language/speech
 Examples include Prolog

Recognition of repetitive standard programming tasks


When computers were first created, the tasks that were being carried out
where simple and requires few repetitive steps. It was just as simple for the
programmer to exactly instruct the machine how to handle all data, such as the
processing required for an input statement (this includes reading the information,
loading it into the accumulator, and storing the input data in memory locations)
As computer began to handle more complex tasks, the programmers realised
that common tasks were required in many circumstances, and it was a hassle to
tell the computer how to do every single step. As a result the concept of
abstraction was introduced. This is a system where single key words are used to
represent a series of computer commands, such as the INPUT statement. As
higher-level languages were created, process abstraction increased in use, saving
the programmers time and allowing more complex tasks to be handled and created
in a smaller time frame

Desire to solve different types of problems (eg AI)


The original types of programming languages were procedural languages
where the programmer defined the order in which the program was to carry out a
series of tasks. Also in procedural languages the programmer told the computer
how to carry out every task, such as sorting a list of number

- 29 -
As greater and more complex problems arose, and with the development of
GUI’s, the ability of the computer to handle multiple tasks and figure tasks out for
itself became an issue. The ability of the computer was hampered where the
programmer had to describe and instruct the computer how to carry out each
individual task.
The fourth and fifth generation languages that are non-procedural solved this
problem. In other words, in these languages the programmer only gives the
computer the data and gives a description of the end result. The computer figures
out which steps are required to meet the result. This gives the program more
flexibility in operation, and also enables the programs not to have a defined
sequence of instructions. Non-procedural languages rely on logic and inference to
achieve a result.
In a way, by allowing the computer to calculate the operation required,
primitive forms of artificial intelligence are used.

The recognition of a range of different basic building blocks


As the uses of computers expanded, a variety of different methods were used
to solve particular problems. These methods formed the four main types of
programming paradigms. Specific languages were then developed to suit each of
the programming paradigms. They are summarised in the below table, and
expanded upon in later sections
Programming Examples
paradigm
Imperative Pascal, BASIC, C, FORTRAN,
COBOL
Functional LISP, APL, Scheme, ML
Logic Prolog, SQL
Object-oriented Smalltalk, C++, Java, VB

Emerging technologies
Even though the high level languages are non-procedural, in the end the
object code must be translated into sequential machine code for the computer to
execute. Emerging technologies provide a hope for more efficient processing of
programs. These technologies are summarised below

Parallel processing/computing
This technology uses multiple processors that share out processing tasks.
This enables a set of instruction to be carried out quicker. However, only speed in
processing is gained since sequential machine code is still required to enable the
programs to run. Some of applications of parallel computing include
 Real-time simulations – this includes the modelling of events that exists in the
real word in current time. This can be used to analyse the impacts of events
and find solution to them such as gaining insight into a volcanic eruption while
planning how to minimise the impact of it on humans
 Neural networking – this is where computers are able to simulate the
workings of the human mind. Multiple processors are linked together each
containing their own memory storage. Each processor handles a specific type
of data. The computer can be trained in how to respond to certain situations.
This has also enabled research into computer learning and AI

- 30 -
Quantum processing
This is hopefully being used to overcome many of the sequential machine
code issues. It relies heavily on the quantum theory atomic model, where electron,
protons and photons would represent the 1s and 0s of the computer. Also since
each atom can exist in many quantum states, it is hoped that these computers
would efficiently be able to handle parallel computing.

Molecular computing/DNA computing


This research is in its infancy, but the idea is that molecules would be used to
store data and greatly increase the storage capacity of computers by a million
times their current ability. Further molecules could be used to carry out particular
tasks, increase speed.
Through the implementation of DNA technology it could be possible to use a
base-8 system instead of just the normal base-2. This increase speed in processing
and reduces the storage space of data.

Visual programming languages


These are object-oriented programming languages where by the programmer
uses a visual interface and drag and drop techniques to create a screen design
layout. It has opened the programming industry to novice programmers who are
able to generate programs that carry out simple tasks without having to have a
great understanding of computers or programming.

Basic building blocks of programming languages


Before the basic building blocks of the programming paradigms can be
discussed, the below table summarises the features of each of the paradigms.
Paradig Examples Format Feature
m
Imperativ Pascal Uses a sequence of Specifies a list of operations. Has a
e BASIC operations to defined start and end. Program is a
COBOL produce a result. A sequence of actions in a fixed order
FORTRAN procedural (often defined by line numbers of
sequential language labels). Uses variables to store
data. Programs are procedural
Logical Prolog Specifies outputs in A program consists of declarations
(declarati SQL terms of facts and of facts, rules and goals. Non-
ve) goals procedural, as the solution is given
but the process is not
Function LISP Basic construct is Does not use variables or
al APL the definition of assignment statements. A program
functions consists of function definitions and
applications of these functions. May
use recursion
Object- Smalltalk Consists of An object is a list of attributes and
orientate C++ interacting objects, procedures or methods. Objects
d Java each with its own communicate by message passing.
programming. An A class is a collection of objects
object’s internal which share common attributes and
structure is hidden methods. Data and methods are
encapsulated within objects

- 31 -
Imperative paradigm – Variables and control structures
The basic building blocks of the imperative paradigm are variables and
control structures. Since the imperative structure uses a sequential flow of data,
data is handled using variables and assignment statements. Since choices often
need to be made, the imperative paradigm also incorporates three control
structures; selection, repetition and subprograms
Identifiers are also used. These are descriptive names given for a location in
the computer’s memory

Functional paradigm - Functions


As its name suggests the functional paradigm uses functions as its basic
building block. This paradigm is one where the instructions are provided as a
series of function definitions. They are written as a set of statements where each
subsequent statement relies upon the previous statement. Function can handle any
types of data and can return a single character (called an atom) or a complete list.
Recursion is used for repetition.
These languages are ideal for parallel processors since they are not
sequential and allow the processors to perform many aspects of the program at the
same time

Logical (Declarative) paradigm – Facts and Rules


Facts and rules are the basic building block of the logical paradigm. Facts
are statements that can be proved true or false and rules are a set of procedures
that must be followed or accomplished. The programmer simply tells the computer
what facts are to be used and the rules that must be followed. Also the results of
the processes are described. The computer then decides where to start solving the
problem, how each rule and fact is applied and in what order tasks are carried out.

Object-Oriented paradigm – Objects, with data and methods or operations


Objects are the basic building blocks of the object-orientated paradigm.
Objects are independent of other code, and other objects may call or access the
information encapsulated in another object. Each object has a set of properties
that define the characteristics of that object. Objects are often set up into classes
where the objects of each class inherit the characteristics of the class.

Effect on Programmer’s productivity


The choice of the programming language has major effects upon the
requirements of the programmer. This can range from the work load to the time
required to properly developed and test the new product. These aspects are
discussed below

Speed of code generation


A high-level language usually allows a shorter time for development since
even though the levels of complexities required are the same. This arises from the
fact that a programmer can ignore the memory location and storage of data as
required in low level languages. Further less code needs to be written due to
abstraction. Finally aspects such as objects, classes and reusable function tend to
lead to a shorter development time, and lend themselves to RAD.

Approach to testing
Testing of a program is often a long, exhausting and costly period in software
development, and often the market forces reduce the amount of testing that can be

- 32 -
accomplished. Therefore, programming languages which reduce the amount of
testing which is required and also suits the purpose of the testing influences the
choice of language and the productivity of the programmer. The main types of
testing are explained below
 Structured testing – each algorithm, unit or module if tested as the program
code is written. This helps reduce the amount of errors which occur within the
system as a whole
 Program testing – testing of the product is left until the product is completed.
It may reduce the amount of testing required, but also can increase costs and
often results in poor quality programs with many bugs
 Automated testing – the use of CASE tools, which is expensive but can also
prevent many bugs being carried forward further into development.

Each of the different paradigms effect the testing required and these effects
are outlined below
 Functional – likelihood of syntax errors is minimal since the syntax is simple. It
is often easier for programmers to find and fix errors
 Object-orientated – modules can be tested independently by using drivers. It is
simpler to test small portions of the code first
 Imperative – have a logical structure and subprograms are usually tested
independently
 Logical – involve less code and therefore there is less code to test and
maintain

Effect on maintenance
Proponents of Prolog say the since it is logical maintenance is reduced.
Modular programs are simpler to maintain since when problems occurs only
the specific modules need to be altered, and not the entire program

Efficiency of solution once coded


Programs vary in efficiency when they are executed. Machine code is by far
the quickest in execution, but takes the longest time to develop. High-level
languages are quicker to develop but take a longer time to execute. The
advantages of each of the paradigms are outlined below
 Imperative – run efficiently as they work closely with the hardware
 Functional – are ideal for parallel processor computers since the programs can
be broken down into different parts.
 Logical– can have an inefficient execution since they computer may have to
perform many different permutation when determining a correct solution to a
problem. Quantum computing would allow this style to be more efficient
 Object-oriented – they allow for easy development, but due to the classes
which need to be created and the storage of the properties of each object,
execution may not be as efficient as other paradigms.

Learning Curve (training required)


Different languages and paradigms required different levels of knowledge
and expertise. Also it takes time for programmers to master the individual
languages. Languages can often by chosen based on the knowledge the members
of the software development team have. Each of the knowledge required for the
different programming paradigms is outlined below
 Imperative – often used to introduce students to programming. They have a
clearly defined syntax and process tasks in a logical order

- 33 -
 Logical – it can be easier to teach a logical program to a beginner than a
trained programmer. Logical programming required logical reasoning and is
based on mathematical principles. Since the semantics of the program are
easier to understand, beginners can often find this paradigm easier to use
 Object-oriented – they mimic they way people think by classifying items into
separate objects

Paradigm specific concepts

Logic paradigm
The following concepts are specific to the logic paradigm
 Heuristics
 Are a ‘rule of thumb’
 A general principle for deciding a course of action
 Uses Fuzzy logic that enables decision to be made according to the
probability of the decision being true. It enables AI systems to operate when
things are not always false or true
 Goal
 These are statements which the program will determine using the rules and
facts
 The desired output
 Inference Engine
 Uses a knowledge base
 A system of bringing relevant items of knowledge to bear on a particular
problem
 Backward/forward chaining
 Backward chaining starts with a goal and works backwards to try and prove
and validity of each statement in the goal.
 Working backwards to prove a goal true or false
 Forward chaining starts with the facts and then reaches a goal

Object-Orientated paradigm
The following concepts are specific to the object-orientated paradigm
 Inheritance
 Objects that share many of the same properties are shared
 Can be created from an ancestor
 It often uses classes to define the properties which elements defined by the
class will then share. Each element of the class can be further defined and
carry other properties
 This can reduce the complexity of a program as similar interfaces can be
commanded by shared controlling code
 Encapsulation
 It is the process of including all the attributions and procedures that an
object needs within the object itself
 For example this includes holding the scripts which are associated with
buttons, objects, forms and other elements in a program
 ActiveX controls have this feature as the code contained by the control must
be included when it is imported into a program and used
 Classes often use encapsulation
 Methods
 A piece of code which is exclusively associated with either a particular class
or object
- 34 -
 Is consists of a set of statements which perform a particular action
 It can also use parameters and can also output a result
 Classes
 A class of objects share some common characteristics and perform similar
procedures
 A collection of types of encapsulated variables, methods and objects
 It is a set of metadata, which is then used to, created and defines other
objects.
 Abstraction
 It involves representing a complex task in a simple or symbolic way
 This can include the use of abstraction with data and methods
 It allows the programmer to concentrate on the program structure
 It allows the programmer to generalise rather than concentrate on the
specifics when creating a new method
 Polymorphism
 This is the idea of allowing the same segment of code to be used by different
classes
 They can be encapsulated within a class of objects.

Functional paradigm
The concept for the functional paradigm is:
 Function
 Not restricted by the type of data that can be returned by the function
 Can return a single element (atom) or an entire list
 Suited to processing type of data used in AI
 Use recursion
 Modern functional languages allow the uses of variables and a range of data
structures

- 35 -

Você também pode gostar