A Nassi–Shneiderman diagram (NSD) in computer programming is a
graphical design representation for
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
. This type of
diagram
A diagram is a symbolic Depiction, representation of information using Visualization (graphics), visualization techniques. Diagrams have been used since prehistoric times on Cave painting, walls of caves, but became more prevalent during the Age o ...
was developed in 1972 by
Isaac Nassi and
Ben Shneiderman
Ben Shneiderman (born August 21, 1947) is an American computer scientist, a Distinguished University Professor in the University of Maryland Department of Computer Science, which is part of the University of Maryland College of Computer, Mathem ...
who were both graduate students at
Stony Brook University
Stony Brook University (SBU), officially the State University of New York at Stony Brook, is a public university, public research university in Stony Brook, New York, United States, on Long Island. Along with the University at Buffalo, it is on ...
. These diagrams are also called structograms, as they show a program's structures.
Overview
Following a
top-down design, the problem at hand is reduced into smaller and smaller subproblems, until only simple statements and
control flow
In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an '' ...
constructs remain. Nassi–Shneiderman diagrams reflect this top-down decomposition in a straightforward way, using nested boxes to represent subproblems. Consistent with the philosophy of structured programming, Nassi–Shneiderman diagrams have no representation for a
GOTO statement.
Nassi–Shneiderman diagrams are only rarely used for formal programming. Their abstraction level is close to structured program code and modifications require the whole diagram to be redrawn, but graphic editors removed that limitation. They clarify algorithms and high-level designs, which make them useful in teaching. They were included in
Microsoft Visio
Microsoft Visio (, ), formerly Microsoft Office Visio, is a diagramming and vector graphics application and is part of the Microsoft 365 Business. The product was first introduced in 1992 by former American software company Visio Corporation, an ...
and dozens of other software tools, such as the German EasyCODE.
In Germany, Nassi–Shneiderman diagrams were standardised in 1985 as DIN 66261. They are still used in German introductions to programming, for example Böttcher and Kneißl's introduction to C, Baeumle-Courth and Schmidt's introduction to C and Kirch's introduction to C#.
Nassi–Shneiderman diagrams can also be used in
technical writing
Technical writing is a specialized form of communication used by many of today's industrial and scientific organizations to clearly and accurately convey complex information to a user. An organization's customers, employees, assembly workers, engin ...
.
[Weiss, Edmond H.: "Visualizing a Procedure with Nassi-Schneiderman Charts", ''Journal of Technical Writing and Communication'', Vol. 20, Nr. 3 (1990): 237-54.]
Diagrams
Process blocks: the process block represents the simplest of steps and requires no analysis. When a process block is encountered, the action inside the block is performed and we move onto the next block.
Branching blocks: there are two types of branching blocks. First is the simple True/False or Yes/No branching block which offers the program two paths to take depending on whether or not a condition has been fulfilled. These blocks can be used as a looping procedure stopping the program from continuing until a condition has been fulfilled.
The second type of branching block is a multiple branching block. This block is used when a select case is needed in a program. The block usually contains a question or select case. The block provides the program with an array of choices and is often used in conjunction with sub process blocks to save space.
Testing loops: this block allows the program to loop one or a set of processes until a particular condition is fulfilled. The process blocks covered by each loop are subset with a side-bar extending out from the condition.
There are two main types of testing loops, test first and test last blocks. The only difference between the two is the order in which the steps involved are completed.
In the test first situation, when the program encounters the block it tests to see if the condition is fulfilled, then, if it is not completes the process blocks and then loops back. The test is performed again and, if the condition is still unfulfilled, it processes again. If at any stage the condition is fulfilled the program skips the process blocks and continues onto the next block.
The test last block is simply reversed, the process blocks are completed before the test is performed. The test last loop allows for the process blocks to be performed at least once before the first test.
Parallel execution can be drawn like this:
See also
*
Drakon-chart
*
Flowchart
A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be defined as a diagrammatic representation of an algorithm, a step-by-step approach to solving a task.
The flowchart shows the steps as boxes of v ...
*
Pseudocode
In computer science, pseudocode is a description of the steps in an algorithm using a mix of conventions of programming languages (like assignment operator, conditional operator, loop) with informal, usually self-explanatory, notation of actio ...
Publications
* Nassi, I.; Shneiderman, B.:
Flowchart techniques for structured programming',
SIGPLAN
SIGPLAN is the Association for Computing Machinery's Special Interest Group (SIG) on programming languages. This SIG explores programming language concepts and tools, focusing on design, implementation, practice, and theory. Its members are progra ...
Notices XII, August 1973.
References
External links
''A short history of structured flowcharts (Nassi–Shneiderman Diagrams)'' by Ben Shneiderman, draft, 27 May 2003.
* Nicholas Hebb:
(no date).
* Jülich Supercomputing Centre (JSC):
, 30 October 2012.
* Yoder, Cornelia M; Schrag, Marilyn L.:
Nassi-Shneiderman Charts: An Alternative to Flowcharts for Design. ''Proceedings, ACM SIGSOFT/BIGMETRICS Software and Assurance Workshop'', November 1978.
{{DEFAULTSORT:Nassi-Shneiderman diagram
Computer programming
Diagrams