Chapter 01
Chapter 01
CS 1511
Email: rmaclin
http://www.d.umn.edu/~rmaclin/cs1511/index.html
Outline
I. Introduction
A. Computer Science History
B. Computer Science as Science
C. Computer Systems
1. Hardware
2. Software
3. Computer Languages
4. Compilation
Outline (cont)
I. Introduction (cont)
D. Software Development
1. Software Life Cycle
2. Program Development
a. Five Steps to Good Programming
b. Top-Down Programming
3. Software Engineering
Computer Science History
• Alan Turing
– WW II
– Enigma
– “Computers”
• John von Neumann
– Programs as data
• ENIAC
Hardware “Generations”
• Hardware
– vacuum tubes
– transistors
– printed circuits
– integrated circuits
• Moore’s law
Environment “Generations”
• Environments
– single process
– batch process
– time-shared
• one powerful computer serving multiple users
– personal computer
• multiple individual computers
– client/server
• individual computers (clients) interacting with
powerful computer providing services to multiple
users (server)
What is Computer Science?
Computer Science is not
– Computer Literacy
– just Computer Programming
Computer Science has aspects of:
– Mathematics
– Science
– Engineering
– Applied Science
– Ethics
Computer Science is ...
• Mathematics and Logic
– solutions must be precise
– programs are written in formal programming
languages
– programmer must think logically and
symbolically
Computer Science is ...
• Science
Scientific method:
• formulate hypothesis to explain phenomenon
• test hypothesis by conducting experiment
Computer Science Method:
• formulate algorithm to solve problem
• test algorithm by writing program
Computer Science is ...
Engineering
– modeling
– modularity
– maintainability
Interdisciplinary
– a tool
Ethics
– privacy
– security
– liability
Computer System
• Hardware
– electronic parts connected together
– examples: keyboard, CPU, memory, printer, …
• Software
– “programs” that are executed on the hardware
– examples: operating system, word processor,
database program, ...
Computer Hardware
Central Processing Unit
Arithmetic/Logic Unit
Keyboard
Monitor
Control Unit
• Auxilliary storage
– magnetic/optical disks or tapes permanently
store programs in “files”
Computer Software
• Systems software
– operating system
– system support software
– system development software
• Application software
– general-purpose software (word processing,
database, etc.)
– application specific (JPL image analysis, etc.)
Program in Memory
Main Memory • No distinction
between program and
Program data for program
• CPU executes
instructions from
program
Data • Program may access
data in memory
Computer Languages
• Machine language
• Assembly language
• High-level languages (including C)
• “Natural” language (the eventual goal)
Machine Language
• Instructions composed of 0’s and 1’s
• Instructions are groups (8, 16, 32, 64) of
bits that mean something to the computer
Example: 1011000100000001
• Difficult to understand (for humans)
Assembly Language
• Symbolic language
• Closely corresponding to machine language
LOAD R1,#1
corresponds to
1011000100000001
• Translated using assembler to machine
language
High-level Language
• Composed of English characters and words
• Example: printf(“Welcome to CS 1511.”);
• Does not correspond directly to a machine
language instruction (generally corresponds
to a series of instructions plus data)
• Translated into machine language (using a
compiler)
“Natural” Language
• A goal of computer language developers
• Example: “Computer, please calculate the
total number of people taking CS 1511.”
• A lot more difficult than it seems
total number
people
taking
CS 1511
Creating a Program
• Write/edit a source file (name.c)
• Compile source file to create object file
(name.o, name.obj)
• Link object file(s) with system utilities to
create executable file (name.exe, name)
Compiler
Object File
Linker Systems
Library
Executable
Program Execution
• Program loaded into main memory by a
program called a loader
• Resulting program may access input/output
devices using system utilities (find out what
the user typed at the keyboard, print a line
to the screen, etc.)
System Development Life Cycle
Systems
Requirements • Waterfall model
• Creation of
Analysis
program/system a
Design series of interacting
steps
Code
• Steps may flow
System Test
forward/backward to
various steps
Maintenance
Program Development
1. Understand the problem
2. Develop a solution
3. Write code for the solution
4. Run the program
5. Test the program
Main
Task
• Modular programming
Module Example
2. Perform Computations Module
Data:
Starting balance
Transaction type
Transaction amount
Information returned:
Ending balance
Logic:
If transaction a deposit, add to balance, else subtract
Pseudo-code
• Precise algorithmic description of program
logic
• Can be used instead of (or with) structure
charts
• Solutions for modules written in precise
language
Pseudo-code Example
1. Get information
1.1 Get starting balance
1.2 Get transaction type
1.3 Get transaction amount
2. Perform computations
2.1 IF deposit THEN add to balance ELSE
subtract from balance
3. Print results
3.1 Print starting balance
3.2. Print transaction
3.2.1 Print transaction type
3.2.2 Print transaction amount
3.3 Print ending balance
Code Testing
• Blackbox Testing - test program without
knowing how it works (look at
specifications, design tests)
• Whitebox Testing - test program knowing
how it works (look at code and try to design
tests to “exercise” all aspects of the code)
Software Engineering
• “Use of sound engineering methods and
principles to obtain software that is reliable
and works on real machines”
• Guiding principles concerning:
– readability
– modularity
– maintainability
– etc. (lots more)