DFD's Examples - Fundamentals of Software Engineering, Fourth Edition, Rajib Mall
DFD's Examples - Fundamentals of Software Engineering, Fourth Edition, Rajib Mall
com******
Novices usually clutter their DFDs with too many data flow arrow. It
becomes difficult to understand a DFD if any bubble is associated with
more than seven data flows. When there are too many data flowing in
or out of a DFD, it is better to combine these data items into a high-
level data item. Figure 6.7 shows an example concerning how a DFD
can be simplified by combining several data flows into a single high-
level data flow.
calculate the mean, and finally calculate the root. This decomposition is
shown in the level 2 DFD in Figure 6.8(c).
Figure 6.8: Context diagram, level 1, and level 2 DFDs for Example 6.1.
bsq: integer
csq: integer
msq: integer
Example 6.1 is an almost trivial example and is only meant to illustrate the
basic methodology. Now, let us perform the structured analysis for a more
complex problem.
Example 6.2 (Tic-Tac-Toe Computer Game ) Tic-tac-toe is a computer game in
which a human player and the computer make alternate moves on a 3 × 3
square. A move consists of marking a previously unmarked square. The
player who is first to place three consecutive marks along a straight line (i.e.,
along a row, column, or diagonal) on the square wins. As soon as either of
the human player or the computer wins, a message congratulating the winner
should be displayed. If neither player manages to get three consecutive
marks along a straight line, and all the squares on the board are filled up,
then the game is drawn. The computer always tries to win a game.
The context diagram and the level 1 DFD are shown in Figure 6.9.
Data dictionary for the DFD model of Example 6.2
move: integer /* number between 1 to 9 */
display: game+result
game: board
board: {integer}9
result: [“computer won”, “human won”, “drawn”]
Example 6.3 (Supermarket Prize Scheme) A super market needs to develop a
software that would help it to automate a scheme that it plans to introduce
to encourage regular customers. In this scheme, a customer would have first
register by supplying his/her residence address, telephone number, and the
driving license number. Each customer who registers for this scheme is
assigned a unique customer number (CN) by the computer. A customer can
present his CN to the check out staff when he makes any purchase. In this
case, the value of his purchase is credited against his CN. At the end of each
year, the supermarket intends to award surprise gifts to 10 customers who
make the highest total purchase over the year. Also, it intends to award a 22
caret gold coin to every customer whose purchase exceeded Rs. 10,000. The
entries against the CN are reset on the last day of every year after the prize
winners’ lists are generated.
Figure 6.9: Context diagram and level 1 DFDs for Example 6.2.
The context diagram for the supermarket prize scheme problem of Example
6.3 is shown in Figure 6.10. The level 1 DFD in Figure 6.11. The level 2 DFD
in Figure 6.12.
The trading house has a set of regular customers. The customers place
orders with it for various kinds of commodities. The trading house
maintains the names and addresses of its regular customers. Each of
these regular customers should be assigned a unique customer
identification numb e r (CIN) by the computer. The customers quote
their CIN on every order they place.
Once order is placed, as per current practice, the accounts department
of the trading house first checks the credit-worthiness of the customer.
The credit-worthiness of the customer is determined by analysing the
history of his payments to different bills sent to him in the past. After
automation, this task has be done by the computer.
If a customer is not credit-worthy, his orders are not processed any
further and an appropriate order rejection message is generated for
the customer.
If a customer is credit-worthy, the items that he has ordered are
checked against the list of items that the trading house deals with. The
items in the order which the trading house does not deal with, are not
processed any further and an appropriate apology message for the
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
The context diagram for the trading house automation problem is shown in
Figure 6.13. The level 1 DFD in Figure 6.14.
If two types of data always get updated at the same time, they should be stored in a
single data store. Otherwise, separate data stores should be used for them.
The inventory data changes each time supply arrives and the inventory
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
The level 2 DFD for the manageOwnBook bubble is shown in Figure 6.17.