C SC 100 Lecture Notes
Spring 2008
Pete Sanderson
[
previous
|
schedule
|
next
]
major resource: Tomorrow's Technology and You (Complete), Eighth Edition, Beekman and Quinn,
Pearson Prentice Hall, 2008
Chapter 14, Systems Design and Development
Problem Solving
Developing a software application is a complex process that requires
some guiding principles or methodologies.
George Pólya wrote How to Solve It, a book that has sold over
a million copies. In this book he divides the problem solving task into
four stages:
-
Understanding the Problem
-
Devising a Plan
-
Carrying out the Plan
- Looking Back (evaluating your solution)
Top Down Design (a.k.a. stepwise refinement)
method for designing programmed solutions to complex problems.
seeks to reduce the complexity of a problem by organizing it in a manageable
way.
Top-down design has three major steps:
- Break the problem down into simpler subproblems
-
Solve each subproblem (possibly by using top-down design)
-
Combine the those solutions to form a solution to the problem
First step is the key. Break down the problem by finding a natural
decomposition of the problem.
Consider building a house.
-
Suppose you divide it into subtasks of building front and back halves.
-
Not a good idea; each subtask smaller but no easier!
-
Instead, divide it into subtasks such as framing, electrical, plumbing,
etc.
Guidelines for finding a natural decomposition:
-
Are there identifiable, distinct, phases of the problem?
-
Are there any aspects of the problem that are repetitive?
-
Do certain parts of the problem resemble other?
Top-down design can be applied repeatedly to a subproblem which remains complex
-
each subproblem may need to be further divided into subsubproblems or subsubsubproblems,
etc.
-
Continue dividing until each fragment of the problem is simple enough that
its solution is obvious.
-
Solutions are then devised to the small problems, and those solutions combined
to form the overall solution.
Other examples of non-trivial tasks
- Writing term paper or book
- Developing a web page or web site
- Planning an awards banquet with expected 200 in attendance
- planning a spring break trip to Florida
- if you are a member of an Otterbein athletic team, beating Capital (or other major rival) in your sport
Software Development Lifecycle
This approach is echoed in what has become known as the Software Development
Cycle, consisting of multiple phases:
- Investigation
- Analysis
- Design
- Development
- Implementation
- Maintenance
- Retirement
Investigation is the process of determining the feasibility of a proposed system. This
addresses such issues as:
- whether proposed system will meet client organization needs
- whether potential benefits of proposed system will outweigh its costs
- whether technology required by the proposed system is available and affordable
Analysis is the process of understanding the problem.
Consult client to determine requirements, such as :
-
what is the input?
-
in what format should it be expected?
-
what output is required?
-
how should it be presented?
- Results of analysis are documented in written specification
- specification needs to be understandable to both client and developer
The design phase is where the solution plan is devised.
-
Interest shifts from the problem to the solution.
-
A solution is designed, based on the specifications.
- need to design the user interface, the database, the business logic (process)
Textual and graphical techniques are used to document design
- may also develop prototype product as part of analysis and design
The development phase is the system is actually created from the design specification.
Major activities here include:
- programmers write programs to
carry out the design
- technical writers produce documentation on how to use the system
- testers extensively test the system (this actually occurs throughout analysis and design too)
to make sure it works correctly
Implementation refers to bringing the new system into production. This includes activities such as
- carrying out the plan to transition from the old system to the new system
- training people who will use the new system
- installing the new system
Maintenance is what happens after it is released for use.
If the work done in the earlier phases was insufficient, this can be more
expensive than the development itself.
Retirement occurs when the system has become outmoded and is replaced by a yet newer system
Algorithm
computer program is implementation of an algorithm : a step-by-step description
of how the program's task will be accomplished. The task and algorithm may be very complex. A program
is a set of instructions that tell the computer how to carry out the algorithm.
Programming Languages
In the beginning, there were machine languages. Instructions coded
as 1’s and 0’s. OK for computer, hard to humans to do reliably
Assembly languages were developed, giving names to all the machine instructions.
Each assembly instruction corresponds to one machine instruction.
Better, but still hard for humans to do reliably. Requires assembler
to translate into machine language.
High level languages were developed. Each language instruction
corresponds to a (perhaps lengthy) sequence of machine instructions.
Much easier for people.
-
FORTRAN: FORMula TRANslator. Developed in 1950s for numerical applications.
-
COBOL: COmmon Business Oriented Language. Developed in 1950s for
data processing. English-like language.
-
LISP : LISt Processor. Developed in late 1950’s, this is the language
for artificial intelligence applications.
-
C: developed in late 1960s. Used initially for telephone switching
applications. Successor to Fortran for numerical computing.
-
Pascal: developed in 1970s as an educational language.
-
C++: extension of C which includes object-oriented programming (OOP).
OOP is good because objects in the design/implementation will correspond
to objects identified in the analysis/specification. Developed in
the 1980s
-
Java: similar to C++, but developed in the 1990s to program smart appliances
and also for programming WWW software.
How many programming languages are there? Thousands
There are so many because different problems and solutions can be expressed
more efficiently using different vocabularies. No single language
includes all vocabularies.
All of them are equally powerful, however, as you will see next.
Theoretical basis for programming languages
Alan Turing, as one of his most important contributions to the field
of computer science, developed a mathematical model of computation called
the Turing Machine.
The Turing Machine has been shown to be capable of computing anything
which is computable (i.e. programmable). Yes, there are things that cannot
be programmed!
It has been shown that a programming language is equivalent to a Turing
Machine in terms of the problems it can solve if it possesses three simple
abilities.
-
Sequence
-
Selection
-
Iteration
Sequence is the ability to specify the relative order of the instructions
in a program (i.e., what comes first, etc.).
Selection is the ability to make decisions, of which there are
two varieties: deciding for or against and deciding either/or. For or against
is a decision of whether to take some course of action, or none at all.
Either/or is a decision between two possible courses of action.
Iteration is the ability to repeat an action in a loop.
All the programming languages listed above (and thousands of others)
have all these capabilities, and so are equally as powerful as Turing Machines
and each other!
Language choice is a matter of how efficiently a solution can be expressed,
not whether it can be expressed.
[
Pete Sanderson
|
Math Sciences server
|
Math Sciences home page
|
Otterbein
]
Last updated:
Pete Sanderson (PSanderson@otterbein.edu)