370 likes | 523 Views
Nassi-Shneiderman Charts. Andrea Schumacher. Background. Nassi-Shneiderman (N-S) charts were initially developed in the early 1970’s by Ike Nassi and Ben Shneiderman They are based on and perform a function similar to flowcharts
E N D
Nassi-Shneiderman Charts Andrea Schumacher
Background • Nassi-Shneiderman (N-S) charts were initially developed in the early 1970’s by Ike Nassi and Ben Shneiderman • They are based on and perform a function similar to flowcharts • The initial purpose was to develop a technique to chart the logic design of structured programs • N-S Charts are also know as Program Structure Diagrams (PSD) and Chapin Charts.
Agenda • 1)Overview • 2)Primary Uses • 3) Advantages • 4)Disadvantages • 5)Relationship with Other Techniques • 6) Symbols • 7)Examples • 8)Resources/Tools • 9) Group projects
Overview • Nassi-Shneiderman charts have four primary uses: • Creating the logic design • Programming from the charts • Writing program documentation • Maintenance of the program
Primary Uses1. Creating the Logic Design • As mentioned previously this was the initial purpose of Nassi-Shneiderman charts • They can be thought of as the building blocks of the design • The completed chart is the blueprint for the program code
Primary Uses2. Programming From the Charts • The N-S chart can be use to do the actual programming • It can be considered as a type of “pictorial” pseudocode • Some of the N-S editors convert the diagram directly into source code
Primary Uses3. Writing Program Documentation • The N-S chart is a pictorial representation of the logical design of the program • Using the N-S chart as an actual part of the documentation is a great idea!
Primary Uses4. Maintenance of the Program • N-S charts provide a quick reference to the structure and design of the program which helps during on-going maintenance and upgrades.
Advantages - General • One main advantage is that N-S charts adopt the structured programming philosophy • N-S charts use only a few symbols which make them easier to learn then traditional flowcharts • They help to recognize missing policies or procedures from business rules • Completed charts should fit on one page, there are no complex arrows to follow
Advantages – General (cont.) • Have one entry point and one exit point • They can be nested to show complex procedures • N-S charts are independent of any specific programming language
Advantages – Programming • The logic is documented in the N-S chart so regardless of the coding language used, N-S charts make coding much easier then starting from scratch • Clearly displays sequence, selection, and repetition (such as nested loops) to make debugging easier • Confusing “GOTOs” are not represented
Disadvantages • They can be difficult to draw • They can be harder to update or change then traditional flow charts because everything stays together • They must be comprehensive to be understood
Data Modeling Entity Relation Diagram,I-graphs, InformationStructure Diagram A N-S can model operationson the objects/entitiesdefined in a data model. Process Modeling Data Flow Diagram,A-graphs, Information FlowDiagram Object Oriented Object Diagram, OOA model,Object schema N-S charts can be used as a furtherdescription of action orobject. State Modeling State Transition,Petri-nets N-S can be used as arepresentation of atransition by usingconditions. Relationship with Other Techniques Kind of Technique Example Technique Relation • The activities/processes defined • in the process models can be further • described in detail in a N-S chart • A N-S chart can also be used as a • translation of process model wwwis.cs.utwente.nl
Symbols • Only 3 basic symbols used in N-S charts • Process (Sequence) • Decision (Selection) • Iteration (Repetition) • Other symbols are used but they are based on these three symbols
Process • A stackable box is used to represent a sequence or process Step 1 Step 2 Step 3
Decision (Selection) • The “if-then-else” If… (then) (else)
Decision (Selection) • The case/switch/selection statement
Iteration • These symbols show loops While Repeat Until
Graduation Example Pseudocode While “FOR ALL SECOND-YEAR STUDENTS” do if “ENOUGH CREDITS? then “YES”: if “BILLS PAID?” then “YES”: “GRANT DIPLOMA” else “NO”: “NO DIPLOMA” end if else “NO”: “NO DIPLOMA” end if end while
Drawing “Hints” • The size of the final rectangle has no bearing on the program • Fit one drawing to a page • They work the best with small or medium-sized programs • Draw the major loops first, complete the inner loops later
Drawing “Hints” • Nested loops are indented, of course as the number of nested loops increase, the width of the chart changes • Sub-procedures can be drawn using a different N-S chart • If the N-S diagram is cluttered it may be the policy you are diagramming is unclear
User Comments • The University of Liverpool develop a N-S editor using a VAX based Pascal complier called NSEDIT • User responses: • 60% agreed that it helped to ensure the correct syntax • 21% said it enforced structured programming • 12% felt it made the transition from design to code easier
Editor Downloads/Tools • Nassi-Shneiderman Diagrams Editor for Unix http://www.kfa-juelich.de/zam/nassi/ • free download for a demo or about $30 dollars for a user license • Microsoft Visio 2000 supports N-S charts
Editor Downloads (cont.) • StruktoGraaf 3.0 Windows 95/98/ME/NT/2000 http://www.sichemsoft.nl/producuk.html • A free download for a demo, about 135 (or student version for 57) for a user license
Summary • We have seen some of the advantages and disadvantages of using Nassi-Shneiderman charts • I think you can clearly see the benefits to using N-S charts for system design as well as documentation and maintenance
References • Beek, Marcel, Koolen, Hans, Van Setten, Mark: (1996), “Program Structure Diagrams”, (visited 3/18/01), wwwis.cs.utwente.nl:8080/dmrg/mee/misop.htm • Cary, David (2000): “Nassi-Shneiderman on the Web”, (visited 3/18/01), www.rdrop.com/~cary/html/psd.html • Coenen, Frans: “Comp101 – Design and Style Review”, (visited 3/6/01), www.csc.liv.ac.uk/~frans/comp101/week9/designAndStyle.htm. • Halewood, K. and Woodward M.R.: (1988), “NSEDIT: A Syntax-directed Editor and Testing Tool based on Nassi-Shneiderman Charts”, Software-Practice and Experience, Vol. 18, No.10, pp. 987-998 • Juch, Forschungszentrum: (1997) “Nassi Tutorial”,(visited 3/12/01), www.kfa-juelich.de/zam/nassi/tutorial.html • Kendall, Kenneth E. and Kendall, Julie E.: (1999) System Analysis and Design, Prentice Hall, New Jersey
References (cont.) • Seesing, Paul R.: (1993), “Basic System Analysis Tools for Computer Users”, (visited 4/9/01), www.open.org/~prslkg/sy_chap.htm • Tiemann, Peter: “Nassi-Shneiderman Charts”, (visited 4/9/01), www.preview.org/software/sc_help/nassishneiderman • “Why Should I Use Structograms?”: (visited 4/9/01), www.blue-river-software.com/products/whystructs.htm • Weiss, Edmond H.: (1990). “Visualizing a Procedure with Nassi-Schneiderman Charts”, Journal of Technical Writing and Communication, Vol. 20, No.3, pp. 237-254 • Woodward, M.R.: (1987) “The Use of Nassi-Shneiderman Charts and Supporting Tools in Software Engineering Education”, Computer Education, Vol. 11, No. 4, pp. 267-279