2
2 Introduction ● Function-oriented design techniques are very popular: – Currently in use in many software development organizations. ● Function-oriented design techniques: – Start with the functional requirements specified in the SRS document.

3
3 Introduction ● During the design process: – High-level functions are successively decomposed: ● Into more detailed functions. – Finally the detailed functions are mapped to a module structure.

5
5 Introduction ● SA/SD methodology: – has essential features of several important function-oriented design methodologies: ● If you need to use any specific design methodology later on, ● You can do so easily with small additional effort.

12
12 Structured Analysis vs. Structured Design ● Purpose of structured analysis : – Capture the detailed structure of the system as the user views it. ● Purpose of structured design: – Arrive at a form that is suitable for implementation in some programming language.

13
13 Structured Analysis vs. Structured Design ● The results of structured analysis can be easily understood even by ordinary customers: – Does not require computer knowledge. – Directly represents customer’s perception of the problem. – Uses customer’s terminology for naming different functions and data. ● The results of structured analysis can be reviewed by customers: – To check whether it captures all their requirements.

15
15 Data Flow Diagrams ● DFD is an elegant modelling technique: – Useful not only to represent the results of structured analysis. – Applicable to other areas also: ● e.g. for showing the flow of documents or items in an organization, ● DFD technique is very popular: – It is powerful and yet simple to understand and use.

16
16 Data Flow Diagram ● DFD is a hierarchical graphical model: – Shows the different functions (or processes) of the system and – Data interchange among the processes.

17
17 DFD Concepts ● It is useful to consider each function as a processing station: – Each function consumes some input data. – Produces some output data.

20
20 Hierarchical Model ● Human mind can easily understand any hierarchical model: – In a hierarchical model: ● We start with a very simple and abstract model of a system, ● Details are slowly introduced through the hierarchies.

23
23 External Entity Symbol ● Represented by a rectangle ● External entities are real physical entities: – input data to the system or – consume data produced by the system. – Sometimes external entities are called terminator, source, or sink. Librarian

24
24 Function Symbol ● A function such as “search-book” is represented using a circle: – This symbol is called a process or bubble or transform. – Bubbles are annotated with corresponding function names. – Functions represent some activity: ● Function names should be verbs. search- book

27
27 Data Store Symbol ● Direction of data flow arrow: – Shows whether data is being read from or written into it. ● An arrow into or out of a data store: – Implicitly represents the entire data of the data store – Arrows connecting to a data store need not be annotated with any data name. find-book Books

31
31 Yourdon's vs. Gane Sarson Notations ● The notations that we would be following are closer to the Yourdon's notations ● You may sometimes find notations in books that are slightly different – For example, the data store may look like a box with one end closed

32
32 How is Structured Analysis Performed? ● Initially represent the software at the most abstract level: – Called the context diagram. – The entire system is represented as a single bubble, – This bubble is labelled according to the main function of the system.

35
35 Context Diagram ● Context diagram captures: – Various entities external to the system and interacting with it. – Data flow occurring between the system and the external entities. ● The context diagram is also called as the level 0 DFD.

38
38 Higher Level DFDs ● Each high-level function is separately decomposed into subfunctions: – Identify the subfunctions of the function – Identify the data input to each subfunction – Identify the data output from each subfunction ● These are represented as DFDs.

39
39 Decomposition ● Decomposition of a bubble: – Also called factoring or exploding. ● Each bubble is decomposed to – Between 3 to 7 bubbles.

40
40 Decomposition ● Too few bubbles make decomposition superfluous: – If a bubble is decomposed to just one or two bubbles: ● Then this decomposition is redundant.

41
41 Decomposition ● Too many bubbles: – More than 7 bubbles at any level of a DFD. – Make the DFD model hard to understand.

42
42 Decompose How Long? ● Decomposition of a bubble should be carried on until: – A level at which the function of the bubble can be described using a simple algorithm.

43
43 Example 1: RMS Calculating Software ● Consider a software called RMS calculating software: – Reads three integers in the range of and – Finds out the root mean square (rms) of the three input numbers – Displays the result.

44
44 Example 1: RMS Calculating Software ● The context diagram is simple to develop: – The system accepts 3 integers from the user – Returns the result to him.

51
51 Example: RMS Calculating Software ● Decomposition is never carried on up to basic instruction level: – A bubble is not decomposed any further: ● If it can be represented by a simple set of instructions.

52
52 Data Dictionary ● A DFD is always accompanied by a data dictionary. ● A data dictionary lists all data items appearing in a DFD: – Definition of all composite data items in terms of their component data items. – All data names along with the purpose of the data items. ● For example, a data dictionary entry may be: – grossPay = regularPay+overtimePay

53
53 Importance of Data Dictionary ● Provides all engineers in a project with standard terminology for all data: – A consistent vocabulary for data is very important – Different engineers tend to use different terms to refer to the same data, ● Causes unnecessary confusion.

54
54 Importance of Data Dictionary ● Data dictionary provides the definition of different data: – In terms of their component elements. ● For large systems, – The data dictionary grows rapidly in size and complexity. – Typical projects can have thousands of data dictionary entries. – It is extremely difficult to maintain such a dictionary manually.

56
56 Data Dictionary ● CASE tools support queries: – About definition and usage of data items. ● For example, queries may be made to find: – Which data item affects which processes, – A process affects which data items, – The definition and usage of specific data items, etc. ● Query handling is facilitated: – If data dictionary is stored in a relational database management system (RDBMS).

61
61 Balancing a DFD ● Data flowing into or out of a bubble: – Must match the data flows at the next level of DFD. ● In the level 1 of the DFD, – Data item c flows into the bubble P3 and the data item d and e flow out. ● In the next level, bubble P3 is decomposed. – The decomposition is balanced as data item c flows into the level 2 diagram and d and e flow out.

62
62 Balancing a DFD a b e d c c d e c1 d1 e1 Level 1 Level 2

63
63 Numbering of Bubbles ● Number the bubbles in a DFD: – Numbers help in uniquely identifying any bubble from its bubble number. ● The bubble at context level: – Assigned number 0. ● Bubbles at level 1: – Numbered 0.1, 0.2, 0.3, etc ● When a bubble numbered x is decomposed, – Its children bubble are numbered x.1, x.2, x.3, etc.

64
64 Example 2: Tic-Tac-Toe Computer Game ● A human player and the computer make alternate moves on a 3 X 3 square. ● A move consists of marking a previously unmarked square. ● The user inputs a number between 1 and 9 to mark a square ● Whoever is first to place three consecutive marks along a straight line (i.e., along a row, column, or diagonal) on the square wins.

65
65 Example: Tic-Tac-Toe Computer Game ● As soon as either of the human player or the computer wins, – A message announcing 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.