480 likes | 731 Views
11 th Edition. TODAY AND TOMORROW. Program Development and Programming Languages. 13. CHAPTER. Learning Objectives. Understand the differences between structured programming, object-oriented programming (OOP), and aspect-oriented programming (AOP).
E N D
11th Edition TODAY AND TOMORROW Program Development and Programming Languages • 13 CHAPTER Chapter 13 Understanding Computers, 11th Edition
Learning Objectives • Understand the differences between structured programming, object-oriented programming (OOP), and aspect-oriented programming (AOP). • Identify and describe the activities involved in the program development life cycle (PDLC). • Understand what constitutes good program design and list several tools that can be used by computer professionals when designing a program. Chapter 13 Understanding Computers, 11th Edition
Learning Objectives, Cont’d • Explain the three basic control structures and how they can be used to control program flow during execution. • Discuss some of the activities involved with coding, debugging, maintaining, documenting, and ensuring the quality of programs. • List some tools that can be used to speed up or otherwise facilitate the program development process. • Describe several programming languages in use today. Chapter 13 Understanding Computers, 11th Edition
Overview • This chapter covers: • The most common approaches to program design and development • The steps in the program development life cycle (PDLC) • Tools that can facilitate program development • Programming language categories • Popular programming languages Chapter 13 Understanding Computers, 11th Edition
Approaches to Program Design andDevelopment • Structured programming: programs are separated into modules or subprograms, and instructions are executed one after the other, calling the subprograms when needed Chapter 13 Understanding Computers, 11th Edition
Approaches to Program Design andDevelopment, Cont’d • Object-oriented programming (OOP): programs consist of a collection of objects • Objects: contain data and methods to be used with that data • Variables: data about the state of an object • Methods: perform actions on the object Chapter 13 Understanding Computers, 11th Edition
Approaches to Program Design andDevelopment, Cont’d • Object-oriented programming (OOP), cont’d: • Polymorphism: Multiple methods with the same name can perform different actions with different types of objects • Inheritance: all objects inherit the characteristics of the class in which it belongs • Aspect-oriented programming (AOP): functions are clearly separated so program components can be developed and modified individually, and the components can be easily reused Chapter 13 Understanding Computers, 11th Edition
The Program Development Life Cycle (PDLC) • Program development: the process of creating programs • Program development life cycle (PDLC): the steps involved with creating programs Chapter 13 Understanding Computers, 11th Edition
Problem Analysis • Problem analysis: the step in the program development life cycle in which the problem is considered and the program specifications are developed • Specifications developed during the SDLC are reviewed by the systems analyst and the programmer • Goal: to understand the functions the software must perform • Documentation:Programspecifications(what it does, timetable, programming language to be used, etc) Chapter 13 Understanding Computers, 11th Edition
Program Design • Program design: the step in the program development life cycle in which the program specifications are expanded into a complete design of the new program • Program design tools • Structurecharts (depict the overall organization of a program) • Program flowcharts (show graphically step-by-step how a computer program will process data Chapter 13 Understanding Computers, 11th Edition
Program Design, Cont’d • Program design tools, cont’d • Pseudocode: uses English-like statements to outline the logic of a program Chapter 13 Understanding Computers, 11th Edition
Program Design, Cont’d • Program design tools, cont’d • Data modeling: illustrates the data in an application • Often used when designing an object-oriented program • Each object is identified along with its corresponding class, class properties, and variables Chapter 13 Understanding Computers, 11th Edition
Program Design, Cont’d • Control structure: a pattern for controlling the flow of logic in a computer program • Sequence control structure(series of procedures that follow one another) • Selection control structure • If-then-else • Case • Repetition control structure • Do-while • Do-until Chapter 13 Understanding Computers, 11th Edition
Program Design, Cont’d • Good program design = essential • Saves time • Creates better programs • Good program design principles: • Be specific (all things the program must do need to be specified • One-entry-point/one-exit-point rule • No infinite loops or other logic errors (should trace flowchart to check logic) • Documentation:Designspecifications (expressed using flowcharts, pseudocode, structure charts, data models) Chapter 13 Understanding Computers, 11th Edition
Program Coding • Coding: the process of writing the programming language statements to create a computer program • Need to choose a programming language; consider: • Suitability • Integration • Standards • Programmer availability • Portability • Development speed Chapter 13 Understanding Computers, 11th Edition
Program Coding, Cont’d • Coding standards: a list of rules designed to standardize programming styles • Make programs more universally readable and easier to maintain • Includes the proper use of comments to: • Identify the programmer and last modification date • Explain variables used in the program • Identify the main parts of the program Chapter 13 Understanding Computers, 11th Edition
Program Coding, Cont’d • Reusable code:generic code segments that can be used over and over again with minor modifications • Can greatly reduce development time • Data Dictionary: contains information about the data used in a program, such as the names, descriptions, and rules of usage for every variable and data item used in the program • Can help consistency during coding • Documentation:Documented source code (including comments) Chapter 13 Understanding Computers, 11th Edition
Program Debugging and Testing • Debugging: the process of ensuring a program is free of errors (bugs) • Before they can be debugged, coded programs need to be translated into executable code • Source code: codedprogram before it is compiled • Object code: machine language version of a program • Language translator: program that converts source code to machine language Chapter 13 Understanding Computers, 11th Edition
Program Debugging and Testing, Cont’d • Types of language translators • Compilers (combines program with other object modules and creates a finished executable program) • Interpreters (translates one line of code at one time) • Assemblers (convert assembly language programs into machine language) Chapter 13 Understanding Computers, 11th Edition
Program Debugging and Testing, Cont’d • Preliminary debugging • Syntax errors: occur when the programmer has not followed the rules of the programming language • Program won’t run; usually an error message is displayed • Logic errors: occur when the logic in a program is wrong • Program will run but produces incorrect results • Dummy print statements can help locate logic errors Chapter 13 Understanding Computers, 11th Edition
Program Debugging and Testing, Cont’d • Testing: occurs after the program appears to be correct to find any additional errors • Should use good test data • Tests conditions that will occur when the program is implemented • Should check for coding omissions (product quantity allowed to be < 0, etc.) • Alpha test (inside organization) • Beta test (outside testers) • Documentation:Completed program package (user’s manual, description of software commands, troubleshooting guide to help with difficulties, etc.) Chapter 13 Understanding Computers, 11th Edition
Program Implementation and Maintenance • Program implementation: implemented as part of the SDLC • Once the system containing the program is up and running, the implementation process is complete • Program maintenance: process of updating software so it continues to be useful • Very costly • Documentation: Amended program package Chapter 13 Understanding Computers, 11th Edition
Tools for Facilitating Program Development • Application Lifecycle Management (ALM): describes complete systems that can be used to create and manage an application throughout its entire lifecycle,from design through testing Chapter 13 Understanding Computers, 11th Edition
Tools for Facilitating Program Development • Application generator: software product that enables users to code new applications quickly • Macrorecorders (record and play back a series of keystrokes) • Report and form generators: GUI tools that enables individuals to prepare reports and forms quickly • Often built into database programs Chapter 13 Understanding Computers, 11th Edition
Tools for Facilitating Program Development • Software-asset management tools: designed to help facilitate reusable code • Store and organized tested software components so they can be inserted into new applications quickly and efficiently • Device software development tools: assist with developing software to be used on devices, such as cars, ATM machines, consumer devices, etc. Chapter 13 Understanding Computers, 11th Edition
Programming Languages • Programming language: a set of rules used to write computer programs • Programs are written using a programming software package for the selected programming language • Categories of programming languages • Low-level languages (difficult to code in; machine dependent) • Machine language (1s and 0s) • Assembly language (includes some words and symbols) Chapter 13 Understanding Computers, 11th Edition
Programming Languages • Categories of programming languages, cont’d • High-level languages (closer to natural languages; easier to write in) • Includes third-level procedural languages such as BASIC, COBOL, Pascal, and C, as well as newer object-oriented languages such as C++, C#, and Java) • Fourth-generation languages (4GLs): even closer to natural languages and easier to work with than 3GLs • Includes structured query language (SQL) used with databases Chapter 13 Understanding Computers, 11th Edition
Programming Languages • Categories of programming languages, cont’d • Natural programming languages (user can communicate in their native language) • Doesn’t have to follow program syntax • In the infancy stage • Visual programming languages (uses a graphical programming environment) • User can use mouse and graphical interface and the code is automatically generated • Visual versions of many programming languages Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages • FORTRAN: high-level programming language used for mathematical, scientific, and engineering applications • Efficient Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • COBOL: designed for business transaction processing • Being phased out in many organ-izations Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • Pascal: used to teach structured programming; especially appropriate for use in math and science appli-cations Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • BASIC: easy-to-learn, high-level programming language that was developed to be used by beginning programmers • Visual Basic:object-oriented, fourth-generation version of BASIC Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • C, C++, and C#: versions of the highly efficient C programming language • C++ and C# are object-oriented Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • Java: high-level, object-oriented programming language frequently used for Web-based applications • Platform independence is one of Java’s biggest advantages • Any operating system or browser that understands Java bytecode (compiled Java programs) can run Java applications • Is one of the most popular programming languages today Chapter 13 Understanding Computers, 11th Edition
Popular Programming Languages, Cont’d • Java, cont’d • Java applets: small programs that are designed to be inserted into Web pages and run using a Java-enabled Web browser • The .class file containing the applet’s code must be stored with the Web site files • HTML code is used to insert the applet and specify parameters to customize the applet • Java applets that run on the server instead of on the client computer are called servlets Chapter 13 Understanding Computers, 11th Edition
Summary • Approaches to Program Design and Development • The Program Development Life Cycle (PDLC) • Tools for Facilitating Program Development • Programming Languages Chapter 13 Understanding Computers, 11th Edition