Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach

web.firat.edu.tr
from web.firat.edu.tr More from this publisher
21.08.2013 Views

Exercises 109 skill. On the other hand, it is an excellent approach if we want a method that guides our thinking but allows us plenty of scope for creativity. In a sense, therefore, the method is not as advanced as some. For example, data structure design takes the programmer from a description of the structure of the data or files that the program is to act upon, via a number of fairly precise steps to the program design. By contrast, the use of functional decomposition encourages (some would say necessitates) the use of creativity and imagination in devising software structures. Its use also needs careful judgment in selecting the best structure from amongst any alternatives found. In summary, functional decomposition is a general-purpose method for software design, based around structured programming, but in allowing the development of alternative designs for the same problem it poses several unanswered questions: ■ where do we get the inspiration for alternative designs? ■ how do we choose between designs? ■ how do we know that we have arrived at the best possible design? We have to look to other sources of ideas to answer these questions. These issues have led some to say that functional decomposition is not really a serious method. Summary Functional decomposition proceeds by starting with a single statement of each function of the software. Next these are rewritten as a series of simpler steps using pseudo-code (program design language) as a notation. Pseudo-code consists of natural language imperative sentences written as sequences, with if statements or with while statements. The designs are refined (rewritten as more primitive steps) until the required level of detail is achieved. The method makes direct use of the power of abstraction provided by structured programming, while requiring significant creativity and judgment to be employed. It is applicable to the full range of computer application areas. • Exercises 8.1 Complete the design of the game program. 8.2 Write pseudo-code for the withdraw cash function in the ATM (Appendix A). 8.3 Use functional decomposition to design the software for each of the systems described in Appendix A. 8.4 What characteristics should a good software design method have? Does the functional decomposition exhibit them?

110 Chapter 8 ■ Functional decomposition 8.5 Evaluate functional decomposition under the following headings: ■ special features and strengths ■ weaknesses ■ philosophy/perspective? ■ systematic? ■ appropriate applications ■ inappropriate applications ■ is the method top-down, bottom-up or something else? ■ good for large-scale design? ■ good for small-scale design? 8.6 Compare and contrast the principles behind the following design methods: ■ functional decomposition ■ data structure design ■ data flow design ■ object-oriented design Answer to self-test question 8.1 move alien if x > window width or x < 0 then stepSize = -stepSize; endif x = x + stepSize; • Further reading Arguably the most important book about structured programming is: O.J. Dahl, E.W. Dijkstra and C.A.R. Hoare, Structured Programming, Academic Press, 1997.

Exercises 109<br />

skill. On the other hand, it is an excellent approach if we want a method that guides<br />

our thinking but allows us plenty of scope <strong>for</strong> creativity. In a sense, there<strong>for</strong>e, the<br />

method is not as advanced as some. For example, data structure design takes the programmer<br />

from a description of the structure of the data or files that the program is to<br />

act upon, via a number of fairly precise steps to the program design. By contrast, the<br />

use of functional decomposition encourages (some would say necessitates) the use of<br />

creativity and imagination in devising software structures. Its use also needs careful<br />

judgment in selecting the best structure from amongst any alternatives found.<br />

In summary, functional decomposition is a general-purpose method <strong>for</strong> software<br />

design, based around structured programming, but in allowing the development of<br />

alternative designs <strong>for</strong> the same problem it poses several unanswered questions:<br />

■ where do we get the inspiration <strong>for</strong> alternative designs?<br />

■ how do we choose between designs?<br />

■ how do we know that we have arrived at the best possible design?<br />

We have to look to other sources of ideas to answer these questions. These issues<br />

have led some to say that functional decomposition is not really a serious method.<br />

Summary<br />

Functional decomposition proceeds by starting with a single statement of each<br />

function of the software. Next these are rewritten as a series of simpler steps using<br />

pseudo-code (program design language) as a notation. Pseudo-code consists of<br />

natural language imperative sentences written as sequences, with if statements or<br />

with while statements. The designs are refined (rewritten as more primitive steps)<br />

until the required level of detail is achieved.<br />

The method makes direct use of the power of abstraction provided by structured<br />

programming, while requiring significant creativity and judgment to be<br />

employed. It is applicable to the full range of computer application areas.<br />

•<br />

Exercises<br />

8.1 Complete the design of the game program.<br />

8.2 Write pseudo-code <strong>for</strong> the withdraw cash function in the ATM (Appendix A).<br />

8.3 Use functional decomposition to design the software <strong>for</strong> each of the systems<br />

described in Appendix A.<br />

8.4 What characteristics should a good software design method have? Does the functional<br />

decomposition exhibit them?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!