views:

111

answers:

5

I need to write a lab report for a program I made. I need to provide a "top-down discussion of design." What does that mean?

+2  A: 

A top down view would be starting with the whole program and looking at each major component. For each major component, describe its components and so forth until you are at the bottom with trivial things like lists.

For example, a car:

1) Engine
    a) Cylinders
        i) Valves
        ii) Piston
    b) Crankshaft
2) Transmission
    a) Gears

Et cetera.

David Kanarek
+1  A: 

Take the program as a whole and break it up into it's major components, describing each in turn. Then for each of these, break them up further. Continue until you are at a level where the components are small and trivial.

Jeremy Simon
+1  A: 

Start with a high-level description of your program. What is it's goal? What type of input does take? What type of output does it produce? Think of your program like a black box.

The second step in top-down is to start discussing more details about how it works. Think of your system as a white box now. What kind of design pattern did you use? What does it do with input? How does it use input to produce output?

Progressively include more details until you think that someone could reproduce your design based solely on your discussion.

Dolph
+1  A: 

I suspect a top-down description of your design would first describe the user interface (all the places where the user will interact with your program, and how that interaction would go -- use cases).

Then you would possible drill down into more fundamental aspects of your design like the architectural components that will drive the user interface, and perhaps how they all fit together in a diagram. You could use dia for making a diagram; it is free.

LonnieBest
+1  A: 

You could start off with the source file that has your main() function by walking through each element from beginning to end. My recent program started with parsing the command line, initializing declared variables with data from the command line, loading data file into memory, parsing each line of the data file, displaying the output to the console, releasing memory, and ended with the return status value. Explain each function call that is made along the way and why you group some functions in one module but not in another.

C.D. Reimer