π Lecture 6 β Use Diagram for a Library System
π Overview: This lecture explains how to create and document use case models in software engineering. It covers the iterative process of identifying actors and use cases, defining relationships among use cases, elaborating use cases with detailed specifics, and visualizing them with activity diagrams. Understanding these concepts is crucial for capturing functional requirements and communicating system behavior from a user's perspective.
ποΈ Topics Covered
The lecture begins with an example use case diagram for a library management system, illustrating actors and use cases. It then describes the iterative process of creating a use case model. Next, it explains two types of relationships among use cases: "uses" and "extends", including actor inheritance. The process of elaborating use cases with components like preconditions, post-conditions, normal course of events, and exceptions is detailed. Alternative ways of documenting use cases are presented, followed by an explanation of activity diagrams for pictorial description. The lecture concludes by discussing the limitations of use cases, particularly regarding non-functional requirements.
π Lecture Summary
Use Diagram for a Library System
As an example, a use case diagram for a library management system is introduced. In this diagram, there are four actors: Book Borrower, Librarian, Browser, and Journal Borrower. These actors interact with eight use cases, which are represented by ovals enclosed within the system boundary, shown as a rectangle. It is important to note that every use case must always deliver some value to the actor. From the diagram, a Book Borrower can reserve a book, borrow a book, return a book, or extend loan of a book. Similarly, functions performed by other users can be easily examined.
Creating a Use Case Model
Creating a use case model is an iterative activity. The iteration starts with the identification of actors. In the next step, use cases for each actor are determined, which define the system. After that, relationships among use cases are defined. These steps are not strictly sequential; they are parallel and concurrent, and a use case model evolves slowly from these activities. The activity stops when no new use cases or actors are discovered. At the end, the model is validated.
3.9 Relationship among Use Cases
The UML allows extending and reusing already defined use cases by defining the relationship among them. Use cases can be reused and extended in two fashions: uses and extends.
In the case of a "uses" relationship, one use case invokes the steps defined in another use case during its own execution. This is similar to a function call. For example, the Delete Information use case uses two already existing use cases: Record Transaction and Cancel Transaction. The direction of the arrow determines which use case is using the other.
π Definition β Uses relationship: A relationship where one use case invokes the steps defined in another use case during its own execution.
In the case of an "extends" relationship, it is a kind of generalization-specialization relationship. A special instance of an already existing use case is created. The new use case inherits all the properties of the existing use case, including its actors. For example, Place Conference Call is a specialization of Place Phone Call. In this case, the arrow goes from the new (derived) use case towards the base use case.
π Definition β Extends relationship: A generalization-specialization relationship where a new use case inherits all properties of an existing use case.
π‘ Why this matters: These relationships allow for reuse and extension of use cases, making the model more maintainable and less redundant.
Actor Inheritance
The concept of reusability can also be used for actors. New classes of actors may be created by inheriting from old classes. For example, Individual Customer and Corporate Customer are created by extending Customer. In this case, all the use cases available to Customer would also be available to these two new actors.
3.10 Elaborated Use Cases
After deriving the use case model, each use case is elaborated by adding detail of interaction between the user and the system. An elaborated use case has the following components:
- Use Case Name
- Implementation Priority: the relative implementation priority of the use case.
- Actors: names of the actors that use this use case.
- Summary: a brief description of the use case.
- Precondition: the condition that must be met before the use case can be invoked.
- Post-Condition: the state of the system after completion of the use case.
- Extend: the use case it extends, if any.
- Uses: the use case it uses, if any.
- Normal Course of Events: sequence of actions in the case of normal use.
- Alternative Path: deviations from the normal course.
- Exception: course of action in the case of some exceptional condition.
- Assumption: all the assumptions that have been taken for this use case.
As an example, the Delete Information use case is elaborated as follows:
- Use Case Name: Delete Information
- Priority: 3
- Actors: User
- Summary: Deleting information allows the user to permanently remove information from the system. Deleting information is only possible when the information has not been used in the system.
- Preconditions: Information was previously saved to the system and a user needs to permanently delete the information.
- Post-Conditions: The information is no longer available anywhere in the system.
- Uses: Record Transactions, Cancel Action
- Extends: None
- Normal Course of Events:
- The use case starts when the user wants to delete an entire set of information such as a user, commission plan, or group.
- The user selects the set of information that he/she would like to delete and directs the system to delete the information. - Exception 1, 2
- The system responds by asking the user to confirm deleting the information.
- The user confirms deletion. (Alternative Path: Cancel Action)
- A system responds by deleting the information and notifying the user that the information was deleted from the system.
- Uses: Record Transaction
- This use case ends.
- Alternative Path - The user does not confirm Deletion:
- If the user does not confirm deletion, the information does not delete.
- Uses: Cancel Action
- Exceptions:
- The system will not allow a user to delete information that is being used in the system.
- The system will not allow a user to delete another user that has subordinates.
- Assumptions:
- Deleting information covers a permanent deletion of an entire set of data such as a commission plan, user, group etc. Deleting a portion of an entire set constitutes modifying the set of data.
- Deleted information is not retained in the system.
- A user can only delete information that has not been used in the system.
π Structure: Elaborated use case components β provide a structured template for documenting all aspects of a use case's behavior.
3.11 Alternative Ways of Documenting the Use Case
Many people and organizations prefer to document the steps of interaction in two separate columns: User Action and System Reaction. This is a matter of personal and organizational preference. The important thing is to write the use case in proper detail.
π Example (Two-column format for Delete Information):
| User Action | System Reaction |
|---|---|
| 1. The use case starts when the user wants to delete an entire set of information such as a user, commission plan, or group. | |
| 2. The user selects the set of information that he/she would like to delete and directs the system to delete the information. - Exception 1, 2 | |
| 3. The system responds by asking the user to confirm deleting the information. | |
| 4. The user confirms deletion. | |
| 5. A system responds by deleting the information and notifying the user that the information was deleted from the system. |
3.12 Activity Diagrams
An activity diagram gives a pictorial description of the use case. It is similar to a flow chart and shows a flow from activity to activity. It expresses the dynamic aspect of the system. An activity diagram for the Delete Information use case is provided, showing activities like "Choose Object to Delete", "Initiate Deletion", decision diamonds for "[Delete Allowed]" and "[Confirm Delete]", and references to other activities (e.g., "See Activity Diagram for Canceling Actions").
π Definition β Activity Diagram: A pictorial description of a use case, similar to a flow chart, that shows a flow from activity to activity and expresses the dynamic aspect of the system.
3.13 Limitations of Use Cases
Use cases alone are not sufficient. There are kinds of requirements (mostly non-functional) that need to be understood. Since use cases provide a userβs perspective, they describe the system as a black box and hide internal details. Hence, domain (business) rules as well as legal issues are not documented in a use case.
Non-functional requirements are also not documented in the use cases. Examples include:
- Usability: Color blind people should not have any difficulty in using the system β color coding should take care of common forms of color blindness.
- Reliability: The system needs to support 7 x 24 operation.
- Performance: Authorization should be completed within 1 minute 90% of the time. Average authorization confirmation time should not exceed 30 seconds.
- Portability: The system should run on Windows 98 and above as well as Sun Solaris 7.0 and above.
- Access: System should be accessible over the internet β hidden requirement β security.
π‘ Why this matters: Because of this shortcoming, use cases must be augmented by additional information to capture all system requirements.
β Key Takeaways
The most critical points from this lecture are that creating a use case model is an iterative activity involving actor identification, use case definition, and relationship modeling. Use cases can be related through "uses" (invoking another use case's steps) and "extends" (generalization-specialization) relationships, which also apply to actors. Each use case must be elaborated with detailed components like preconditions, post-conditions, normal and alternative flows, exceptions, and assumptions. While activity diagrams provide a pictorial flow of a use case, use cases alone have limitations in documenting non-functional requirements, domain rules, and legal issues, so they must be supplemented with additional information.
π§ Quick Revision Questions
- What are the two types of relationships among use cases in UML, and what is the key difference between them?
- What are the essential components of an elaborated use case?
- In the "extends" relationship, what does the derived use case inherit from the base use case?
- What is the purpose of an activity diagram in relation to a use case?
- What are the main limitations of use cases, and what kind of requirements do they fail to capture?
π Lecture 7 β Source and Sink Analysis & Process Models
π Overview: This lecture introduces source and sink analysis as a verification technique to check completeness and consistency of requirements. It then explains process models as domain models used to understand business processes, with a detailed example of a hospital registration system. Understanding these concepts is critical for ensuring no redundant or missing requirements exist in software specifications.
ποΈ Topics Covered
This lecture covers source and sink analysis for verifying requirements completeness, including definitions and analysis of sources (origins of information) and sinks (consumers of information). It then shifts to domain models, emphasizing the importance of understanding the business domain as a software engineer. Finally, it introduces logical system models and provides a detailed business process model example of a hospital registration system, explaining the flow for both OPD and IPD patients.
π Lecture Summary
3.14 Source and Sink Analysis
Once requirements are documented using analysis models, an independent verification is needed to verify completeness and consistency. This involves careful analysis of sources and sinks of information.
π Definition β Source: A source is a stakeholder who describes requirements (needs, constraints) to be included as system functionality. Sources can be processes that generate certain information that the system may have to process or maintain. Sources are the origins from where corresponding business processes are initiated. The analyst must trace from a requirement back to its origins to see who initiates it β be it a person, organization, or external entity.
π Definition β Sink: A sink is the consumer of certain information. It provides a logical end to a business process. Sinks help identify persons, organizations, or external systems that receive functionality from the system. These are logical ends of requirements, or where all requirements are consumed.
π Example: Consider a user of a software application who retrieves a report from the system. When the user reviews the report, they become the sink of that report. The analyst analyzing the sink of a report requirement would naturally point toward the user who would receive that report.
In source and sink analysis, the analyst determines all sources of requirements and where these requirements are consumed (sinks). For a report displaying certain information, the source is the data (and who enters it) that is input to be retrieved later. Whoever needs this report becomes its sink.
At times, data is gathered in an application that is not used anywhere. The question becomes: is it redundant, or is something missing from the requirements? If certain inputs (sources) to a process have no corresponding outputs (sinks), such inputs are redundant and can be removed. However, if probing discovers corresponding outputs that were not recorded initially, those inputs were not redundant β rather, missing (output-related) requirements were discovered during sink analysis.
π‘ Why this matters: A requirement statement describing a report but not listing its sources is incomplete. The software engineer validating such requirements must identify all sources against sinks (or vice versa) to determine complete end-to-end requirements.
Process Models
During the requirements analysis phase, different models are developed to express requirements. Though these models complement each other, they differ in how information is expressed. Most models are pictorial with explanatory diagrams.
Domain Models
Understanding the Business Domain
The first step in delivering a system is establishing what needs to be driven β clear understanding of the problem domain is imperative. A software developer must understand the business problem they are solving. Unless they develop this understanding, it is difficult to develop the right solution. Collecting both ends (sources, sinks) involved in different business processes ensures corresponding requirements are complete and yields better problem domain understanding.
A software engineer works on domains that may not correspond to their field of specialization. They may develop an embedded application for a microwave machine or a decision support system for a stock exchange broker. Since these underlying systems are not software systems, the software engineer cannot be expected to know these domains.
An important difference between software engineering and other engineering disciplines is that the software engineer works on problems not directly related to software engineering. An electrical engineer works on electrical domain problems; a civil engineer works on civil engineering problems. The software engineer must learn user vocabulary and terms used in routine operations. To overcome this, domain gathering techniques are used to extract requirements from unfamiliar systems, making requirements gathering and validation convenient and manageable.
4.2 Logical System Models
System models are techniques used to understand user needs, and software engineers use these to understand business domains. Software engineers develop diagrams to model different business processes. System models include:
- User business processes
- User activities for conducting business processes
- Processes that need to be automated
- Processes which are not to be automated
Business Process Model
The process model provides a high-level pictorial view of the business process. It can be used as a starting point to give basic orientation to the document reader. Below is an example of a hospital registration system which deals with two types of patients.
[Diagram Description: The business process diagram shows registration for both OPD (Out Patient Department) and IPD (In Patient Department) patients.]
As opposed to flow charts, there are parallel activities in this diagram which are further elaborated by specifying their major activities. The process described is as follows:
- A patient may come to visit In Patient Department (IPD) or Out Patient Department (OPD)
- System determines if they are a company patient or a private patient
- For a company patient, system verifies them
- For an OPD patient, system issues a chit to the patient and informs them about their number and consultant; the patient waits for their turn
- After verifying an IPD patient, system creates a visit and allocates a room or bed. If allocation fails, the patient is informed. Otherwise, the patient is checked in, and their information is maintained in the system
- System displays information about expenses of the required service to the patient
- Some advance payment is received against the required service, and this amount is adjusted in the final settlement
- All information is supplied to the cash office that deals with payments
- Upon receiving cash: for OPD patient, a chit is issued; for IPD patient, an admission form is filled, and information is maintained. A receipt is issued to the patient
- For credit transactions, corresponding vouchers are prepared
- The model depicts processes before treatment starts
- A patient may ask to change their service if unsatisfied; system cancels their record and pays their amount back
- A doctor may ask a patient to change their status from OPD to IPD
Important points about the business process diagram:
- It does not describe the automated system
- It only reflects the existing user process to help the software engineer/analyst understand the business domain
- It may contain information on processes that need not be automated
β Key Takeaways
Source and sink analysis is a critical verification technique to ensure requirements completeness β every source must have a corresponding sink, and vice versa; finding unmatched pairs helps identify redundant inputs or missing output requirements. Understanding the business domain is essential for software engineers, who must learn user vocabulary and domain-specific terms since they often work on problems outside their direct expertise. Business process models provide high-level pictorial views of existing user processes, not automated systems, helping analysts understand the domain before designing solutions. The hospital registration example demonstrates that business processes can involve parallel activities (e.g., OPD vs IPD treatment paths) that must be modeled to capture all requirements correctly. System models include both automated and non-automated processes, and documenting them helps distinguish which parts need software support.
π§ Quick Revision Questions
- What is the purpose of source and sink analysis in requirements verification?
- In the hospital registration example, what happens when a company patient visits IPD versus OPD?
- How can an analyst determine whether an input with no corresponding output is redundant or indicates missing requirements?
- Why must a software engineer learn user vocabulary when working on unfamiliar business domains?
- What are the key differences between a business process model and a flowchart?
π Lecture 8 β State Transition Diagrams
π Overview: This lecture introduces State Transition Diagrams (STDs) as a technique for documenting domain knowledge, particularly for systems where information moves through predefined states. It also covers the benefits of arranging information in tabular form and introduces Data Flow Models (DFDs) for capturing data transformation in automated systems. Understanding these modeling techniques is crucial for requirements analysis and system design.
ποΈ Topics Covered
The lecture covers State Transition Diagrams with an example of a trouble ticket life cycle, including six states (Queued, Open/Active, Deferred, Cleared, Closed, Disabled) and transitions. It then discusses arranging information in tabular form using examples from Function Point Analysis and Pakistan's Income Tax Ordinance. Finally, it introduces Data Flow Models, their notation (processes, external agents, data stores, data flows), the difference between DFDs and flowcharts, and a bank account management system example with guidelines for when to use DFDs.
π Lecture Summary
State Transition Diagrams
State Transition Diagrams (STDs) are a technique to document domain knowledge for systems where information flows from one place to another, with certain actions performed at each place. A file moving between desks in an office is a typical example, where movement is controlled by predefined rules. STDs document these rules clearly.
Trouble Ticket Life Cycle Example (from ITU-X.790) A "trouble" in a communications network is a problem that adversely affects service quality. When detected, a trouble report is entered by a user or raised automatically. Management of the trouble report ensures it receives attention and the trouble is cleared to restore service.
A trouble report also has a Trouble Status attribute that qualifies the state with finer granularity (e.g., "cleared awaiting customer verification"). The time of status attribute change is also captured.
A trouble report may go through six states:
Queued A trouble report is in a queued state when it has been instantiated but the trouble resolution process has not yet been initiated. It may be cancelled by the manager.
π Definition β Queued: The state when a trouble report has been created but no action to resolve it has started.
Open/Active The trouble report becomes open/active when appropriate actions to resolve the trouble are initiated. It may be "referred" to another Hand-off Person or "transferred" to another Responsible Person while remaining in the open/active state. It may be cancelled by the manager.
π Definition β Open/Active: The state when actions to resolve the trouble have started.
Deferred Deferred indicates corrective action has been postponed, such as when the faulty resource is inaccessible. A deferred report may become "open/active" again or move directly to "closed" if cancelled.
π Definition β Deferred: The state when corrective action is postponed due to inaccessibility.
Cleared A trouble report moves to cleared when the agent determines the trouble has been resolved. Manager verification may optionally be awaited before closure.
π Definition β Cleared: The state when the trouble has been resolved.
Closed Closed indicates the trouble resolution process is complete. Attributes are captured in a historical event, and the report may be eliminated at the agent's convenience, though records may be kept per business agreements.
π Definition β Closed: The state when the trouble resolution process is complete and attributes are archived.
Disabled A disabled value occurs when a trouble report's information cannot be updated due to local conditions. Only read operations are permitted.
π Definition β Disabled: The state when only read operations are allowed due to local conditions preventing updates.
The STD for a trouble ticket shows transitions such as: Create β Queued, Cancel β Closed, Approve + Open β Open/Active, Refer/Transfer (remains Open/Active), Defer β Deferred, Release β Open/Active, Clear β Cleared, Close β Closed, Delete β (removal), and Re-open β Open/Active.
π‘ Why this matters: STDs make it easy to understand the complete lifecycle and movement rules of entities in a system, which is essential for designing correct workflows and validating business logic.
Arranging Information in Tabular Form
Sometimes information is more convenient to arrange in tabular form to make it easier to understand, design, code, and test. Two examples are presented:
Example 1: Function Point Analysis - Transactional Function Types Definitions from IFPUG CPM 4.1 for External Inputs, External Outputs, and External Inquiries are difficult to understand in prose form.
- External Input (EI): Processes data/control from outside the boundary; primary intent is to maintain ILFs and/or alter system behavior.
- External Output (EO): Sends data/control outside; primary intent is to present information using processing logic (at least one mathematical formula/calculation or derived data). May also maintain ILFs or alter behavior.
- External Inquiry (EQ): Sends data/control outside; primary intent is to present information by retrieving data from ILF or EIF. No formulas, calculations, derived data, ILF maintenance, or system behavior alteration.
The tabular form simplifies understanding:
Transactional Function Types Table
| Function | EI | EO | EQ |
|---|---|---|---|
| Alter the behaviour of the system | PI | M | N/A |
| Maintain one or more ILFs | PI | M | N/A |
| Present information to the user | M | PI | PI |
PI = Primary intent; M = May be; N/A = Not allowed
This table explains that if a function's primary intent is to present information only, it is an EQ. If it presents information but also maintains ILFs or alters behavior, it is an EO. If its primary intent is to maintain ILFs or alter behavior, it is an EI.
Example 2: Income Tax Ordinance of Pakistan 2001 The prose description of tax brackets is long and hard to follow. The tabular form makes it readable and easier to use:
Income Tax Table
| Income Range | Tax |
|---|---|
| Less than Rs. 60,000 | 0% |
| Between Rs. 60,000 and Rs. 150,000 | 7.5% of (Income - 60,000) |
| Between Rs. 150,000 and Rs. 300,000 | 12.5% of (Income - 150,000) + 6,750 |
| Between Rs. 300,000 and Rs. 400,000 | 20% of (Income - 300,000) + 25,500 |
| Between Rs. 400,000 and Rs. 700,000 | 25% of (Income - 400,000) + 45,500 |
| Greater than Rs. 700,000 | 35% of (Income - 700,000) + 120,500 |
π‘ Why this matters: Once information is organized in tabular form, it can often be stored and mapped onto an array or database table, reducing programming to a table lookup. This reduces domain complexity, effort for design, coding, testing, and maintenance.
Data Flow Model
A Data Flow Model captures the flow of data in a system. It helps develop an understanding of system functionality by showing data sources, transformations, and final outputs. It describes data origination, transformation, and consumption, and organizes information at different levels of abstraction for top-down analysis.
The Notation
- Process (circle/rounded rectangle): Represents work to be done in the system; transforms data.
- External Agent (square): Represents external systems outside the boundary of this system.
- Data Store (open rectangle): Where data is stored for later retrieval; provides inputs to processes and receives outputs.
- Data Flow (arrow): Represents the movement of data in the diagram.
DFD versus Flow Charts DFDs show processes operating in parallel; looping and branching are typically not shown; each process path may have different timing. Flowcharts show sequential steps as an algorithm; looping and branching are part of flowcharts.
| DFD | Flow Chart |
|---|---|
| Processes can operate in parallel | Processes are sequential |
| Looping and branching not shown | Looping and branching are part of flowchart |
| Each path may have different timing | Shows sequence of steps as an algorithm |
Data Flow Model β Bank Account Management System Example
Processes:
- Reconcile account balance
- Deposit funds into an account
- Pay a bill
- Withdraw funds from an account
External Agents:
- Bank
- Creditor
- Employer
- Other income sources
Data Stores:
- Monthly Account statement
- Bank accounts
- Account transactions
Description: The "withdraw funds from an account" process retrieves account and transaction information, bank releases funds, and information goes to "reconcile account balance" which prepares a monthly statement. The "pay a bill" process has a creditor pay dues, accounts are updated, and a receipt is issued. The "deposit funds in an account" process has an employer deposit salaries into employee bank accounts; other income sources also deposit into accounts.
Data Flow Modeling Guidelines
- DFD captures data transformation between processes/functions, not control flow.
- Shows parallel activities without specific sequence.
- All previous models (business process, STD) capture business domain irrespective of automation.
- In DFDs, represent only processes that need automation (involve computation/processing/transformation).
- Processes that just move or transfer data without processing should not be modeled with DFDs.
- Example: A mail desk that just forwards mail has no processing; but if mail is noted in a register before delivery, that recording process can be automated and modeled with a DFD.
β Key Takeaways
State Transition Diagrams are essential for documenting the lifecycle of entities that move through predefined states, such as trouble tickets. Arranging complex domain information in tabular form significantly improves readability, reduces complexity, and simplifies implementation by allowing table/dictionary lookups. Data Flow Models capture the transformation of data between processes that need automation, not control flow or manual transfer activities. The key distinction between DFDs and flowcharts is that DFDs show parallel business flows without sequencing, while flowcharts show sequential, algorithmic control flow. For the exam, remember the six trouble ticket states (Queued, Open/Active, Deferred, Cleared, Closed, Disabled), how to use the transactional function types table to classify EI/EO/EQ, and the DFD notation symbols.
π§ Quick Revision Questions
- Name the six states of a trouble report and describe one transition that can occur from each state.
- In the IFPUG transactional function types table, what distinguishes an External Output (EO) from an External Inquiry (EQ)?
- What is the primary difference between a Data Flow Diagram and a Flow Chart?
- Why should processes that simply move or transfer data (without processing) not be modeled using a Data Flow Model?
- Using the income tax table, calculate the tax for a taxable income of Rs. 500,000.
π Lecture 9 β Typical Processes, Adding Levels of Abstraction to Data Flow Modeling, and Common Mistakes in Data Flow Diagrams
π Overview: This lecture explores typical processes modeled using data flow diagrams (DFDs), such as computation, decision-making, and data transformation. It then introduces the concept of adding levels of abstraction to DFDsβfrom context-level to detailed diagramsβusing a Patient Monitoring System example. Finally, it covers common mistakes and illegal data flows to avoid when constructing DFDs, emphasizing source-sink analysis.
ποΈ Topics Covered
This lecture covers typical processes found in automated systems, including computation, decision-making, filtering, sorting, triggering, and CRUD operations. It explains how to add levels of abstraction to DFDs, starting with context-level diagrams and progressing to level 1 and level 2 diagrams, using a Patient Monitoring System example. The lecture also details common mistakes in DFDs, such as missing inputs or outputs, and illegal data flows like direct communication between external agents or data stores.
π Lecture Summary
4.3 Typical Processes
Processes in data flow diagrams transform data in various ways. Examples include computation processes like "Calculate Commission" which takes transaction amount and type as inputs. Decision-making processes determine outcomes, such as checking product availability in inventory. Filtering processes extract specific data, like sorting outstanding issues that are over a week old. Sorting processes organize data, such as using QuickSort on an array of numbers. Triggering processes invoke other functions, like monthly billing by utility companies. Finally, CRUD operations are actions performed on stored data: Create (stores new data), Read (retrieves data), Update (modifies existing data), and Delete (permanently removes data). π‘ Why this matters: Understanding these typical processes helps analysts identify and model core system functionalities systematically.
4.4 Adding Levels of Abstraction to Data Flow Modeling
To manage complexity, data flow modeling uses multiple levels of abstraction. The Context Level Data Flow Diagram (level 0) provides a high-level view of the system as a single process (a black box) interacting with external entities. It captures all external agentsβpersons, organizations, or other systemsβand the information flows between them and the system, without showing internal details. For example, in a Patient Monitoring System, the context diagram shows the system interacting with a Patient (sending vital signs) and a Nurse (requesting reports, receiving warnings).
Detailed Data Flow Diagrams expand the context diagram. A level 1 DFD refines the single process into major sub-processes while keeping the same external entities. For the Patient Monitoring System, level 1 breaks the system into three processes: Local Monitoring (transforms vital signs into patient data), Central Monitoring (compares patient data with vital sign bounds and may generate a warning message), and Report Generator (handles nurse requests and retrieves log data from the Patient Log).
Level 2 DFDs further refine one process from level 1. For example, the Central Monitoring process in level 2 includes: Unpack Signs (separates patient data into pulse, temperature, and blood pressure), Evaluate Bounds Violation (compares these against vital sign bounds), Produce Warning Message (generates a warning if a violation occurs), and Format Patient Data (prepares formatted patient data for storage). A key rule is that the number of external agents, inputs, and outputs must remain consistent across all levels; adding or removing entities at any level makes the model inconsistent.
π Definition β Context Level Data Flow Diagram: A high-level DFD that shows the entire system as a single process (black box) interacting with external entities, capturing all information flows but no internal details.
π Definition β Level 1 Data Flow Diagram: A DFD that refines the context diagram by breaking the single process into major sub-processes, keeping the same external entities and data flows.
π Rule: The number of external agents, inputs, and outputs must be consistent across all levels of a DFD model (e.g., level 0, level 1, level 2). Any addition or removal of external entities or flows between levels is a mistake.
π Example: In the Patient Monitoring System, the context diagram shows two external entities (Patient and Nurse) with specific flows (vital signs, request for report, warning message, log data, report). Level 1 maintains these same entities and flows while adding three internal processes (Local Monitoring, Central Monitoring, Report Generator). Level 2 then refines Central Monitoring further, but the external entities and top-level flows remain unchanged.
4.5 Common Mistakes in Data Flow Diagrams
Common mistakes in DFDs are identified using source and sink analysis, which checks that every process has both an input (source) and an output (sink). Three key mistakes are highlighted using an accounting system example:
- Missing input: The process "Freeze Member Account" has no input arrow, meaning its source is unknown.
- Missing output: The process "Create a New Member Account" produces no output arrow, meaning its sink is not specified.
- Irrelevant inputs: The process "Generate an Employee Bank Statement" has two inputs (Employee Address and Employee Status), but neither is relevant to generating a bank statement (which requires an account number and time period).
Illegal Data Flows are also described:
- Directly Communicating External Agents: Two external entities (e.g., B1 and B2) communicating directly is illegal. A process must be inserted to transform and exchange data between them.
- External Agent Updating a Data Store Directly: An external agent (e.g., B1) updating a data store directly is illegal. A process must be used to receive, process, and store the data.
- External Agent Accessing a Data Store Directly: An external agent reading from a data store directly is illegal. A process must retrieve and pass the data to the agent.
- Copying Data Between Data Stores Directly: One data store copying data directly to another is illegal. A process must retrieve data from the source store, transform it, and store it in the target store.
π Definition β Source and Sink Analysis: A technique to check completeness of requirements by evaluating whether every process has a defined source (input) and sink (output), ensuring no missing or irrelevant data flows.
π Example: In the accounting system DFD, the process "Freeze Member Account" has no input (source missing), "Create a New Member Account" has no output (sink missing), and "Generate an Employee Bank Statement" has irrelevant inputs (Employee Address and Employee Status, instead of account number and time period). Applying source-sink analysis reveals all three errors.
π Example of Illegal Flow: Two external entities (B1 and B2) shown with a direct arrow between them is illegal. Instead, a process like "Exchange Data Between External Agents" must be inserted.
β Key Takeaways
For the exam, you must remember that typical processes in DFDs include computation, decision-making, filtering, sorting, triggering, and CRUD operations. DFDs use levels of abstraction: context-level (level 0) shows the system as a black box, level 1 breaks it into major processes, and level 2 or beyond refines individual processes. Always ensure consistency of external entities, inputs, and outputs across all levels. Apply source-sink analysis to check that every process has relevant inputs and outputs, and avoid illegal flows like direct communication between external agents, between external agents and data stores, or between data stores without an intermediate process.
π§ Quick Revision Questions
- What are the four CRUD operations, and what does each one do to stored data?
- Explain the difference between a context-level DFD and a level 1 DFD. What remains unchanged between these two levels?
- In the Patient Monitoring System level 2 DFD, what are the four sub-processes of the Central Monitoring process, and what does each do?
- Using source-sink analysis, what three common mistakes can be identified in DFDs? Provide one example for each.
- List four types of illegal data flows in DFDs and explain why each is illegal.
π Lecture 10 β Prototyping and GUI Design
π Overview: This lecture addresses the controversial topic of including graphical user interface (GUI) details in the Software Requirements Specification (SRS) document. It explores both the motivations for using GUI sketches and the potential pitfalls, particularly when requirements are unstable. The lecture also introduces prototyping as a technique to reduce customer dissatisfaction and capture user vision early in the development process.
ποΈ Topics Covered
The lecture discusses the debate over including GUI details in SRS documents, the motivation for good GUI design, and the pitfalls of using GUIs in functional specifications. It provides a detailed example of GUI sketches for a "delete component" use case, highlighting common mistakes and the impact of unstable requirements. Finally, it introduces the concept of prototyping as a method to solidify understanding of requirements before full-scale development begins.
π Lecture Summary
GUI Sketches
Adding user interface details in the SRS is controversial. Opponents argue that by adding GUI details, focus shifts from what to how β GUI is part of the solution. On the other hand, many believe it is still what not how and should be part of the SRS. By adding GUIs in the functional specification (FS), requirements can be solidified with respect to scenario contents. The client often appreciates the SRS document more if it contains GUI details. The SRS is also the baseline for design, user manual, and test planning; presence of UI details allows these activities to start immediately after SRS acceptance. Rapid GUI drafting tools have made this task simpler. Exploring potential user interfaces helps refine requirements and makes user-system interaction more tangible. User displays can aid in project planning and estimation, and a user interface might highlight weaknesses in non-functional requirements like usability. However, if you cannot freeze the requirements specification until UI is complete, the requirement development process takes longer. A common mistake is using UI layouts as a substitute for defining functional requirements β they are supplementary information and cannot replace other SRS components. Any requirement change entails a UI change, and with unstable requirements, this means a lot of rework.
Motivation for GUI
- System users often judge a system by its interface rather than its functionality.
- A poorly designed interface can cause a user to make catastrophic errors.
- Poor user interface design is the reason why so many software systems are never used.
Pitfalls of using GUIs in Functional Specifications
- UIs distract from business process understanding (what) to interfacing details (how).
- Unstable requirements cause frequent modifications in UIs.
- An extra work to be done at the requirement level each time a GUI change must be incorporated.
Example: Delete Component Use Case
The following example demonstrates GUI sketches for a delete component use case and shows how unstable requirements cause difficulties.
The first GUI displays a drop-down list box containing component types, with a top entry of 'None'. The user clicks the arrow to select the component type whose component they want to delete.
The next GUI shows that the user has selected component type 'Plan Type'. Corresponding plans are populated and displayed in a list box on the right side of the GUI.
The following GUI depicts the scenario when user selects a particular plan 'Plan 3' and clicks on the 'Delete' button. If 'Plan 3' is currently being used, the application displays a dialog box informing the user that this plan cannot be deleted as it is in use.
The next GUI shows another dialog box where the user receives a message that 'Plan 3' is not in their hierarchy.
The user then selects 'Plan 2' and deletes it. The system confirms the deletion, and upon confirmation, deletes 'Plan 2'. After deleting, it displays a message that 'Plan 2' has been permanently deleted, yet 'Plan 2' is still visible in the list.
π Definition β Key Mistakes: The above GUIs present two major mistakes. First, if a plan is currently in use, it should not have been displayed in the list at all. Second, instead of displaying two messages separately in two dialog boxes, it would have been appropriate to combine them into one message.
The corrected GUI shows that since the user can only delete plans 1 and 2, only those plans should be displayed to them.
π Example: In this example, it is evident that if requirements are partially generated, a number of changes have to be made. Sometimes the frequency of these changes rises so much that it takes all of the requirements and design time just in finalizing GUIs.
π‘ Why this matters: This demonstrates that unstable requirements cause excessive rework on GUIs, wasting valuable development time and potentially derailing the entire project schedule.
Prototype
Prototyping is a technique used to reduce customer dissatisfaction at the requirement stage. The idea is to capture the user's vision of the product and get early feedback from the user to ensure the development team understands the requirements. This is used when there is uncertainty regarding requirements. Sometimes, even the customer does not know what they actually need, which happens when there is no manual solution.
π Definition β Prototype: A prototype is not the real product. It is a real-looking mock-up of what would eventually be delivered and might not do anything useful. However, the presence of a prototype makes a new product tangible. It brings use cases to life and closes gaps in your understanding of the requirements. From a user's perspective, it is easier to play with a prototype and try it out than to read an SRS document.
β Key Takeaways
The key lesson from this lecture is that while GUI sketches and prototypes are valuable tools for solidifying requirements and gaining user feedback, they must be used carefully. GUIs should supplement, not replace, functional requirements in the SRS. Unstable requirements can cause excessive rework on GUIs, consuming valuable development time. Prototyping is most effective when there is uncertainty about requirements, as it makes the product tangible for users and helps close gaps in understanding. The most critical takeaway is that GUI design mistakesβlike displaying items that cannot be deleted or showing redundant error messagesβcan be avoided by thoroughly understanding requirements before designing the interface.
π§ Quick Revision Questions
- What are the two main arguments for and against including GUI details in the SRS document?
- What are the three pitfalls of using GUIs in functional specifications as described in the lecture?
- In the delete component example, what two major mistakes were made in the initial GUI designs?
- What is a prototype, and when is prototyping most useful according to the lecture?
- Why is it easier for users to interact with a prototype than to read an SRS document?