Program Design Language (PDL)

Slides:



Advertisements
Similar presentations
Lecture 2: Developing Procedural Thinking (How to think like a programmer) BJ Furman 06FEB2012.
Advertisements

1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
CHAPTER 1 SOFTWARE DEVELOPMENT. 2 Goals of software development Aspects of software quality Development life cycle models Basic concepts of algorithm.
The Pseudocode Programming Process Chapter 9. Outline  Introduction  Design the routine.  Code the routine.  Check the code.  Clean up loose ends.
1 Program Design Language (PDL) Slides by: Noppadon Kamolvilassatian Source: Code Complete by Steve McConnell, Chapter 4.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Chapter 2- Visual Basic Schneider
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Program design example Task: Develop an algorithm expressed in pseudocode for a specified problem specified problem.
CS 201 Functions Debzani Deb.
Chapter 1 Principles of Programming and Software Engineering.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
The Art of Programming Top-Down Design. The Art of Problem Solving The art of problem solving is the transformation of an English description of a problem.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Software Construction. Implementation System Specification Requirements Analysis Architectural Design Detailed Design Coding & Debugging Unit Testing.
The Pseudocode Programming Process Chapter 9. Summary of Steps in Building Classes and Routines.
1 Shawlands Academy Higher Computing Software Development Unit.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
The Software Development Life Cycle. Software Development SDLC The Software Development Life-Cycle Sometimes called the program development lifecycle.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Lecture 5: Developing Procedural Thinking (How to think like a programmer) B Burlingame 30 Sept 2015.
SE: CHAPTER 7 Writing The Program
The Software Development Process
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Programming Introduction. What is a program? Computers cannot think for themselves, they can only follow instructions. A program is a set of instructions.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
Lecture 3: Developing Procedural Thinking (How to think like a programmer) B Burlingame 16 Feb 2016.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Principles of Programming & Software Engineering
How to develop a program
ICS 3UI - Introduction to Computer Science
User-Written Functions
More Sophisticated Behavior
CSCI-235 Micro-Computer Applications
Topics Introduction to Repetition Structures
Principles of Programming and Software Engineering
The Pseudocode Programming Process
An Introduction to Programming and VB.NET
Topic: Functions – Part 2
The Selection Structure
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Algorithm and Ambiguity
Understand the Programming Process
An Introduction to Visual Basic .NET and Program Design
CS 240 – Lecture 11 Pseudocode.
Computer Programming.
Designing and Debugging Batch and Interactive COBOL Programs
Unit# 9: Computer Program Development
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
Component-Level Design
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2- Visual Basic Schneider
Understand the Programming Process
Problem Solving Skill Area 305.1
Algorithm and Ambiguity
Learning Intention I will learn about evaluating a program.
Algorithms and Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Introduction To Software Development Environment
Presentation transcript:

Program Design Language (PDL) Slides by: Noppadon Kamolvilassatian Source: Code Complete by Steve McConnell, Chapter 4

Steps in Building a Routine

PDL Overview PDL (Program Design Language) is for designing at a slightly higher level that the code itself. Use English-like (or Thai-like) statements that precisely describe specific operations Write PDL at the level of intent Write PDL at a low enough level that generating code from it will be nearly automatic

Example of Bad PDL

Example of Good PDL

PDL Benefits PDL makes reviews easier PDL supports the idea of iterative refinement: architecture->interface & PDL->source code PDL makes changes easier PDL minimizes commenting effort PDL will be turned into comments for source code PDL is easier to maintain that other forms of design documentation

Design the Routine Example: ReadErrorMessage() Spec: RecordErrorMessage() takes an error code as an input argument and outputs an error message corresponding to the code. It’s responsible for handling invalid codes. If the program is operating interactively, RecordErrorMessage() prints the message to the user. If it’s operating in batch mode, RecordErrorMessage() logs the message to a message file. After outputting the message, RecordErrorMessage() returns a status variable indicating whether it succeeded or failed.

Design the Routine Check the prerequisites check if the job of the routine is well defined and fits into the architecture Define the problem that the routine will solve State the problem in enough detail State the Input, Output, Internal data, Error handling Name the routine Use precise, unambiguous name (like ReadErrorMessage() ) Avoid names with the words ‘Handle’, ‘Process’ or other vague words

Design the Routine Decide how to test the routine Think about testing cases, the method to use, etc. Think about efficiency In general, refining overall design helps a lot more. Research the algorithms and data structures Don’t “reinvent the wheel” Write the PDL Begin with the purpose of the routine, followed by the algorithm

Design the Routine Think about the data Check the PDL Iterate If data manipulation is the main purpose, think about it before the logic. Check the PDL Make sure you really understand PDL. Otherwise, how can you understand the code written from it? Iterate Try as many ideas as you can in PDL before start coding. Refine until each PDL statement can be translated into one or a few lines of code

Turning PDL into Code Write the routine declaration Added the header comment Turn the PDL into comments Fill in the code below each comment.

Turning PDL into Code Check the code informally Clean up the leftovers Repeat steps as needed In some cases, you may need to move back to design. Formally review the code Until you are sure that you understand why the code works! The main difference between hobbyists and professional programmers grows out of moving from superstition into understanding.

Example of a Header Comment

Example of PDL

Example of Expressing PDL Comments as Code

Example of Expressing PDL Comments as Code

Complete Routine

Complete Routine

Complete Routine