Software Programming Chapter 10 PDF
Document Details
Uploaded by WellManagedButtercup5958
Tags
Summary
This document provides an overview of software programming concepts, including the importance of programming in various fields, the system development life cycle (SDLC), and different approaches, such as top-down design and object-oriented analysis. It covers creating algorithms and translating them into programming languages, and discusses critical aspects like error handling and testing.
Full Transcript
Chapter 10 Behind the scenes: Software programming Understanding Software Programming Some tasks are candidates for automation with computers—automation achieved through programming: ○ Repetitive ○ Work with electronic information ○ Follow a series of clear steps...
Chapter 10 Behind the scenes: Software programming Understanding Software Programming Some tasks are candidates for automation with computers—automation achieved through programming: ○ Repetitive ○ Work with electronic information ○ Follow a series of clear steps Every day we face a wide array of tasks. Some tasks are complex. These tasks require: ○ Require creative thought ○ Require human touch ○ Require intuitive thinking The Importance of programming A career in programming offers: ○ Plentiful jobs ○ Strong salaries ○ Telecommuting is often easy to arrange Computing programs for many tasks Programming necessary when no existing software for task Basic knowledge of programming in key The life of an information system System: Collection of things to achieve common goals. An information system includes: ○ Data ○ People ○ Procedures ○ Hardware ○ Software An information system helps in: ○ Help in planning and decision making. ○ Help run an office and coordinate online-purchasing systems and are behind database-driven applications used by Amazon and Netflix. The System Development Life Cycle (SDLC) SDLC: A process used to develop information systems. ○ Can be lengthy ○ JAD is an alternative method There are six steps in a System Development Life Cycle (SDLC) model. 1. Problem/Opportunity identification: a. Evaluate proposals b. Decide what projects to take 2. Analysis a. Explore the problem, develop a program specification b. Define user requirements c. Recommend a plan of action 3. Design: A plan, using flowcharts and data-flow diagrams, details inputs/outputs & processing requirements helps programmers. 4. Development: a. First step in PDLC b. Actual programing begins c. Includes technical documentation 5. Testing and installation: a. Ensures the system works properly b. System installed for official use 6. Maintenance & Evaluation: a. Program performance is monitored b. Determine whether the program is meeting the needs of end users. c. May loop back to step 1 The Life Cycle of a Program The stages that programming projects follow are referred to as the Program Development Life Cycle (PDLC). 1. Describing The problem (the problem statement) 2. Making a plan (algorithm development) 3. Coding (speaking the language of the computer) 4. Debugging (getting rid of errors) 5. Testing and documentation (finishing the project) The Life Cycle of a Program: Describing The problem (the problem statement): - Programmers must develop a complete description of the problem. Necessary to solve problems Interact with users Programmers handle bad inputs through error handling Problem statement includes testing plan; does not cover every possible input but patterns of inputs The Problem a description of what tasks the program must accomplish and how it will execute those tasks and Statement respond to unusual situations. Error handling Programmers must describe what the program should do if the input is invalid. The Life Cycle of a Program: Making a plan (algorithm development): a. The problem is translated into steps (known as an algorithm) that describe what the program must do. b. Algorithms are limited (unpredictable events) c. Algorithms represented through flowcharts or pseudocode (text-based) The Life Cycle of a Program: Developing the Algorithm; Decision Making and design Programmers handle complex algorithms: ○ List of choices ○ Decision binary points Binary decisions: Can be answered in either yes (true) or no (false). Loops Programmers create algorithms using/Several different methodologies support programmers, including: ○ Top-down design ○ Object-oriented analysis The Life Cycle of a Program: Top-down design Problem is broken into series of high-level tasks Detailed subtasks created from high-level tasks Continue until steps are close to programming language commands Top-down design a systematic approach in which a problem is broken into a series of high-level tasks. The Life Cycle of a Program: Object-oriented analysis Uses classes (categories): ○ Information (data) ○ Method (action) An object is an example of a class Object-oriented approach allows reusability of classes making new code quickly via inheritance The Life Cycle of a Program: Coding (speaking the language of the computer) Coding: translating an algorithm into CPU instructions Programmers move from algorithm to code by: ○ Identify key pieces of information ○ Identifying flow of each step ○ Converting algorithm into specific programming language Programming Language: ○ A “code” for instructions CPU can perform ○ Languages use special words and strict rules ○ Allow control of CPU without knowing hardware details The Life Cycle of a Program: Compilation Compilation: a process of converting code to machine language (1s and 0s) Compiler: ○ understands the syntax of the programming language and exact structure of the CPU (each language has its compiler) ○ helps fixes syntax NOT logical errors ○ creates an executable program (the binary sequence of CPU instructions) Some languages use an interpreter interpreter translates the source code into an intermediate form, line by line. Each line is executed as it’s translated. The finished program runs faster than an interpreter The Life Cycle of a Program: Debugging (getting rid of errors) Debugging is done after compilation Debugging find and correct logical errors Testing plan helps programmers know program has solved the problem Logical error: program runs but executes incorrectly Debugging The process of running the program over and over to find and repair errors and to make sure the program behaves in the way it should is termed A syntax error a violation of the strict and precise programming language rules Logical errors are caught when the program executes The Life Cycle of a Program: Testing and documentation (finishing the project) Internal testing (within software company) External testing (people who will use it) Solving problems after beta testing Release cycle: ○ Release to Manufactures - RTM ○ General availability - GA (to public) Documentation ○ Technical writers (technical detail of pram) ○ User documents for end users Internal testing a group uses the program in every possible way. External testing people like those who will use the software to work with it. Many Languages for Many Projects Programming languages have been developed to balance conflicting goals In any programming endeavor, Run quickly programmers want to create a solution Be reliable that meets several objectives. Be simple to expand later when the demands on the system change The software needs to: Be completed on time Be finished for the minimum possible cost - Because it’s difficult to balance these conflicting goals, many programming languages have been developed. Exploring programming Languages: Mobile Applications Tools for building apps for android devices ○ Android software development kit (SDK) is require ○ Use well-known IDEs with special plug-ins Required to build apps targeting Android smartphones and tablets Android software development kit (SDK)