Problem Definition: Prepare SRS (functional and non-functional requirements), SA/SD document, UML Models for the TCC (Transport Company Computerization) software. Solution: This assignment does following things for TCC software. SRS (Functional and non-functional requirements) Structured Analysis/Structured Design UML Models : Use case diagrams, Class diagrams, Sequence diagrams and State-chart diagrams (whichever necessary) SRS The SRS will contain only functional and non-functional requirements for TCC software. Functional Requirements: R.1: Register consignment Description: When the consignment arrives, the details like volume, destination address, sender address etc. are entered and stored in database. Bill containing transport charges depending on volume and destination distance of the consignment will be issued. Input: The consignment details like volume, destination address, sender address etc. Output: Issued bill for the consignment having detail of transport charges depending on volume and distance of the consignment. A consignment number will also be generated. It will also generate number of trucks required for the consignment. R.2: Generate consignment dispatch slip Description: When numbers of trucks required for the consignment are available, the clerk will issue command for dispatch slip and then the software will print the slip. R.2.1: Select Generate dispatch option State: Main menu. Input: Generate dispatch slip option selection. Output: Prompt to enter the consignment number. R.2.2: Select consignment State: Generate dispatch slip option selected. Input: Consignment number. Output: Dispatch slip printing the consignment number, volume, sender s name and address, receiver s name and address. R.3: Manage statistics R.3.1: Display truck status
Description: The status of the truck asked for as the given time should be displayed. Input: Truck number, time. Output: Status of the truck at the given time. R.3.2: Display truck usage Description: The usage of the asked truck over given period of time should be displayed. Input: Truck number, time period. Output: Usage of the truck over given time period. R3.3: Display consignment status Description: Manager can query for particular consignment details and volume of consignments handled to particular destination and the revenue generated. R.3.3.1: Consignment status Input: Consignment number. Output: Status of the consignment. R.3.3.2: Consignment status over destination Input: Destination name. Output: Volume of consignments handled to given destination and the corresponding revenue generated. R.3.4: Display waiting/idle time Description: Average waiting period for different consignments should be displayed. Average idle time of the truck in the branch for a given period should be displayed. R.3.4.1 Display average waiting time for consignments Input: User selection. Output: Average waiting time for the consignments. R.3.4.2 Display average idle time for truck in the branch Input: Truck number, branch name, time period. Output: Average idle period of the truck in the branch for given period should be displayed. Non-functional requirements: Since the non-functional requirements of a system are related to aspects concerning maintainability, portability, usability, maximum number of concurrent users, timing and throughput etc. There are no non-functional requirements for the given problem.
This completes the SRS document for the TCC software. We will now look at structured analysis (SA) and structured design (SD) of TCC software. Structured Analysis Context diagram (Level 0 DFD) The context diagram shows the system as a whole. The various users of the system and the various data exchanges. Figure 1: Context diagram (Level 0 DFD) We will now expand the bubble in context diagram into more bubbles in level 1 DFD. Level 1 DFD Figure 2: Level 1 DFD As we can see in level 1 DFD, the main system has been divided into two major functions i.e. processing of consignments and then managing the statistics. This DFD (level 1) can further be expanded to level 2, in which the functions will be divided into more sub functions as shown below.
Level 2 DFD Figure 3: Level 2 DFD Data dictionary: Consignment request: consignment details, consignment number. Consignment response: bill, dispatch slip. Statistics request: truck status request, truck usage request, wait/idle time request, consignment status request. Statistics response: truck status response, truck usage response, wait/idle time response, consignment status response. Bill: transport charge. Dispatch slip: consignment number + consignment volume + senders name and address + receiver s name and address. Consignment details: consignment volume + destination address + sender address.
Consignment number: integer. Truck status request: truck number + time period. Truck usage request: truck number + time period. Wait/idle time request: truck number + branch name + time period. Consignment status request: consignment number. Truck status response: truck status report. Truck usage response: truck usage report. Wait/idle time response: statistics of trucks and consignment for wait/idle state. Consignment status response: consignment status report. Consignment volume: integer. Sender s name and address: string. Receiver s name and address: string. With this we have completed our structured analysis (SA). Now, we will go for structured design (SD). Looking at the level 1 DFD we can see that the inputs coming to the system in context diagram (level 0 DFD) are going to different bubbles in higher level DFD s. Hence we will have transaction analysis for the structured design (SD). Structured design Below is the structured chart (transaction analysis) for TCC software. Figure 4: Structured chart (Transaction analysis) Next we will be drawing UML models for the TCC software. Following diagrams are drawn for TCC software.
Class diagram Use case diagram Sequence diagram State chart diagram UML Models Use case diagram Figure 5: Use case diagram All the query related use cases are extending from manage statistics use case. Below is the text description of the use cases and the various scenarios. Text Description (Use case model)
U1: Register consignment. Using this use case, the clerk can register the consignment with given consignment details. Scenario 1: Mainline sequence 1. Clerk: select register consignment option 2. System: display prompt to enter consignment details 3. Clerk: enter the necessary details 4. System: display the generated consignment id and print bill U2: Generate dispatch slip. Using this use case, the clerk can generate dispatch slip when trucks are available which has to be sent with the consignment. Scenario 2: Mainline sequence 1. Clerk: select generate dispatch slip option 2. System: display prompt to enter consignment number 3. Clerk: enter necessary details 4. System: prints the dispatch slip for given consignment number Scenario 2: At step 4 of mainline sequence 4. System: Incorrect consignment number or the consignment is already dispatched. U3: Query truck status. Using this use case, the manager can see statistics related to trucks. Scenario 1: Mainline sequence 1. Manager: select truck status option 2. System: display prompt to enter truck number 3. Manager: enter necessary details 4. System: display statistics of the truck Scenario 2: at step 4 of mainline sequence 4. System: truck information not found U4: Query truck usage. Using this use case, the manager can see truck usage over a time period. Scenario 1: Mainline sequence 1. Manager: select truck usage option 2. System: display prompt to enter truck number, time period 3. Manager: enter necessary details 4. System: display usage of the truck over given time period Scenario 2: at step 4 of mainline sequence 4. System: truck information not found U5: Query wait/idle time. Using this use case, the manager can see waiting time for consignments and idle time for trucks. Scenario 1: Mainline sequence 1. Manager: select wait/idle statistics option
2. System: display prompt to enter truck number, time period 3. Manager: enter necessary details 4. System: display waiting time for consignments, idle time for trucks Scenario 2: At line 4 of mainline sequence 4. System: truck number not found U6: Query consignment status. Using this use case, the manager can see consignment details and volume of consignments handled to particular destination and the corresponding revenue generated Scenario 1: Mainline sequence 1. Manager: select consignment status option 2. System: display prompt to enter consignment number, destination name 3. Manager: enter necessary details 4. System: display the consignment details over given destination along with revenue generated Scenario 2: At line 4 of mainline sequence 4. System: consignment number not found or given consignment number do not exists for given destination Class diagram Figure 6: Class diagram As seem in the diagram Truck and Consignment represent basic classes having all the information needed by other classes. The methods in these classes are just getters and setters for the various attributes. The object stores are represented by classes TruckRegister and ConsignmentRegister
which contain the Truck and Consignment objects respectively. These stores are used by other two classes ConsignmentProcessor and StatisticsGenerator. Sequence diagram We will have 6 sequence diagrams, each for one use case in the use case model. Sequence diagram 1: Registering consignment TCC Boundary represents the UI which is used by user to feed the input to the TCC software. The consignment object is created when there is request for adding new consignment from Consignment processor, hence the position of Consignment object at below level than other objects Figure 7: Sequence diagram for use case 1 Sequence diagram 2: Generate dispatch slip While generating the dispatch slip, first the given consignment is searched in the Consignment Register. If it is not found error message is shown to user. If found the consignment information is taken from Consignment Register and the dispatch slip is generated.
Figure 8: Sequence diagram for use case 2 Sequence diagram 3: Query truck status The behaviour is exactly similar to sequence diagram 2. Figure 9: Sequence diagram for use case 3
Sequence diagram 4: Query truck usage This sequence diagram is similar in behaviour to sequence diagram 2 and 3. Figure 10: Sequence diagram for use case 4 Sequence diagram 5: Query wait/idle time In this sequence diagram for computing waiting time for consignments and idle time for trucks, we search Truck Register for truck, if not found error is flagged to the user. Similarly Consignment Register is searched for consignments. From these two the wait/idle statistics is computed and reported to the user via Boundary.
Figure 11: Sequence diagram for use case 5 Sequence diagram 6: Query consignment status Figure 12: Sequence diagram for use case 6
State chart diagram In state chart diagram we will model the Consignment object. The other objects are having simple states hence we will not model them using state chart diagram. Figure 13: State chart diagram for a consignment object