SE-381
Software Engineering
BEIT-V
Lecture # 26
(Detailed Design / Module Description)
Recap
• We have been thru Structured System Analysis
and partly thru Structured System Design; have
completely understood ...
Recap
• Higher Level Design was represented by
Structured Charts, which were realized
from Data Flow Diagrams, keeping
Mod...
For Complex SCs and Inflated
Attribute Lists
1
2
3
4
Lnk
#
Inputs Outputs
1 - a, n
2 a, n a
3 x, y x, y
4 a, n sum
main
so...
Example Problem
There is a text file containing
words separated by blanks or new
lines. Design a software system to
determ...
Transformation from DFDs to SC
An Example
MAI – Most Abstract Input MAO – Most Abstract Output
First Level Factoring
Furthering Factoring of Input
Module - SORT
Second Level Factoring of SORT
Detailed Design
– These Module descriptions are not detailed
enough, so that these can be implemented or
transformed into ...
Process/Module Description
• Processes or Modules can be described
using
– Design Specification/Description Languages
– St...
Module Specifications
– Informal methods usually lead to different
interpretations, so to avoid this, Formal or Semi-
form...
– Module specifications are Implementation
Independent – should not specify or suggest any
particular method or language o...
– Ideally the Structured English or PDL is to
express the design in a way that it is as
precise and unambiguous as possibl...
Structured English
– Structured English is used
• To remove logical ambiguities and
• To describe activities performed by ...
Structured English
• Structured English is comprised of
– Keywords or reserved words, used by many of the
PLs like IF, THE...
PDL Description for Sort Module
• A design in PDL or Structured English is:
minmax (in file)
ARRAY a
DO UNTIL end of input
READ an item into a
ENDDO
max, ...
An Example
Text is given in a file with one blank between
two words. It is to be formatted into lines of 80
characters, ex...
For Complex Modules …
• Structured English or PDL may not be the
solution
• For example, for an automated Chess program,
a...
An Example – Jungle Kingdom
Admission
A Child under 3 years of age is not to be charged an
admission fee. A person under 1...
Decision Tree
Decision Tables
– These are comprised of four parts:
• The Condition Stub – indicates in a number of
rows the appropriate ...
Decision Table
References
• Pankaj Jalote, (2004 / 2005), An Integrated Approach to
Software Engineering, 2nd / 3rd Edition;Narosa Publis...
Se 381 - lec 26  - 26 - 12 may30 - software design -  detailed design - se deceision trees and tables
Upcoming SlideShare
Loading in …5
×

Se 381 - lec 26 - 26 - 12 may30 - software design - detailed design - se deceision trees and tables

808 views

Published on

Software Engineering, Lectures

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
808
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Se 381 - lec 26 - 26 - 12 may30 - software design - detailed design - se deceision trees and tables

  1. 1. SE-381 Software Engineering BEIT-V Lecture # 26 (Detailed Design / Module Description)
  2. 2. Recap • We have been thru Structured System Analysis and partly thru Structured System Design; have completely understood the problem and have modeled its solution in the form of Higher level or System Design • The Structured Chart (Higher Level Design description) identifies the Modules, their interconnectivity, Interfaces. Functionality of each of these modules and their Test Cases • These modules – for an Industrial Strength Software – would be in large number and are to be programmed by other team(s) of programmers
  3. 3. Recap • Higher Level Design was represented by Structured Charts, which were realized from Data Flow Diagrams, keeping Modularity concepts in mind • In Structured Charts if interfaces are containing larger number of parameters, then these can be represented by table, like
  4. 4. For Complex SCs and Inflated Attribute Lists 1 2 3 4 Lnk # Inputs Outputs 1 - a, n 2 a, n a 3 x, y x, y 4 a, n sum main sortreadnums switch Add_n
  5. 5. Example Problem There is a text file containing words separated by blanks or new lines. Design a software system to determine the number of unique words in the file
  6. 6. Transformation from DFDs to SC An Example MAI – Most Abstract Input MAO – Most Abstract Output
  7. 7. First Level Factoring
  8. 8. Furthering Factoring of Input Module - SORT
  9. 9. Second Level Factoring of SORT
  10. 10. Detailed Design – These Module descriptions are not detailed enough, so that these can be implemented or transformed into code by Programmers – Detailed Design, specifies these Modules further in a language that is Unambiguous, Non-confusing, Clear and Detailed to an extent that these Modules can be coded by the programmers independently
  11. 11. Process/Module Description • Processes or Modules can be described using – Design Specification/Description Languages – Structured English or pseudo-code – Decision Tables – Decision Trees – And other methods, For Example State Transition Diagrams, Formal Methods; mostly depending upon the nature of the problem
  12. 12. Module Specifications – Informal methods usually lead to different interpretations, so to avoid this, Formal or Semi- formal methods are used to ensure the specifications are precise and not open to multiple interpretations – These methods are applicable to both Function or Object Oriented Designs – It is ensured that Module Specifications are • Complete – these describe the entire behavior of the module • Unambiguous • Understandable – as these are to be implemented by Programmers, usually not the part of design team – Formal specifications are usually hard to understand and equally hard to write.
  13. 13. – Module specifications are Implementation Independent – should not specify or suggest any particular method or language of implementation (Key to re-use of design and re-implementation in any HLPL – High Level Programming Language) – Specifications should give the external behavior, the internal behavior or details of the module should be decided by the programmer – Hoare 1969, pointed out that the inputs and outputs of a Functional Module should qualify certain Pre- conditions and Post-conditions, say for find_sqrt, the input needs to be non-negative real numbers and output is again a positive real number. – Older Authors used Structure English for specifying the detailed design of modules, Eg Baynon-Davies 1989, whereas the more recent authors Jalote 2005 etc call it PDL – Process Description Language
  14. 14. – Ideally the Structured English or PDL is to express the design in a way that it is as precise and unambiguous as possible, without having too much detail and that can be easily converted into an implementation. – PDL has an overall outer syntax of a Structured Programming Language and has vocabulary of a natural language. Same is the case with Structured English
  15. 15. Structured English – Structured English is used • To remove logical ambiguities and • To describe activities performed by the respective process • Various blocks are indented, to demonstrate the structure of the process • Implementation details can be written if needed, in pseudo code form • Pseudo code is near to physical description of the implementation
  16. 16. Structured English • Structured English is comprised of – Keywords or reserved words, used by many of the PLs like IF, THEN, ELSE, ENDIF, FOR, READ, WRITE, FROM, TO, DO etc for distinction these are usually written in CAPITALS – Imperative verbs - written in plain English, EG get, receive, update, modify, do, iterate etc – Variable names – from DFDs, DD, Data Elements or Data Structures, better be italicized Eg stock, students_database, course etc • Process or Module name should be mentioned on the top in all capitals
  17. 17. PDL Description for Sort Module
  18. 18. • A design in PDL or Structured English is: minmax (in file) ARRAY a DO UNTIL end of input READ an item into a ENDDO max, min: = first item of a DO FOR each item in a IF max < item THEN set max to item IF min > item THEN set min to item ENDDO END ----- CAPITILIZED are RESERVED WORDS Problem: Determine the min and max of a set of numbers in a file
  19. 19. An Example Text is given in a file with one blank between two words. It is to be formatted into lines of 80 characters, except the last line. A word is not to be divided into two lines, and the numbers of blanks needed to fill the line are added at the end, with no more than two blanks between words. The PDL version of it is …
  20. 20. For Complex Modules … • Structured English or PDL may not be the solution • For example, for an automated Chess program, a routine required to move a pawn, will have to consider all possible situations created by that move and this is to be decided with the position of other pawns at the board at that time. So description of such a routine in SE or PDL will not be possible and we can consider options like Decision Tree or Decision Table
  21. 21. An Example – Jungle Kingdom Admission A Child under 3 years of age is not to be charged an admission fee. A person under 18 is to be charged half full admission. If a child under 12 is accompanied by an adult, however, then that person is to be charged quarter full admission. For persons over 18 years, full admission is to be charged, except for students who are to be charged half admission and senior citizens (women over 60 and men over 65 years) who are to be charged quarter full admission. A discount of 10% is to apply to all persons subject to full admission who are members of a party of 10 or more. Finally, there are no student concession on the weekends.
  22. 22. Decision Tree
  23. 23. Decision Tables – These are comprised of four parts: • The Condition Stub – indicates in a number of rows the appropriate questions to be asked. • The Conditions Entry – indicates in a series of columns the appropriate combination of conditions that apply • The Actions Stub – indicates in a series of rows the appropriate actions to be taken in a process • The Actions Entry – indicates in a series of columns the appropriate combination of actions that apply, given the combination of conditions
  24. 24. Decision Table
  25. 25. References • Pankaj Jalote, (2004 / 2005), An Integrated Approach to Software Engineering, 2nd / 3rd Edition;Narosa Publishing House, New Delhi – Chapter 7 / 8 – Detailed Design • Paul Beynon-Davies (1989); Information Systems Development, MacMillan, London, UK, pp 93-103, Ch-9 Process Description • Jeffrey L Whitten, Lonnie D Bentley and Victor M Barlow (1997); System Analysis and Design Methods, 2nd Edition, Richard D Irwin Inc. Ch-19 Designing Structured Programs, pp: 651-677 • E Yourdan and L Constantine (1979), Structured Design, Printice Hall,

×