Top Down Approach (or) Stepwise Refinement

Program development includes designing, coding , testing & verification of a program in any computer language for writing a good program, the top down approach can be used.

It is also known as systematic programming (or) hierarchical program design (or) step-wise refinement.

A complex problem is broken into smaller sub problems. Further each sub problem is broken into a no of smaller sub problems & till the sub problems at the lowest level are easy to solve.

Similarly a large program is broken into no of subprograms and in turn each sub program is further decomposed into sub programs and so on.

Suppose we want to solve a problem S, which can be decomposed into sub problems s1, s2, s3 and so on. Let the program for s, s1, s2, s3 be denoted by p, p1, p2, p3 respectively.

Further suppose that s2  is solved by decomposing it into sub problems s21&s22& programs p21, p22 . One written for these. This operation of coding a subprogram in terms of lower level sub programs is known as the process of step wise refinement.

The following figure shows the hierarchical decomposition of P into its subprograms & sub subprograms.


top down approach
 Step-wise Refinement

The advantages of the Top–Down design approach are:–

1. A large problem is divided into a no of smaller problems using this approach. The decomposition is continued till the sub problems at the lowest level become easy to solve. So the overall problem solving becomes easy.

2. If we use the top–down for a problem than top–down programming method can be used for coding modules at various stages. So, the top level modules can be coded without coding the lower level modules earlier. This approach, is better than the bottom–up approach where programming starts first at lowest level modules.

3.If helps is top–down testing & debugging of programs.

4. The programs become uses friendly (i.e., easy to read & understand) & easy to maintain & modify.

5. Different programmers can write the modules for different levels.

Related

Write about Constant Pointers in C

Constant Pointers A constant pointer is a pointer that cannot change the address its holding. In other words, we can say that once a constant pointer points to a variable then it cannot point to an...

What is an Array? Explain about One-Dimensional Arrays?

The fundamental data types can store only one value at any given time. To process large amounts of data, c supports a derived data type known as Array. An array can be use...

What is a Function ? Explain Different types of Functions?

Functions are a self contained block of code that performs a particular false. A function can take some data from the main program, and returns a value. The large program...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item