Design Tools

views updated

Design Tools

Computer programming is not easy. The programmer has to be able to think logically and know how to break down a big problem into tiny pieces. To accomplish this, some people like to state the problem and the steps necessary for its solution in their natural language before trying to code the program in a computer language. What they are doing is defining the correct algorithm giving the computer the information and process it needs to solve the problem. Writing the program becomes very easy after the algorithm has been spelled out. Since the hard part is defining the problem and the approach needed for its solution, there are several design tools available to help with this planning process. These include flowcharts, pseudocode, and Nassi-Shneiderman diagrams, which are used specifically with structured programs.

Flowcharts

A flowchart represents an algorithm using symbols instead of words. The step-by-step process is shown with lines, arrows, and boxes of different shapes demonstrating the flow of the process. Flowcharts are very useful in program development and provide excellent documentation. Because the steps needed for a solution have been defined, a flowchart can easily be translated into any computer language after it has been tested.

Any process can be articulated with these shapes and some connecting lines and arrows. One should note that the only symbol that allows two exits is the diamond-shaped decision symbol. It is used to indicate that the computer can take either of two paths depending on whether the comparison is true or false. All other flow chart symbols have only one exit line.

The symbols are usually read from top to bottom, and from left to right. Straight lines connect the symbols and represent how the algorithm advances from step to step. Their arrows are used to clarify the direction of flow. To complete the picture, brief instructions are written within each symbol to provide a more detailed description of the tasks represented by the symbols.

Some standard flowchart symbols and their meaning are shown in Figure 1. Flowcharts can be used to provide an overview of the major components of a program or to detail each of the processing steps within a program. Macro flowcharts outline the general flow of a program and are useful when dividing a complex problem into modules, especially when implementing structured programming techniques. Detail, or micro flowcharts, depict the processing steps required within a particular module and often involve a one-to-one correspondence between flowchart symbols and program statements. Figure 2 shows a flowchart which computes the average of a list of numbers, in this example an input data value of -999 is used to stop the loop.

Pseudocode

Pseudocode is an English-like description of the processing steps to be performed in a program. The programmer writes these descriptions in the order in which corresponding program statements will appear in the program. Although there are no standards for pseudocode, it usually uses structured programming control structures.

For example, sequence structures are usually written in lowercase, while uppercase START and END are used to denote major blocks of code. In addition, IF, ELSE, ENDIF, DO WHILE and DO UNTIL are always in uppercase, and conditions are indented using lowercase.

The use of pseudocode allows the programmer to focus on the steps needed to perform a specific process without having to worry about how they should be stated in a computer language. Because pseudocode can be easier to update than a flowchart, it is preferred by some programmers. Figure 3 shows an example of a pseudocode used to set up the logic for finding the average of a list of numbers.

Nassi-Shneiderman Diagrams

These charts, an example of which is shown in Figure 4, are also called structured flowcharts or iteration diagrams. They were proposed by Isaac Nassi and Ben Shneiderman as an alternative to flowcharts to help programmers when planning structured programs. Each diagram corresponds to one of the programming control structures: sequence, selection and repetition. For example, a rectangular box is used for sequence, while an "L" or inverted "L" is used for repetition. As shown on page 57, Figure 4 illustrates these and other combinations being used for "if-then-else" and for multiple selections.

The outline of each Nassi-Shneiderman diagram is a rectangle and its subdivision always gives more rectangles that may be subdivided even further. Therefore, these diagrams can be nested within each other, modeling recursion, a feature of structured programming. Programmers like to work with these diagrams because they are easy to follow. They also feel that analyzing an algorithm is made easier because of the simplicity in which the logic is set forth.

All of these design tools can be used in combination to plan and develop accurate and efficient software. Other options may include CASE (computer-aided software engineering) tools, which automate many of the tasks required in developing a system, and structured walkthroughs, which help members of a programming team to review and evaluate the progress of modules in a structured project.

see also Algorithms; Boolean Algebra; Programming.

Ida M. Flynn

Bibliography

Stair, Ralph M., and George W. Reynolds. Principles of Information Systems, 5th ed. Boston: Thomson Learning, 2001.

Swirsky, Robert. "The Art of Flowcharting." Popular Computing (September, 1982): 7578.

Welburn, Tyler. Structured COBOL: Fundamentals and Style. Palo Alto, CA: Mayfield Publishing, 1981.