4
8/8/11 1 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Programming Steps (continued) Behind the Scenes: Building Applications Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 2 Programming Topics Life cycle of a program Problem statement Algorithms Moving from algorithm to code – Moving from code to machine language Selecting the right programming language – Testing programs – Completing a program Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall What Is a Program? A list of instructions – Prewritten or packaged (off-the-shelf) – Custom-written Application software System software 3 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall What is Programming A problem-solving procedure Programming a computer involves specific problem solving Systems analysis and design involves general problem solving 4 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall What is Programming? Programming is a six-step procedure for producing a program - a list of instructions - for the computer Six-step procedure-part of Phase 4: Systems Development 5 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall The Life Cycle of a Program Programming is the process of translating a task into a series of commands a computer will use to perform that task Programming involves: – Identifying the parts of a task the computer can perform – Describing tasks in a specific and complete manner – Translating the tasks into a language that is understood by the computer’s CPU 6

Algorithms Behind the Scenes: Building Applications · – Algorithms – Moving from algorithm to code – Moving from code to machine language • Selecting the right programming

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Algorithms Behind the Scenes: Building Applications · – Algorithms – Moving from algorithm to code – Moving from code to machine language • Selecting the right programming

8/8/11

1

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 1

Programming Steps (continued)

Behind the Scenes: Building Applications

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 2

Programming Topics

•  Life cycle of a program –  Problem statement –  Algorithms –  Moving from algorithm to code – Moving from code to machine language

•  Selecting the right programming language – Testing programs – Completing a program

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

What Is a Program?

•  A list of instructions – Prewritten or packaged (off-the-shelf) – Custom-written

•  Application software •  System software

3 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

What is Programming

•  A problem-solving procedure •  Programming a computer involves

specific problem solving •  Systems analysis and design involves

general problem solving

4

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

What is Programming?

•  Programming is a six-step procedure for producing a program - a list of instructions - for the computer

•  Six-step procedure-part of Phase 4: Systems Development

5 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

The Life Cycle of a Program

•  Programming is the process of translating a task into a series of commands a computer will use to perform that task

•  Programming involves: –  Identifying the parts of a task the computer

can perform – Describing tasks in a specific and complete

manner – Translating the tasks into a language that is

understood by the computer’s CPU 6

Page 2: Algorithms Behind the Scenes: Building Applications · – Algorithms – Moving from algorithm to code – Moving from code to machine language • Selecting the right programming

8/8/11

2

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 1 Program Specification

Step 2 Program Design

Step 3 Program Coding

Step 4 Program Testing

Step 5 Program Documentation

Step 6 Program Maintenance

What is Programming?

•  Programming is software development •  Six step procedure

7 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 4 Program Testing

•  Debugging –  Testing –  Eliminating errors

•  Syntax errors –  violations in rules of

programming language •  Logic errors

–  incorrect calculation or missing programming procedure

•  Testing process

8

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 4 Debugging

•  The process of running a program to find errors is known as debugging

•  Integrated Development Environment (IDE) tools in compilers and interpreters used to find syntax errors (specifically code editors)

•  Sample inputs are used to determine runtime (logic) errors

•  Use Debugger tools to pause a program so programmers can step through the instructions to locate runtime errors

9 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 10

Step 4 Debugging

Process of testing and eliminating errors

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 4 Program Testing

•  Program testing sequence or process –  Desk checking (proofreading) –  Manual testing (debug one step at a time) with

sample data –  Attempt another translation (compiler or

interpreter) to test (execution) of sample data on the computer

•  Users test the program (internal testing)

11 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 5 Program Documentation

•  Written descriptions and procedures about a program are finalized

•  Important for people who will use the program –  Users –  Operators –  Programmers

12

Page 3: Algorithms Behind the Scenes: Building Applications · – Algorithms – Moving from algorithm to code – Moving from code to machine language • Selecting the right programming

8/8/11

3

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Step 5 Program Documentation

•  Review and finalize logic and instructions prepared throughout all of the programming steps

•  Different procedures done for each group – users, operators and programmers

•  Documentation created : –  User manuals –  User training –  Programmer manuals

•  Software distributed: –  Internal release of documentation and programs

13 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 14

Step 5: External Documentation

•  Beta version releases (commercial testing) –  Information collected about errors before final revision –  Testing by a select group of potential users (beta testing) –  Information collected about errors before final revision

•  Documentation created and programs marketed –  User manuals –  User training

•  Software updates (service packs) –  Problems found after commercial release

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 15

Step 6 Program Maintenance

•  Represents 75 % of total lifetime costs of a program •  Ensure an error-free operations

–  Operational errors –  Ease of use –  Standardization

•  Efficient and effective programs –  Modify programs for new or

changed requirements •  Done mostly by

maintenance programmers Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 16

Programming Steps Summary Step Primary Activity

Specification Objectives, I/O, process requirements

Design Structured techniques

Code Language and write

Test Syntax and logic errors

Document Users, operators, programmers

Maintenance Fix errors, updates

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Producing Code Quickly •  Computer-aided software engineering (CASE)

tools automate the development process –  Program designing –  Coding –  Testing

•  Object-oriented programming (OOP) leads to reusable classes with the data and methods –  Less reliance on step-by-step programming –  Emphasizes defining relationships between objects

•  Interpreted languages require virtually no compile time –  Compilation occurs while the program is edited

17 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Summary Questions •  List the steps of the testing process. •  What types of errors do programmers need to

eliminate during the debugging process? Define these errors.

•  What are the tasks of the program documentation step?

•  How do the internal and commercial documentation processes differ?

18

Page 4: Algorithms Behind the Scenes: Building Applications · – Algorithms – Moving from algorithm to code – Moving from code to machine language • Selecting the right programming

8/8/11

4

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Summary Questions •  What is the job of a maintenance programmer in

Step 6? Why is this job important? •  Discuss the six steps used to create programs. •  Discuss how CASE tools, object-oriented

software programming and interpreted languages can speed up software development.

19 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Participation Question _________ are violations of the strict, precise set of rules that define a particular programming language. A.  Interpreter errors B.  Data type errors C.  Logic errors D.  Syntax errors E.  Compiler errors

20

Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Participation Question The tasks of the program maintenance step of the Program Development Life Cycle are _______ and ________ . A.  assigning program objectives B.  fixing operational errors C.  updating for changing needs D.  A and B E.  B and C

21 Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Programming Steps

•  Any questions?

22