3 System Modeling And Design

Software Engineering · Unit 3

System Modeling and Design

Exam-focused notes for System Modeling and Design (Software Engineering, BIT302): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

System Modeling and Design in short

System modeling means building abstract views of a system using diagrams. Models help engineers understand, discuss and design a system before they build it.

System Modeling and Design: notes

Structural models and dynamic models

A model is a simplified view of a system that leaves out detail. Different models show different views.

Structural models show the organization of a system in terms of its parts and how they are related. Examples are class diagrams and component diagrams. They show what the system is made of.

Dynamic models show how the system behaves while it runs and how it responds to events. Examples are sequence diagrams, activity diagrams and state diagrams.

Structural modelDynamic model
Shows static designShows behaviour over time
Classes, objects, relationsMessages, events, states
Class and component diagramSequence, activity, state diagram
Answers "what is there?"Answers "what happens?"

Other models are the context model (system boundary), interaction model (how users and parts exchange messages), and behavioural model (data-driven or event-driven).

Data-driven modeling

In data-driven modeling, the system is shown as a series of processing steps that change input data into output. It follows the data from the moment it enters the system until it leaves.

The usual tool is the data flow diagram (DFD). It has four symbols:

  • Process: a step that changes data.
  • Data store: a place where data rests, such as a database.
  • External entity: a source or sink outside the system.
  • Data flow: an arrow that carries data.

Example for an order system: the customer (entity) sends an order (flow) to the process "Check stock". It reads the stock (data store) and then sends confirmation back.

Data-driven models suit business systems that process batches of data, such as payroll. They are easy for customers to follow. Activity diagrams in UML can also show data-driven flow.

What this unit covers

  • Structural models and dynamic models
  • Data-driven modeling
  • Event-driven modeling
  • UML diagrams and aggregation
  • Use case diagrams
  • Class diagrams
  • Sequence diagrams

UML diagrams and aggregation

2082 · 10 marks

Develop use case diagram, class diagram, and sequence diagram of online entrance examination system. Make necessary assumptions.[10]

Show solved answer

Online Entrance Examination System - UML Diagrams

Note: No specific reference notes were found for this topic. The following answer is based on standard UML modeling principles as taught in Software Engineering courses for BSc CSIT, Tribhuvan University.


Assumptions Made

  1. The system allows students to register, log in, and attempt an online entrance exam.
  2. An admin manages questions, sets exam schedules, and views results.
  3. The system auto-evaluates answers and generates results.
  4. An examiner/teacher can add and manage questions.
  5. The exam has a timer; the system auto-submits when time expires.

1. Use Case Diagram

Actors

ActorRole
StudentRegisters, logs in, takes exam, views result
AdminManages users, schedules exam, views reports
ExaminerAdds/manages questions
System (Timer)Auto-submits exam on timeout

Use Cases

+---------------------------------------------------------------+
|           Online Entrance Examination System                  |
|                                                               |
|   [Register]          [Login]         [Logout]               |
|                                                               |
|   [View Exam Schedule]   [Start Exam]   [Answer Questions]   |
|                                                               |
|   [Submit Exam]       [View Result]   [View Scorecard]       |
|                                                               |
|   [Add Questions]     [Edit Questions] [Delete Questions]    |
|                                                               |
|   [Schedule Exam]     [Manage Users]  [Generate Report]      |
|                                                               |
|   [Auto Submit] (System/Timer)                               |
+---------------------------------------------------------------+

Student -----> Register
Student -----> Login
Student -----> View Exam Schedule
Student -----> Start Exam
Student -----> Answer Questions
Student -----> Submit Exam
Student -----> View Result
Student -----> View Scorecard

Examiner ----> Login
Examiner ----> Add Questions
Examiner ----> Edit Questions
Examiner ----> Delete Questions

Admin -------> Login
Admin -------> Schedule Exam
Admin -------> Manage Users
Admin -------> Generate Report
Admin -------> View Result

System ------> Auto Submit  <<extends>> Submit Exam

Submit Exam <<includes>> Evaluate Answers
Start Exam  <<includes>> Load Questions

Relationships Summary

  • Start Exam includes Load Questions
  • Submit Exam includes Evaluate Answers
  • Auto Submit extends Submit Exam (triggered when timer expires)
  • View Scorecard extends View Result

2. Class Diagram

+------------------+        +---------------------+
|      User        |        |       Exam          |
+------------------+        +---------------------+
| - userID: int    |        | - examID: int       |
| - name: String   |        | - title: String     |
| - email: String  |        | - duration: int     |
| - password: String|       | - totalMarks: int   |
| - role: String   |        | - scheduleDate: Date|
+------------------+        | - status: String    |
| + login()        |        +---------------------+
| + logout()       |        | + startExam()       |
| + register()     |        | + endExam()         |
+------------------+        | + getQuestions()    |
        |                   +---------------------+
        |                           |
   _____|_____               _______|_______
  |           |             |               |
+-------+ +--------+  +----------+   +-----------+
|Student| | Admin  |  | Question |   |  Result   |
+-------+ +--------+  +----------+   +-----------+
|-stuID | |-adminID|  |-quesID   |   |-resultID  |
|-grade | |-dept   |  |-quesText |   |-stuID     |
+-------+ +--------+  |-options[]|   |-examID    |
|+takeExam()|+scheduleExam()|correctAns||-score  |
|+viewResult()|+manageUser()|+getAnswer()|+grade |
+-------+ +--------+  +----------+   +-----------+
                                            |
                       +--------------------+
                       |   ExamAttempt      |
                       +--------------------+
                       | - attemptID: int   |
                       | - stuID: int       |
                       | - examID: int      |
                       | - startTime: Time  |
                       | - endTime: Time    |
                       | - answers[]: String|
                       +--------------------+
                       | + submitAnswers()  |
                       | + calculateScore() |
                       | + autoSubmit()     |
                       +--------------------+

Relationships

RelationshipDescription
User is parent of Student and AdminGeneralization
Student takes ExamAssociation (many-to-many)
Exam contains QuestionComposition (1 to many)
ExamAttempt links Student and ExamAssociation class
ExamAttempt generates ResultDependency

3. Sequence Diagram

Scenario: Student Takes and Submits an Exam

Student      LoginPage     ExamController    QuestionDB     Timer      ResultModule
   |              |               |               |            |             |
   |--login()---->|               |               |            |             |
   |              |--authenticate()|              |            |             |
   |              |<--success-----|               |            |             |
   |<--dashboard--|               |               |            |             |
   |              |               |               |            |             |
   |--startExam()->              |               |            |             |
   |              |--loadExam()-->|               |            |             |
   |              |               |--getQuestions()->          |             |
   |              |               |<--questionSet-|            |             |
   |              |               |--startTimer()------------->|             |
   |<---------questions displayed--|               |            |             |
   |              |               |               |            |             |
   |--answerQuestion()------------>|               |            |             |
   |              |               |--saveAnswer()->|            |             |
   |              |               |               |            |             |
   |              |               |<---timeExpired-------------|             |
   |              |               |--autoSubmit() |            |             |
   |--submitExam()---------------->|               |            |             |
   |              |               |--calculateScore()--------------------->|
   |              |               |<--score--------------------------------|
   |<---------result displayed-----|               |            |             |
   |              |               |               |            |             |

Reading the diagram: time runs downward, each vertical line is the lifetime of one object, and each horizontal arrow is a message. The student logs in through the login page, the exam controller loads the exam and pulls the question set from the question database, the timer is started, and answers are saved as they are given. Whichever happens first, the student submitting or the timer expiring, ends the attempt: autoSubmit() covers the timeout case, which is why the timer has its own lifeline. The result module then scores the attempt and the score is returned to the student.


Conclusion

The three diagrams describe the same online entrance examination system from three angles. The use case diagram is the behavioural outside view and fixes what the Student and the Admin can ask the system to do, the class diagram is the structural view and fixes the classes User, Student, Admin, Exam, Question, ExamAttempt and Result with their attributes, operations and relationships, and the sequence diagram is the interaction view and fixes the order in which those objects exchange messages while one exam is taken. Together they cover requirements, structure and behaviour, which is why UML models are normally drawn as a set rather than singly.

Open this answer on its own page →

Sequence diagrams

2081 · 5 marks

Draw sequence diagram for online food ordering system where the user can choose foods of various restaurants and pay online. The system also provides discount of 10% if the total amount paid is more than Rs. 3000. The user if cancels the order within 30 minutes will be approved else the paid amount will not be refunded. [5]

Participant Role ------ User Initiates order, payment, and cancellation WebSystem Front-end interface / controller RestaurantDB Stores restaurant and food item data OrderSystem Manages order creation and processing PaymentGateway Handles online payment and refund --- --- --- Step Interaction ----...

Open this answer on its own page →

Use case diagrams

2080 · 5 marks

Draw use case diagram for online voting system where the students can vote for their favorite teachers based on their performance. The teachers will be notified by the system about their status based on their votes. The system will generate the class routine by selecting teachers with respect to their votes. The routine will be sent to director, admin department, teachers, students and parents. [5]

Actor Role ------------- Student Casts vote for favorite teacher Teacher Receives notification about vote status System Generates routine, sends notifications Director Receives generated routine Admin Department Receives generated routine Parents Receives generated routine --- --- --- Use Case Ac...

Open this answer on its own page →

Event-driven modeling

2079 · 10 marks

Describe event driven modeling. Explain the concept of event driven modeling with an example of your own.[10]

Event-driven modeling is a system modeling approach that describes how a system responds to external and internal events (stimuli) by transitioning between different states. It focuses on what happens when an event occurs rather than on how data flows through the system. This approach is especial...

Open this answer on its own page →

Structural models and dynamic models

2079 · 5 marks

Differentiate between structural model and dynamic model. Explain aggregation in UML. [5]

Note: Reference notes were not available for this topic. The following answer is based on standard Software Engineering and UML concepts as taught in BSc CSIT curriculum. --- Aspect Structural Model Dynamic Model --------- Definition Represents the static structure of a system showing components ...

Open this answer on its own page →

Class diagrams

2079 · 5 marks

Draw Class diagram for online voting system where user can vote the candidates. The system also generates the final result with respective vote counts as well. The user has to register and will be eligible only after proper validation. [5]

Show solved answer

Class Diagram for Online Voting System

Description of Classes and Relationships

The following class diagram represents an Online Voting System with registration, validation, voting, and result generation functionalities.


Class Diagram (UML Notation)

+------------------+          +----------------------+
|      User        |          |    Registration      |
+------------------+          +----------------------+
| - userId: int    |1       1 | - regId: int         |
| - name: String   |----------| - email: String      |
| - email: String  |          | - password: String   |
| - password: String|         | - status: String     |
| - isEligible: bool|         +----------------------+
+------------------+          | + register(): void   |
| + login(): bool  |          | + validate(): bool   |
| + logout(): void |          | + getStatus(): String|
| + viewResult():void|        +----------------------+
+------------------+
        |
        | 1
        |
        | (after validation)
        |
        | *
+------------------+          +------------------+
|      Vote        |          |    Candidate     |
+------------------+          +------------------+
| - voteId: int    |  *     1 | - candidateId:int|
| - userId: int    |----------| - name: String   |
| - candidateId:int|          | - party: String  |
| - voteTime:DateTime         | - voteCount: int |
+------------------+          +------------------+
| + castVote():bool|          | + getVoteCount() |
| + confirmVote()  |          |     : int        |
+------------------+          | + updateCount()  |
        |                     |     : void       |
        |                     +------------------+
        |                            |
        |                            | 1
        |                            |
        | *                          | *
+------------------+          +------------------+
|   Validation     |          |     Result       |
+------------------+          +------------------+
| - validationId   |          | - resultId: int  |
| - userId: int    |          | - candidateId:int|
| - isVerified:bool|          | - totalVotes: int|
+------------------+          | - rank: int      |
| + checkEligibility|         +------------------+
|     (): bool     |          | + generateResult()|
| + verifyUser()   |          |     : void       |
|     : bool       |          | + displayResult()|
+------------------+          |     : void       |
                              | + getWinner()    |
                              |     : Candidate  |
                              +------------------+

Relationships Summary

RelationshipTypeMultiplicityDescription
User -- RegistrationAssociation1 to 1Each user must register once
Registration -- ValidationDependency1 to 1Registration triggers validation
User -- VoteAssociation1 to *A user can cast one or more votes (one per election)
Vote -- CandidateAssociation* to 1Many votes belong to one candidate
Candidate -- ResultAssociation1 to *Each candidate has result entries

Key Design Points

  1. User registers through the Registration class and is validated before being marked eligible (isEligible = true).
  2. Validation class checks user credentials and eligibility before allowing voting.
  3. Vote class records each vote with timestamp, linking user and candidate.
  4. Candidate maintains a running voteCount updated on each vote.
  5. Result class aggregates all votes and generates the final result with rankings and total vote counts.
Open this answer on its own page →

0 · 5 marks

Draw a class diagram for online movie management system where the customer after registering in the system can book the ticket according to the date, hall number, seat number and movie name. The payment has to be made online. Customer will get e-ticket after payment. The customer can also rank the movie after watching in the system. [5]

Below is the textual description followed by the UML class diagram representation. --- --- Relationship Type Multiplicity --------- Customer -- Registration Association 1 to 1 Customer -- Booking Association 1 to many () Booking -- Movie Association many () to 1 Booking -- Payment Association 1 t...

Open this answer on its own page →

Data-driven modeling

0 · 10 marks

Explain data driven modeling and event driven modeling with an example of your own.[10]

Note: No specific reference notes were found for this topic. The following answer is based on standard Software Engineering curriculum as taught in BSc CSIT (Tribhuvan University), aligned with typical textbook coverage of system modeling approaches. --- Data Driven Modeling (also called Data Flo...

Open this answer on its own page →