Download Programming and Software - International University of Japan

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Wizard of Oz experiment wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Logic programming wikipedia , lookup

Transcript
Programming & S/W
Development
Hun Myoung Park, Ph.D.,
Public Management and Policy Analysis Program
Graduate School of International Relations
International University of Japan
2
Outline
Programming Languages
Language Translators
Software Development
Software Analysis and Design
Programming
Implementation & Maintenance
Documentation
3
Programming Languages
To communicate between human beings
and computers
Instruct a computer (H/W) to do what you
want to do
Each computer can understand its own
machine language only
Instructions are written in programming
languages and then translated into the
corresponding machine language.
4
Machine Language
First generation language
Consists of 1 and 0
Only language that computers can
understand
Each computer has its own machine langue
(machine dependent)
No translation
Difficult to write and read programs
5
Assembly Language
Second generation language
Replace machine language’s binary codes
for instructions and addresses with
corresponding symbols and mnemonics
1:1 match
Translated by the assembler
More technical and faster
But less flexible and user friendly
6
High Level Languages 1
Less machine dependent
More readable and flexible (closer to human
languages and farther away from machine
language)
But less efficient (bigger and slower)
Need to be translated into a machine
language (interpretation or compilation)
7
High Level Languages 2
BASIC (Beginner’s All-purpose Symbolic
Instruction Code)
FORTRAN (FORmula TRANslator) by IBM
COBOL (Common Business Oriented
Language) by ANSI.
PL/1
Pascal
ADA
8
High Level Languages 3
C by Bell Lab
C++, and Visual C
JAVA by Sun Microsystems
Web programming (script) languages: Perl,
PHP, Python, Ruby
9
Types of Languages 1
First generation (machine language)
Second generation (assembly language)
Third generation (high level language)
Forth generation (query languages)
Fifth generation (natural & intelligent
languages)
10
Type of Languages 2
Low-level languages (i.e., machine &
assembly language)
High-level languages (e.g., C and Java)
Script languages (e.g., Perl, PHP, Python)
Machine Friendliness & H/W Control
Size / Time Spent
11
More difficult to work with
(Closer to machine)
More control of H/W
(More risky to write)
Easier to work with
(Closer to human)
Less control of H/W
(Less risky to write)
Smaller & faster
1st GL (Machine)
Larger & slower
2nd GL (Assembly)
3rd GL (High level)
12
Programming Paradigms
Procedural programming
Object-oriented programming
Functional programming
Declarative programming
13
Procedural Programming 1
Imperative or structured languages
Tells the computer what you want it to do
step by step
FORTRAN, COBOL, BASIC, C, Pascal, Ada
14
Procedural Programming 2
Procedures (actions) & objects (data) are
independent
Passive objects that cannot initiate an action
by itself
A subprogram (routine or module) is a
section of the program that performs a
particular task when it is called from the main
program.
15
Object-oriented
Programming 1
Active Objects have both data and methods
(procedures or actions)
Methods are not independent of but belong
to the active object.
Objects need stimulus to perform actions
Visual Basic, Visual C, C++, Java, Smalltalk
Even in script languages (PHP & Python)
16
Object-oriented
Programming 2
A class is a abstract blueprint of objects that
have data and methods
An object (instance) is an (actualized)
instance of the class (variables + actions)
A class of human beings (name, gender,
height… + eating, sleeping, speaking …)
An object of human beings (Seohyun,
170cm, 40Kg … + eating milk, … )
17
Object-oriented
Programming 3
class human {
public name …
public height …
…
function eating (…) {
…
}
function studying (…) {
...
}
…
} // end of class
18
Object-oriented
Programming 4
Inheritance: a class can inherit from other
classes. A class student inherits data and
methods from a class human being and
additionally has its own data and methods
Student = human beings + student’s data
and methods
Faculty = human beings + faculty’s data and
methods
Codes are reusable (minimize redundancy)
19
Object-oriented
Programming 5
Data abstraction and decoupling:
separating objects from classes
Encapsulation and information hiding: Data
are bound closely with their methods.
Polymorphism enables to define methods
with the same name that do difference
things depending on classes.
A work() may mean teaching in a class
faculty but farming in a class farmer.
20
Functional Programming
Define primitive functions and combine them
to keep creating new functions
 LISP (LISt Programming) & Scheme
21
Declarative Programming
Logical reasoning to answer queries
Use deductive logic
Prolog
Report generators: query languages
Query languages: SQL (structured query
language)
Application generators: Visual Basic, FOCUS
22
Declarative languages
Define computation logic
Logical reasoning to answer queries use
deductive logics
Used in artificial intelligence
Fourth generation language
Prolog (PROgramming in LOGic)
Query languages: SQL (structured query
language) and Report generators
23
Language Translators
24
Language Translators 1
Computer can understand machine
languages only
Language translators translate source codes
into the machine language.
A source code file needs to be compiled
and linked to be an object file, executable
file.
25
Language Translators 2
Lexer reads a source code (program)
character by character and assembles
characters into reserved words (token)
Parser performs syntactic analysis and
converts tokens to nodes on a syntax tree.
Code generator produces segments of
machine code of each node.
Optimizer inspects machine codes and
eliminates redundancies.
26
Language Translators 3
Assembler translates a assembly program
Interpreter (interactive)
Compiler (non-interactive, batch)
27
Interpreter
Interactive way of communicating between
users and machines.
Translates each line of the source programs
one by one, run it without making an object
file, and then return the result promptly.
Java source Bytecode by Java compiler 
interpreted by JVM emulator
BASIC, LISP (LISt Processor) by MIT for artificial
intelligence
28
Compiler
Compiler translates a whole source code into
an object code before executing it.
Most high level languages (e.g., C and Java)
are translated by their compilers.
Source code  Object file  Linking libraries
 Executable file
A library is a collection of commonly used
modules that are combined into the
executable file.
29
Computer Software
A collection of well organized instructions
that a computer executes to achieve
specific tasks.
Algorithm or logic is a set of ordered steps to
solve a problem.
Programming and coding (writing
statements) is only a part of system
development
30
Software Development
31
Software Development
In the system development stage, when
customized software is needed
 Program development life cycle (PDLC)
1. Problem clarification
2. Program design
3. Program coding
4. Program testing
5. Program documentation and
maintenance

33
Problem Clarification
Objectives and users (programming needs)
Output to be produced by the systems
Input required to get the desired output
Processing to transform input to output
Feasibility (e.g., budget, man powers,
modification of old program?)
34
Design the Program
Program logic in structured programming;
modularization (subprogram or subroutine)
Design details
Pseudo-code (narrative outline)
Flowcharts
Control structure (logic structure)
Structured work-through to review
35
Flowchart
Start
Read x
sum = 0
i=1
sum = sum + i
i= i+1
If i <= x
No
Print sum
End
Yes
36
Components of a Program
Variables (data type, constant, variable
declaration and initialization)
Input and output
Expression (operators)
Statements (assignment, compound
statement, control statements)
Subprogram: variables, parameters, call by
value, call by reference
37
Control Structure
Sequence
Selection
 If (else)
 switch (case)
Iteration or loop
 DO
 FOR
 WHILE
38
Control Structures
Selection (condition)
Repetition (Loop)
If (score > 90) {
for (i=1; i<x; 1) {
sum = sum + i;
grade = “A”;
} elseif (score > 80) {
grade = “B”;
}
while (i<x) {
} else {
sum = sum +1;
i = i + 1;
grade = “C”;
}
}
39
Coding
A process of writing a program using a
proper programming language
The result is a source code (program file in
the text format)
Follow coding standards
Documentation (comments or remarks)
makes it easy to understand and check
mistakes.
40
Compiling
Interpret a source code (program file) and
convert into an object file
Source code  Compiling  Object file
(object module) Linking  Executable file
(load module)
Linking combines object files and built-in
libraries (commonly used modules)
41
Debugging
A process of checking and correcting errors
(bugs) in a program
Errors
Syntax error
Logic error in the logic of a program
Run-time error occurs while a program is
running
42
Software Testing
To check if the software meets the
requirements and works as expected
Unit testing (component testing), integration
testing, system testing, and acceptance
testing
Running programs with test data
Alpha test at developers’ site
Beta test or pre-release test (outside test)
43
Implementation and
Maintenance
Implementation to run the program on the
information systems
Installation and compatibility tests
Maintenance (updating)
44
Documentation
Description of the program development
Data dictionary
Documentation for users
Documentation for operators
Documentation for programmers
Documentation in source programs
45
Conclusion
Software development is not the same as
coding (programming).
Importance of software test .
Documentation in all stages.
46
References
Stair and Reynolds. 2016. Principles of
information systems, 12th ed. Cengage
Learning.
Stair and Reynolds. 2012. Information systems,
10th ed. Cengage Learning.
Morley and Parker. 2015. Understanding
computers, 15th ed. Cengage Learning.
Hutchinson and Sawyer. 2000. Computers,
Communications, and Information, 7th ed.
Irwin/McGraw-Hill