Detailed Design Representations Chapter 9 of Code Complete - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Detailed Design Representations Chapter 9 of Code Complete

Description:

Structure is similar to source code. Can describe various levels of detail. 6 ... First iteration (keeps to definition of prime number): If the integer 2 ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 12
Provided by: MarkA114
Category:

less

Transcript and Presenter's Notes

Title: Detailed Design Representations Chapter 9 of Code Complete


1
Detailed Design Representations (Chapter 9 of
Code Complete)
  • Steve Chenoweth
  • CSSE 375, Rose-Hulman
  • Based on Don Bagerts 2006 Lecture

2
Today (Mon, Sep 17, 2007)
  • Review Reuse Reusability
  • Two topics
  • Detailed design pseudocode this
  • Maintenance Management Organization
  • Tonight Turn in your teams maintenance plan
  • Note Exam, Wed night, Oct 3, 7 9 PM

3
Outline
  • Detailed Design Representations
  • Background
  • Pseudocode
  • Other Representations

4
Background
  • In some ways, detailed design is becoming a lost
    art
  • Nowadays, programmers often write source code
    directly from high-level design
  • Is this a good thing?

5
What is Pseudocode?
  • An informal, natural-language notation for
    describing an algorithm
  • Advantages
  • Structure is similar to source code
  • Can describe various levels of detail

6
Example Whether or not an integer is a prime
number 1/3
  • First iteration (keeps to definition of prime
    number)
  • If the integer lt 2
  • Return false
  • Else
  • Determine whether there is a factor between 2
    and the
  • integer minus 1
  • If no factor is found
  • Return true
  • Else
  • Return false
  • End If
  • End If

7
Example Whether or not an integer is a prime
number 2/3
  • Second iteration (Takes advantage of known
    facts)
  • If the integer lt 2
  • Return false
  • Else if the integer 2
  • Return true
  • Else if the integer is even
  • Return false
  • Else
  • Determine whether there is a factor between 3
    and the square
  • root of the integer
  • If no factor is found
  • Return true
  • Else
  • Return false
  • End If
  • End If

8
Example Whether or not an integer is a prime
number 3/3
  • Third iteration (Determination loop and variables
    included)
  • If n lt 2
  • Return false
  • Else If n 2
  • Return true
  • Else If n is even
  • Return false
  • Else
  • FactorNotFound true
  • Index 3
  • While FactorNotFound and Index lt the square
    root of n do
  • If Index is a factor of n
  • FactorNotFound false
  • Else
  • Index Index 2
  • End if
  • End While

9
Group Discussion Do you think that pseudocode is
useful?
10
Other Detailed Design Representations
  • Flowcharts
  • Classic
  • Examples
  • http//www.tpub.com/neets/book22/93c.htm
  • http//www.fh-jena.de/kleine/history/software/IBM
    -FlowchartingTechniques-GC20-8152-1.pdf (from
    1969!)
  • Structured
  • Example
  • http//www.cs.umd.edu/hcil/members/bshneiderman/ns
    d
  • Control Structure Diagrams
  • jGRASP http//www.jgrasp.org/

11
jGRASP Exercise(if we have time)
Write a Comment
User Comments (0)
About PowerShow.com