Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (1 vote)
2K views9 pages

Structured and Unstructured Maintenance With Example

The document discusses structured and unstructured software maintenance. Structured maintenance examines the original design, modifies it if needed, reworks the code to match, and conducts regression testing. It allows for easier assessment of change impact but may not always be possible. Unstructured maintenance makes direct changes to source code without considering design, making impact difficult to assess and regression testing impossible. The document also discusses top-down and bottom-up programming. Top-down programming starts with a high-level description and breaks it into simpler pieces until the language primitives are reached. Bottom-up programming starts with language primitives and constructs more complex features until the application is complete. Top-down programming complicates testing while bottom-up programming

Uploaded by

Anuj Mathur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (1 vote)
2K views9 pages

Structured and Unstructured Maintenance With Example

The document discusses structured and unstructured software maintenance. Structured maintenance examines the original design, modifies it if needed, reworks the code to match, and conducts regression testing. It allows for easier assessment of change impact but may not always be possible. Unstructured maintenance makes direct changes to source code without considering design, making impact difficult to assess and regression testing impossible. The document also discusses top-down and bottom-up programming. Top-down programming starts with a high-level description and breaks it into simpler pieces until the language primitives are reached. Bottom-up programming starts with language primitives and constructs more complex features until the application is complete. Top-down programming complicates testing while bottom-up programming

Uploaded by

Anuj Mathur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 9

Question: 1 Structured and unstructured

maintenance with example.

Structured maintenance examines and modifies the original


design, and then reworks the code to match it. Clearly structured
maintenance is a more reliable and (usually) a more efficient
process. Unfortunately, it's not always possible.
Software configuration exists
Tasks include evaluation of design documentation,
assessment of change impact, modify design, review, &
coding
Regression tests conducted before release
Can be done due to earlier SE approach
Amount of wasted effort reduced,
change/correction is enhanced

overall

quality

of

Unstructured maintenance goes straight into the source code


and makes changes based on that alone.
Only source code available
Tasks include evaluation of code, make changes, review
Impact of changes difficult to assess
Regression testing cannot be done because no records of
previous testing

Difficulties due
methodology

Example:

to

development

without

well-defined

Question: 2 Top-down and bottom-up programming


with example.

Top-down programming
Top-down programming is the opposite of bottom-up
programming. It refers to a style of programming where an
application is constructed starting with a high-level description of
what it is supposed to do, and breaking the specification down
into simpler and simpler pieces, until a level has been reached
that corresponds to the primitives of the programming language
to be used.
Disadvantages of top-down programming
Top-down programming complicates testing. Noting executable
exists until the very late in the development, so in order to test
what has been done so far, one must write stubs .
Furthermore, top-down programming tends to generate modules
that are very specific to the application that is being written, thus
not very reusable.

But the main disadvantage of top-down programming is that all


decisions made from the start of the project depend directly or
indirectly on the high-level specification of the application. It is a
well-known fact that this specification tends to change over time.
When that happens, there is a great risk that large parts of the
application need to be rewritten.

How does top-down programming work?

Top-down programming tends to generate modules that are based


on functionality, usually in the form of functions or procedures.
Typically, the high-level specification of the system states
functionality. This high-level description is then refined to be a
sequence or a loop of simpler functions or procedures, that are
then themselves refined, etc.
In this style of programming, there is a great risk that
implementation details of many data structures have to be shared
between modules, and thus globally exposed. This in turn makes
it tempting for other modules to use these implementation
details, thereby creating unwanted dependencies between
different parts of the application.
Example 1:
Top-down approach:
In this an overview of the system is first formulated,
Specifying but not detailing any first-level subsystems.
Each subsystem is then refined in yet greater detail,
Sometimes in many additional subsystem levels, until the
Entire specification is reduced to base elements.
Example 2:
Top down design begins the design with
the main or top-level module, and progresses downward to the
lowest level modules or subsystems.

Bottom-up programming

What is bottom-up programming?


Bottom-up programming is the opposite of top-down
programming. It refers to a style of programming where an
application is constructed starting with existing primitives of the
programming language, and constructing gradually more and
more complicated features, until the all of the application has
been written.
Advantages of bottom-up programming

Bottom-up programming has several advantages over top-down


programming.
Testing is simplified since no stubs are needed. While it might be
necessary to write test functions, these are simpler to write than
stubs, and sometimes not necessary at all, in particular if one
uses an interactive programming environment such as Common
Lisp or GDB.

Pieces of programs written bottom-up tend to be more general,


and thus more reusable, than pieces of programs written topdown. In fact, one can argue that the purpose bottom-up
programming is to create an application-specific language. Such a
language is suitable for implementing an entire class of
applications, not only the one that is to be written. This fact
greatly simplifies maintenance, in particular adding new features
to the application. It also makes it possible to delay the final
decision concerning the exact functionality of the application.
Being able to delay this decision makes it less likely that the client
has changed his or her mind between the establishment of the
specifications of the application and its implementation.

How does bottom-up programming work?

In a language such as C or Java, bottom-up programming takes


the form of constructing abstract data types from primitives of the
language or from existing abstract data types.
In Common Lisp, in addition to constructing abstract data types, it
is common to build functions bottom-up from simpler functions,
and to use macros to construct new special forms from simpler
ones.
One may ask why it is not possible to construct functions and
special forms bottom-up in other languages than Common Lisp.
Constructing functions bottom-up requires a way of passing
complicated arguments between functions. Common Lisp uses
lists for such argument passing. Lists are flexible standardized
data structures in the language. In other languages, data
structures would have to be defined for such parameter passing
only, making it more like an abstract data type than just a
function. With respect to special forms, only the two-level syntax
of Common Lisp allows a flexible enough macro facility for
bottom-up programming of special forms.

Example 1:

Bottom-up approach:
In this approach the individual base elements of the system
Are first specified in great detail. These elements are
Then linked together to form larger subsystems, which then

In turn are linked, sometimes in many levels, until a


Complete top-level system is formed.

Example 2:
Bottom up design begins the design with the lowest level
modules or subsystems, and progresses upward to the main
program, module, or subsystem. With bottom up design, a
structure chart is necessary to determine the order of
execution, and the development of drivers is necessary to
complete the bottom up approach.

Question: 3
example.

Structured

Programming

with

Structured programming, sometimes known as modular


programming, is a subset of procedural programming that
enforces a logical structure on the program being written to make
it more efficient and easier to understand and modify.

Structured programming frequently employs a top-down design


model, in which developers map out the overall program structure
into separate subsections. A defined function or set of similar
functions is coded in a separate module or submodule, which
means that code can be loaded into memory more efficiently and
that modules can be reused in other programs. After a module
has been tested individually, it is then integrated with other
modules into the overall program structure.
Program flow follows a simple hierarchical model that employs
looping constructs such as "for," "repeat," and "while." Use of the
"Go To" statement is discouraged.
Structured programming was first suggested by Corrado Bohm
and Guiseppe Jacopini. The two mathematicians demonstrated
that any computer program can be written with just three
structures: decisions, sequences, and loops. Edsger Dijkstra's
subsequent article, Go To Statement Considered Harmful was
instrumental in the trend towards structured programming. The
most common methodology employed was developed by Dijkstra.
In this model (which is often considered to be synonymous with
structured programming, although other models exist) the
developer separates programs into subsections that each have
only one point of access and one point of exit.
Almost any language can use structured programming techniques
to avoid common pitfalls of unstructured languages. Unstructured
programming must rely upon the discipline of the developer to
avoid structural problems, and as a consequence may result in
poorly organized programs. Most modern procedural languages
include features that encourage structured programming. Objectoriented programming (OOP) can be thought of as a type of

structured
programming,
uses
structured
programming
techniques for program flow, and adds more structure for data to
the model.
Example:
In a normal programming language, if you want the program do to something when a
user clicks the mouse, you will tell the program to GOTO a location within the code lines
to excuse then after this code executes, you will use GOTO to go to somewhere else.
Programming languages that use this technique usually called "Step Driven
Programming Language.

On the other hand, Structured programming use functions! You simply call the function,
it executes then you continue working. When you use this technique, you will find out
that your program is simply divided (structured) into function. That's why it's
STRUCTURED!

You might also like