1 / 11

Detailed Design Representations (Chapter 9 of Code Complete )

Detailed Design Representations (Chapter 9 of Code Complete ). Steve Chenoweth CSSE 375, Rose-Hulman Based on Don Bagert’s 2006 Lecture. Today (Mon, Sep 17, 2007). Review Reuse & Reusability Two topics – Detailed design & pseudocode – this Maintenance Management & Organization

jara
Download Presentation

Detailed Design Representations (Chapter 9 of Code Complete )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Today (Mon, Sep 17, 2007) • Review Reuse & Reusability • Two topics – • Detailed design & pseudocode – this • Maintenance Management & Organization • Tonight – Turn in your team’s 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 < 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 < 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 < 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 <= the square root of n do If Index is a factor of n FactorNotFound = false Else Index = Index + 2 End if End While Return FactorNotFound End if

  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/nsd • Control Structure Diagrams • jGRASP http://www.jgrasp.org/

  11. jGRASP Exercise(if we have time)

More Related