390 likes | 472 Vues
Introduction to Electronic Government Programming & Software Development Saturday, September 20, 2014. Hun Myoung Park, Ph.D. Public Management & Policy Analysis Program Graduate School of International Relations. Programming Languages. To communicate between human beings and computers
E N D
Introduction to Electronic GovernmentProgramming & Software DevelopmentSaturday, September 20, 2014 Hun Myoung Park, Ph.D. Public Management & Policy Analysis ProgramGraduate School of International Relations
Programming Languages • To communicate between human beings and computers • Instruct a computer (H/W) to do what you want to get using a programming language • Each computer can understand its own machine language only • Instructions can be written in programming languages and then translated into the corresponding machine language.
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) • Difficult to write and read programs
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 assembler • More technical and faster • But less flexible and user friendly (not easy to read)
High Level Languages 1 • Less machine dependent • More readable (closer to human languages and farther away from machine language) and flexible • But less efficient (bigger and slower) • Need to be translated into a machine language (interpretation or compilation)
High Level Languages 2 • BASIC (Beginner’s All-purpose Symbolic Instruction Code) • FORTRAN (FORmula TRANslator) by IBM • COBOL (Common Business Oriented Language) by ANSI. • ADA, PL/1, Pascal • C by Bell Lab, C++, and Visual C • JAVA by Sun Microsystems • Perl, PHP, Python, Ruby
Classification of Languages • First generation (machine language) • Second generation (assembly language) • Third (high level language), forth (query languages), and fifth (natural & intelligent languages) generation languages • Low-level languages (i.e., machine & assembly language) • High-level languages (e.g., C and Java) • Script languages (e.g., Perl, PHP, Python)
Programming Paradigms • Procedural programming • Object-oriented programming • Functional programming • Declarative programming
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
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.
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)
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, … )
Object-oriented Programming 3 class human { public name … public height … … function eating (…) { … } function studying (…) { ... } … } // end of class
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 has its own data and methods • Student = human beings + student’s data and methods • Faculty = human beings + faculty’s data and methods • Staff = human beings + staff’s data and methods • Codes are reusable (minimize redundancy)
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.
Functional Programming • Define primitive functions and combine them to keep creating new functions • LISP (LISt Programming) & Scheme
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
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
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 in a computer.
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.
Language Translators 3 • Assembler translatesa assembly programs • Interpreter (interactive) • Compiler (non-interactive, batch)
Interpreter • Interactive way of communicating between users and machines. • Translates each line of the source programs or translates instructions one by one and return the result promptly. • Java source Bytecode by Java compiler interpreted by JVM emulator • BASIC, LISP (LISt Processor) by MIT for artificial intelligence
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.
Computer Software (Program) • 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
Software Development • In the system development stage, when customized software is needed • Program development life cycle (PDLC) • Problem clarification • Program design • Program coding • Program testing • Program documentation and maintenance
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?)
Design the Program • Program logic in structured programming; modularization (subprogram or subroutine) • Design details • Pseudo-code (narrative outline) • Flowcharts • Control structure (logic structure), sequence, IF, case, iteration or loop (DO, FOR, WHILE) • Structured work-through to review
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
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.
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)
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
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)
Implementation and Maintenance • Implementation to run the program on the information systems • Installation and compatibility tests • Maintenance (updating)
Documentation • Description of the program development • Data dictionary • Documentation for users • Documentation for operators • Documentation for programmers • Documentation in source programs
Conclusion • Software development is not the same as coding (programming). • Importance of software test . • Documentation in all stages.