• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Software Testing and UML Lab

Software Testing and UML Lab



This is the lab work of UML lab and Software Testing Lab at RTU, Kota

This is the lab work of UML lab and Software Testing Lab at RTU, Kota



Total Views
Views on SlideShare
Embed Views



2 Embeds 13

http://www.slashdocs.com 9
http://www.docshut.com 4


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Software Testing and UML Lab Software Testing and UML Lab Document Transcript

    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur ABSTRACT Admission Process Management SystemAdmission Process management system is computerized and convenient system. Since, thepresent system is manual all the work is done in papers and ink by hand so it is much costlyand difficult to use and to operate and it is also time consuming. So our automatedcomputerized student admission process management system is much feasible, in cost, time,and efforts as compare to the previous manual system. It is economically feasible, it will only require a single operator to operate thesystem, who is responsible for entering the data into the database via a user interfaceprovided to him, who can also able to show all the data in html tabular form so to provideinformation regarding the students who are either taken admission or to take admission, sinceit requires only a single person to operate the whole system thus reduces the cost to operatethe system. It is technically feasible, since the whole system is designed into the latesttechnologies like ASP.NET and MS Access and SQL Server which are the most recenttechnologies to develop web based systems and design databases.It uses the latest hardware technologies like P4 Systems so easy to operate. It is Behavioralfeasible, since the system is providing a attractive user interface to the operator/end user, sohe feel very easy to work onto it. Response to operator/end user is very fast and very good.Since, as we mentioned above that it requires much less amount of cost, it uses computerwork so it is very fast to operate and it is very easy for user to work on it. 1
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur1. Lab Objective • What is UML • Why the UML is necessary • How to represent UML components in diagrams2. Tool used • EDRAW 53. Lab Description The Unified Modeling Language (UML) is a visual modeling language that enablessystem builders to create blueprints that capture their visions in a standard, easy-to-understandway, and provides a mechanism to effectively share and communicate these visions with others.The purpose of the diagrams is to- 1. Present multiple views of a system; 2. This set of multiple views is called a model. 3. UML model describes what a system is supposed to do. 4. It doesn’t tell how to implement the system.The Major nine Diagrams are: 1. Class Diagram 2. Object Diagram 3. Use Case 4. Sequence 5. Collaboration 6. State Chart 7. Activity 8. Component 9. Deployment 2
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Class Diagram – The UML Class diagram is a graphical notation used to construct and visualize objectoriented systems.A UML class diagram is made up of: o A set of classes and o A set of relationships between classesA class with three sections. • The upper part holds the name of the class • The middle part contains the attributes of the class • The bottom part gives the methods or operations the class can take or undertakeWhat is a class? A class in an object oriented system provides a crisp abstraction of a well defined set ofresponsibilities. The class diagram is the main building block in object oriented modelling. It isused both for general conceptual modelling of the systematics of the application, and for detailedmodelling translating the models into programming code. The classes in a class diagramrepresent both the main objects and or interactions in the application and the objects to beprogrammed A class is a category or group of things that have the same attributes and the samebehaviors. A rectangle is the icon that represents the class. It’s divided into three areas Theuppermost area contains the name, the middle area holds the attributes, and the lowest area holdsthe operations. i.e. Anything in the class of washing machines has attributes such as brand name,model, serial number, and capacity. Behaviors for things in this class include the operations“accept clothes,” “accept detergent,” “turn on,” and “turn off.”A class consists of three parts: Class Name: • The name of the class appears in the first partition. Class Attributes: • Attributes are shown in the second partition. • The attribute type is shown after the colon. • Attributes map onto member variables (data members) • in code. 3
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Class Operations (Methods): • Operations are shown in the third partition. They are services the class provides. • The return type of a method is shown after the colon at the end of the method signature. • The return type of method parameters are shown after the colon following the parameter name. • Operations map onto class methods in codeVisibility and Access for attributes and operations of a classThe +, - and # symbols before an attribute and operation name in a class denote the visibility ofthe attribute and operation. + denotes public attributes or operations - denotes private attributes or operations # denotes protected attributes or operationsWe can observe that • attribute1 and op1 of MyClassName are public • attribute3 and op3 are protected. • attribute2 and op2 are private.Relationships between classes A Link is the basic relationship among objects. It is represented as a line connecting twoor more object boxes. It can be shown on an object diagram or class diagram. A link is aninstance of an association. In other words, it creates a relationship between two classes.A class may be involved in one or more relationships with other classes.Inheritance (or Generalization)• Represents an “is-a” relationship.• An abstract class name is shown in italics.• SubClass1 and SubClass2 are specializations of SuperClass. 4
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurAssociation An association represents a family of links. Binary associations (with two ends) arenormally represented as a line, with each end connected to a class box. Higher order associationscan be drawn with more than two ends. In such cases, the ends are connected to a centraldiamond.An association can be named, and the ends of an association can be adorned with rolenames, ownership indicators, multiplicity, visibility, and other properties.• Simple association: o A structural link between two peer classes. o There is an association between Class1 and Class2• Aggregation: Aggregation is a variant of the "has a" or association relationship; aggregation ismore specific than association. It is an association that represents a part-whole or part-ofrelationship. As a type of association, an aggregation can be named and have the sameadornments that an association can. However, an aggregation may not involve more than twoclasses.Aggregation can occur when a class is a collection or container of other classes, but where thecontained classes do not have a strong life cycle dependency on the container—essentially, if thecontainer is destroyed, its contents are not.A special type of association. It represents a “part-of” relationship. o Class2 is part of Class1. o Many instances (denoted by the *) of Class2 can be associated with Class1. o Objects of Class1 and Class2 have separate lifetimes 5
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur• Composition: A special type of aggregation where parts are destroyed when the whole isdestroyed. Class diagram showing Composition between two classes at top and Aggregationbetween two classes at bottom Composition is a stronger variant of the "owns a" or associationrelationship; composition is more specific than aggregation.Composition usually has a strong life cycle dependency between instances of the container classand instances of the contained class(es): If the container is destroyed, normally every instancethat it contains is destroyed as well. (Note that a part can (where allowed) be removed from acomposite before the composite is deleted, and thus not be deleted as part of the composite.) o Objects of Class2 live and die with Class1. o Class2 cannot stand by itself.Differences between Composition and AggregationWhen attempting to represent real-world whole-part relationships, e.g., an engine is part of a car,the composition relationship is most appropriate. However, when representing a software ordatabase relationship, e.g., car model engine ENG01 is part of a car model CM01, an aggregationrelationship is best, as the engine, ENG01 may be also part of a different car model. Thus theaggregation relationship is often called "catalog" containment to distinguish it fromcompositions "physical" containment.• Dependency: o Exists between two classes if changes to the definition of one may cause changes to the other (but not the other way around). o Class1 depends on Class2 6
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurClass Level Relationships • Generalization Class diagram showing generalization between one superclass and two subclasses TheGeneralization relationship ("is a") indicates that one of the two related classes (the subclass) isconsidered to be a specialized form of the other (the super type) and superclass is considered asGeneralization of subclass. In practice, this means that any instance of the subtype is also aninstance of the superclass.An exemplary tree of generalizations of this form is found in binomial nomenclature: humanbeings are a subclass of simian, which are a subclass of mammal, and so on. The relationship ismost easily understood by the phrase an A is a B (a human is a mammal, a mammal is ananimal).The UML graphical representation of a Generalization is a hollow triangle shape on thesuperclass end of the line (or tree of lines) that connects it to one or more subtypes.The generalization relationship is also known as the inheritance or "is a" relationship.The superclass in the generalization relationship is also known as the "parent", superclass, baseclass, or base type.The subtype in the specialization relationship is also known as the "child", subclass, derivedclass, derived type, inheriting class, or inheriting type.Note that this relationship bears no resemblance to the biological parent/child relationship: theuse of these terms is extremely common, but can be misleading. Generalization-Specialization relationship A is a type of B E. g. "an oak is a type of tree", "an automobile is a type of vehicle" • Realization In UML modeling, a realization relationship is a relationship between two modelelements, in which one model element (the client) realizes (implements or executes) the behaviorthat the other model element (the supplier) specifies. A realization is indicated by a dashed linewith an unfilled arrowhead towards the supplier.Realizations can only be shown on class or component diagrams.A realization is a relationship between classes, interfaces, components, and packages thatconnects a client element with a supplier element. A realization relationship between classes andinterfaces and between components and interfaces shows that the class realizes the operationsoffered by the interface. 7
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurClass Stereotype Descriptions Each class is associated with a stereotype that classifies it into one of three types. A shortdescription of the three stereotypes is given below. A control class represents the persistent information in a system. A Control class modelsthe coordination and monitor main sequencing of other objects in the system.Control classeshandle the flow of control for a use-case and can therefore be seen as co-ordinatingrepresentation classes. These do not do everything in the use case, but co-ordinate with otherclasses that can do the work for them. A Boundary classes are responsible for communication with the user & Actor or externalsystems.A Boundary class represents the interaction between a system and the external worldnamely consisting of users and other external systems. They are identified by each actor–use-case pair on the systems use-case diagram, with one and only one boundary class existing foreach pair A Entity classes model coordination and sequencing of other objects in the system.Entity classes model the information handled by the system, and sometimes the behaviourassociated with the information. They should not be identified as database tables or other data-stores.An entity class represent the persistent information in a system. 8
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur 9
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Object Diagram - An object is an instance of a class—a specific thing that has specific values of theclass’s attributes. The icon is a rectangle, just like the class icon, but the name is underlined. InThe name of the instance begins with a lowercase letter. It’s also possible to have an anonymousobject, as the icon on the right of Figure shows. This just means that you don’t supply a specificname for the object, although you do show the class it belongs to. Use Case Diagram – In many design processes, the use case diagram is the first that designers will work withwhen starting a project. This diagram allows for the specification of high level user goals thatthe system must carry out. These goals are not necessarily tasks or actions, but can be moregeneral required functionality of the system. A use case is a description of a system’s behavior from a user’s standpoint. For systemdevelopers, the use case is a valuable tool: It’s a tried-and-true technique for gathering systemrequirements from a user’s point of view. Obtaining information from the user’s point of view isimportant if the goal is to build a system that real people can use.Use Case More formally, a use case is made up of a set of scenarios. Each scenario is a sequenceof steps that encompass an interaction between a user and a system. The use case bringsscenarios together that accomplish a specific goal of the user.A use case can be specified by textually describing the steps required and any alternative actionsat each step. For example, the use case for searching a web for a keyword might be shown as:1. Customer enters the keyword2. Customer clicks the search button3. The search is executed4. The results are shownAlternative: Search FailedIf the search fails at 3, then the user is redirected back to the search screen at step 1 10
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur In Visual Case, you can specify the steps of a use case in its description field. Simplyright-click on a use case and select properties. You can then run a report and print or export theresults to html or ascii text. Together, the report and the diagrams will include all of the detailsof the use case - their specific scenarios and the actors that carry them out.Actor The use case diagram allows a designer to graphically show these use cases and theactors that use them. An actor is a role that a user plays in the system. It is important todistinguish between a user and an actor (better thought of as a role). A user of the system mayplay several different roles through the course of his, her or its job (since an actor may be anothersystem). Examples of actors are salesperson, manager, support person, and web store system. Itis possible that the same person may be a sales person and also provide support. When creatinga use case model, we are not concerned with the individuals, only the roles that they play.Associations On a use case diagram, associations are drawn between actors and use cases to show thatan actor carries out a use case. A use case can be carried out by many actors and an actor maycarry out many use cases. In the above diagram, the actors are shown as the green stick figure shapes on the left, theuse cases are the blue ellipses, and the associations between them are represented by theconnecting lines. The developer and the stakeholder both are responsible for specifying thesystem roles, but only the developer creates the model.Includes Use cases can also be related to each other with three different links. The diagram belowshows the use of the includes link. Both invoice purchase and online purchase include thescenarios defined by purchase valuation. In general, the includes link is to avoid repetition ofscenarios in multiple use cases. 11
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurGeneralization When a use case describes a variation on another use case, use a generalization link. Inthe example below, the use case limit exceeded describes a situation in which the usual scenarioof online purchase is not performed. Use cases that generalize another use case should onlyspecify an alternative, even exceptional, scenario to the use case being generalized. The overallgoal of the use cases should be the same.Extends In some instances you want to describe a variation on behaviour in a more controlledform. In such instances you can define extension points in the extended use case. In theexample below, search by name is said to extend search at the name extension point. Theextends link is more controlled than the generalization link in that functionality can only beadded at the extension points.Putting it all Together When starting a use case model, it is very important to keep it simple. Often it is easiestto first determine the actors of the system, and then flush out the use cases that they perform.Your use case diagrams can be as simple or complex as you wish, however simpler, lesscluttered diagrams are easier to understand, and are often more powerful in capturing the tasks ofthe system.In Visual Case, you can explode a use case into a new use case diagram. For example, the usecase online purchase may require further specification as you move into the design. You cancreate a sub-diagram within any use case to help clarify and understand the tasks involved.Remember that a use case represents a goal of a user, not an atomic programming operation.Your use case design should be simple and help to clarify the users goals and expectations forthe system. 12
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Use Case Diagram Sequence Diagram – Class and object diagrams are static model views. Interaction diagrams are dynamic.They describe how objects collaborate. UML sequence diagrams are used to represent or model the flow of messages, events andactions between the objects or components of a system. Time is represented in the verticaldirection showing the sequence of interactions of the header elements, which are displayedhorizontally at the top of the diagram. Sequence Diagrams are used primarily to design, document and validate the architecture,interfaces and logic of the system by describing the sequence of actions that need to beperformed to complete a task or scenario. UML sequence diagrams are useful design toolsbecause they provide a dynamic view of the system behavior which can be difficult to extractfrom static diagrams or specifications. 13
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurAlthough UML sequence diagrams are typically used to describe object-oriented softwaresystems, they are also extremely useful as system engineering tools to design systemarchitectures, in business process engineering as process flowdiagrams, as message sequencecharts and call flows for telecom/wireless system design, and for protocol stack design andanalysis. A sequence diagram is an interaction diagram that details how operations are carried out-- what messages are sent and when. Sequence diagrams are organized according to time. Thetime progresses as you go down the page. The objects involved in the operation are listed fromleft to right according to when they take part in the message sequence. Objects interact with one another, and these interactions occur over time. The UMLsequence diagram shows the time-based dynamics of the interactionSequence Diagram Header Elements The header portion of the sequence diagram represents the components or objects of thesystem being modeled and are laid out horizontally at the top of the diagram. See an examplesequence diagram here. 14
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur 15
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurUse case elaboration. Usage scenarios describe a way the system may be used by its actors. The UML sequencediagram can be used to flesh out the details of one or more use cases by illustrating visually howthe system will behave in a particular scenario. The use cases along with their correspondingsequence diagrams describe the expected behavior of the system and form a strong foundationfor the development of system architectures with robust interfaces.Distributed & web-based systems. When a system consists of distributed components (such as a client communicating withone or more servers over the Internet), sequence diagrams can be used to document and validatethe architecture, interfaces and logic of each of these components for a set of usagescenarios.Complex logic. UML sequence diagrams are often used to model the logic of a complex feature byshowing the interactions between the various objects thatcollaborate to implement each scenario. Modeling multiple scenarios showing different aspects ofthe feature helps developers take into account special cases during implementation.State machines. Sequence diagram editor makes it so easy to edit your sequence diagrams that you couldeven make the corrections in real time during the meeting and instantly see the result of thechanges as you make them.Complex interactions between components. Sequence diagrams are often used to design the interactions between components of asystem that need to work together to accomplish a task. They are particularly useful when thecomponents are being developed in parallel by different teams (typical in wireless and telephony 16
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipursystems) because they support the design of robust interfaces that cover multiple scenarios andspecial cases.Collaboration tool- Sequence diagrams are valuable collaboration tools during design meetings because theyallow you to discuss the design in concrete terms. You can see the interactions between entities,various proposed state transitions and alternate courses/special cases on paper as you discuss thedesign. Sequence diagram editor makes it so easy to edit your sequence diagrams that you couldeven make the corrections in real time during the meeting and instantly see the result of thechanges as you make them. 17
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurDocumentation- Sequence diagrams can be used to document the dynamic view of the system design atvarious levels of abstraction, which is often difficult to extract from static diagrams or even thecomplete source code. The diagrams can abstract much of the implementation detail and providea high level view of system behavior. Collaboration Diagrams Class and object diagrams are static model views. Interaction diagrams are dynamic.They describe how objects collaborate. With interaction diagram, we introduce the notion oftime. Collaboration diagrams represent objects in a system an their associations. Collaborationdiagrams show a sequence of activities between specific items. This is where one shows themessages or actions that can be performed on the classes--and which other classes or usersperform them. Also, collaboration diagrams show an example sequence between specific actions.Each occurrence of a specific class may be labled with a nameThey are composed of three elements:o Objectso Associationso MessagesObject Interaction diagrams depict dynamic, run-time behavior• communication between objects via messages• sequence of transactions in a dialog between a user and a system• one trace of behavior is ideally one use caseBoth diagrams are illustrate interaction.• Sequence is used to illustrate temporal interactions.• Collaboration is better suited to display the association between the objects.• Given enough information, a sequence diagram can be converted into a collaboration diagrams (and vice-versa).Collaboration Diagram Semantics -o Member of the Behavioural Group of diagrams as well as Sequence, Statechart, and Activity diagramso Behavioural description includes static - structural description on the participants dynamic - description on the execution of the actionso Collaboration set of participants and interactions which are meaningful in a c ontexto Purpose models the exchange of messages between objects to achieve somethingo Can be attached to: 18
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur operation or use case classo Parameterised collaboration can be reused & can assist in defining the structural aspects of a design patternCollaboration Diagram Notation -o Represents a Collaboration and Interactiono Collaboration set of objects and their interactions in a specific contexto Interaction set of messages exchanged in a collaboration to produce a desired resulto Objects rectangles containing the object signature object signature: object name : object Classo object name (optional) – starts with lowercase lettero class name (mandatory) – starts with uppercase letter objects connected by lines user (stick man) can appearo Messages are labelled like C and Java function callso followed by round brackets, and can have parameters and return values are followed by an arrow to show direction internal messages are numbered, starting from 1Collaboration Diagram Issues -o Message Signature guardo condition applied to the message in square brackets at the start of the signature sequence numbero numbers separated by dots, ending in a colon return valueo name followed by := operation name argument listo names separated by commas, within round bracketso Types of message flows synchronous, asynchronous, simpleo Multiplicity of objects how can messages sent to a multiplicity (e.g., an array) of objects beCommunication Diagram - Both the sequence diagram and the communication diagram show interactions amongobjects. For this reason, the UML refers to them collectively as interaction diagrams. 19
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurEach arrow represents a message that goes from one object to another. Time, in this diagram,proceeds from top to bottom. So the first message is timeSoak (), which the timer sends to itself.The second message is sendWater (), which the timer sends to the water pipe. The final message,stopRotating (), goes from the timer to the drum. Activity Diagram Activity diagram is another important diagram in UML to describe dynamic aspects ofthe system.The activities that occur within a use case or within an object’s behavior typicallyoccur in a sequence is represented by the activity diagramActivity diagram is basically a flow chart to represent the flow form one activity to anotheractivity. The activity can be described as an operation of the system.So the control flow is drawnfrom one operation to another. This flow can be sequential, branched or concurrent. Activitydiagrams deals with all type of flow control by using different elements like fork, join etc.Purpose:The basic purposes of activity diagrams are similar to other four diagrams. It captures thedynamic behaviour of the system. Other four diagrams are used to show the message flow fromone object to another but activity diagram is used to show message flow from one activity toanother.Activity is a particular operation of the system. Activity diagrams are not only used forvisualizing dynamic nature of a system but they are also used to construct the executable systemby using forward and reverse engineering techniques. The only missing thing in activity diagramis the message part.It does not show any message flow from one activity to another. Activity diagram is some timeconsidered as the flow chart. Although the diagrams looks like a flow chart but it is not. It showsdifferent flow like parallel, branched, concurrent and single.So the purposes can be described as:• Draw the activity flow of a system.• Describe the sequence from one activity to another.• Describe the parallel, branched and concurrent flow of the system.How to draw Activity Diagram? Activity diagrams are mainly used as a flow chart consists of activities performed by thesystem. But activity diagram are not exactly a flow chart as they have some additionalcapabilities. These additional capabilities include branching, parallel flow, swimlane etc.The main element of an activity diagram is the activity itself. An activity is a function performedby the system. After identifying the activities we need to understand how they are associatedwith constraints and conditions.So before drawing an activity diagram we should identify the following elements: 20
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur • Activities • Association • Conditions • ConstraintsThe following is an example of an activity diagram for Admission Process management system.In the diagram four activities are identified which are associated with conditions. One importantpoint should be clearly understood that an activity diagram cannot be exactly matched with thecode. The activity diagram is made to understand the flow of activities and mainly used by thebusiness users.The following diagram is drawn with the four main activities:• Admission request by student• Receipt of the Application• Confirm Application• Dispatch order After receiving the order request condition checks are performed to check if itis normal or special order. After the type of order is identified dispatch activity is performed andthat is marked as the termination of the process.Where to use Activity Diagrams? The basic usage of activity diagram is similar to other four UML diagrams. The specificusage is to model the control flow from one activity to another. This control flow does notinclude messages.The activity diagram is suitable for modeling the activity flow of the system. An application canhave multiple systems. Activity diagram also captures these systems and describes flow from onesystem to another. This specific usage is not available in other diagrams. These systems can bedatabase, external queues or any other system.Now we will look into the practical applications of the activity diagram. From the abovediscussion it is clear that an activity diagram is drawn from a very high level. So it gives highlevel view of a system. This high level view is mainly for business users or any other person whois not a technical person. This diagram is used to model the activities which are nothing but business requirements.So the diagram has more impact on business understanding rather implementation details.Following are the main usages of activity diagram: • Modeling work flow by using activities. • Modeling business requirements. • High level understanding of the systems functionalities. • Investigate business requirements at a later stage. 21
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Statechart Diagram The name of the diagram itself clarifies the purpose of the diagram and other details. Itdescribes different states of a component in a system. The states are specific to acomponent/object of a system. A Statechart diagram describes a state machine. Now to clarify it state machine can bedefined as a machine which defines different states of an object and these states are controlled byexternal or internal events. Activity diagram explained in next chapter, is a special kind of a Statechart diagram. AsStatechart diagram defines states it is used to model lifetime of an object.Purpose: Statechart diagram is one of the five UML diagrams used to model dynamic nature of asystem. They define different states of an object during its lifetime. And these states are changedby events. So Statechart diagrams are useful to model reactive systems. Reactive systems can bedefined as a system that responds to external or internal events. Statechart diagram describes the flow of control from one state to another state. States aredefined as a condition in which an object exists and it changes when some event is triggered. So 22
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipurthe most important purpose of Statechart diagram is to model life time of an object from creationto termination.Statechart diagrams are also used for forward and reverse engineering of a system. But the mainpurpose is to model reactive system.Following are the main purposes of using Statechart diagrams: • To model dynamic aspect of a system. • To model life time of a reactive system. • To describe different states of an object during its life time. • Define a state machine to model states of an object.How to draw Statechart Diagram?Statechart diagram is used to describe the states of different objects in its life cycle. So theemphasis is given on the state changes upon some internal or external events. These states ofobjects are important to analyze and implement them accurately.Statechart diagrams are very important for describing the states. States can be identified as thecondition of objects when a particular event occurs.Before drawing a Statechart diagram we must have clarified the following points: • Identify important objects to be analyzed. • Identify the states. • Identify the events.A Statechart diagram where the state of Order object is analyzed. The first state is an idle statefrom where the process starts. The next states are arrived for events like send request, confirmrequest, and dispatch order. These events are responsible for state changes of order object. Theinitial and final state of an object is also shown below.Where to use Statechart Diagrams?From the above discussion we can define the practical applications of a Statechart diagram.Statechart diagrams are used to model dynamic aspect of a system like other four diagramsdisused in this tutorial. But it has some distinguishing characteristics for modeling dynamicnature.Statechart diagram defines the states of a component and these state changes are dynamic innature. So its specific purpose is to define state changes triggered by events. Events are internalor external factors influencing the system.Statechart diagrams are used to model states and also events operating on the system. Whenimplementing a system it is very important to clarify different states of an object during its lifetime and statechart diagrams are used for this purpose. When these states and events areidentified they are used to model it and these models are used during implementation of thesystem. 23
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurIf we look into the practical implementation of Statechart diagram then it is mainly used toanalyze the object states influenced by events. This analysis is helpful to understand the systembehaviour during its execution.So the main usages can be described as: • To model object states of a system. • To model reactive system. Reactive system consists of reactive objects. • To identify events responsible for state changes. • Forward and reverse engineering. At any given time, an object is in a particular state. This transition from one state to thenext state is represented by state diagram.i.e A person can be a newborn, infant, child,adolescent, teenager, or adult. An elevator is either moving or stationary. A washing machine canbe either in the soaking, washing, rinsing, spinning, or off state. The symbol at the top of thefigure represents the start state and the symbol at the bottom represents the end state. 24
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Component DiagramComponent diagram is a special kind of diagram in UML. The purpose is also different fromall other diagrams discussed so far. It does not describe the functionality of the system but itdescribes the components used to make those functionalities.So from that point component diagrams are used to visualize the physical components in asystem. These components are libraries, packages, files etc.Component diagrams can also be described as a static implementation view of a system.Static implementation represents the organization of the components at a particular moment.A single component diagram cannot represent the entire system but a collection of diagramsare used to represent the whole.So the purpose of the component diagram can be summarized as: • Visualize the components of a system. • Construct executables by using forward and reverse engineering. • Describe the organization and relationships of the components.How to draw Component Diagram?Component diagrams are used to describe the physical artifacts of a system. This artifactincludes files, executables, libraries etc.So the purpose of this diagram is different, Component diagrams are used during theimplementation phase of an application. But it is prepared well in advance to visualize theimplementation details.Initially the system is designed using different UML diagrams and then when the artifacts areready component diagrams are used to get an idea of the implementation.This diagram is very important because without it the application cannot be implementedefficiently. A well prepared component diagram is also important for other aspects likeapplication performance, maintenance etc.So before drawing a component diagram the following artifacts are to be identified clearly: • Files used in the system. • Libraries and other artifacts relevant to the application. • Relationships among the artifacts.Now after identifying the artifacts the following points needs to be followed: • Use a meaningful name to identify the component for which the diagram is to be drawn. • Prepare a mental layout before producing using tools. • Use notes for clarifying important points. 25
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurWhere to use Component Diagrams?We have already described that component diagrams are used to visualize the staticimplementation view of a system. Component diagrams are special type of UML diagramsused for different purposes.These diagrams show the physical components of a system. To clarify it, we can say thatcomponent diagrams describe the organization of the components in a system.Organization can be further described as the location of the components in a system. Thesecomponents are organized in a special way to meet the system requirements.As we have already discussed those components are libraries, files, executables etc. Nowbefore implementing the application these components are to be organized. This componentorganization is also designed separately as a part of project execution.Component diagrams are very important from implementation perspective. So theimplementation team of an application should have a proper knowledge of the componentdetails.Now the usage of component diagrams can be described as: • Model the components of a system. • Model database schema. • Model executables of an application. • Model systems source code. 26
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur Deployment DiagramOverview:Deployment diagrams are used to visualize the topology of the physical components of asystem where the software components are deployed.So deployment diagrams are used to describe the static deployment view of a system.Deployment diagrams consist of nodes and their relationships.Purpose:The name Deployment itself describes the purpose of the diagram. Deployment diagrams areused for describing the hardware components where software components are deployed.Component diagrams and deployment diagrams are closely related.Component diagrams are used to describe the components and deployment diagrams showshow they are deployed in hardware.UML is mainly designed to focus on software artifacts of a system. But these two diagramsare special diagrams used to focus on software components and hardware components.So most of the UML diagrams are used to handle logical components but deploymentdiagrams are made to focus on hardware topology of a system. Deployment diagrams areused by the system engineers.The purpose of deployment diagrams can be described as: • Visualize hardware topology of a system. • Describe the hardware components used to deploy software components. • Describe runtime processing nodes.How to draw Deployment Diagram?Deployment diagram represents the deployment view of a system. It is related to thecomponent diagram. Because the components are deployed using the deployment diagrams.A deployment diagram consists of nodes. Nodes are nothing but physical hardwares used todeploy the application.Deployment diagrams are useful for system engineers. An efficient deployment diagram isvery important because it controls the following parameters • Performance • Scalability • Maintainability • PortabilitySo before drawing a deployment diagram the following artifacts should be identified: 27
    • Harsh Kishore MishraB.Tech. IT, IIMET Jaipur • Nodes • Relationships among nodesThe following deployment diagram is a sample to give an idea of the deployment view oforder management system. Here we have shown nodes as: • Monitor • Modem • Caching server • ServerThe application is assumed to be a web based application which is deployed in a clusteredenvironment using server 1, server 2 and server 3. The user is connecting to the applicationusing internet. The control is flowing from the caching server to the clustered environment.So the following deployment diagram has been drawn considering all the points mentionedabove:Where to use Deployment Diagrams?Deployment diagrams are mainly used by system engineers. These diagrams are used todescribe the physical components (hardwares), their distribution and association.To clarify it in details we can visualize deployment diagrams as the hardwarecomponents/nodes on which software components reside. 28
    • Harsh Kishore MishraB.Tech. IT, IIMET JaipurSoftware applications are developed to model complex business processes. Only efficientsoftware applications are not sufficient to meet business requirements. Business requirementscan be described as to support increasing number of users, quick response time etc.To meet these types of requirements hardware components should be designed efficiently andin a cost effective way.Now a days software applications are very complex in nature. Software applications can bestand alone, web based, distributed, mainframe based and many more. So it is very importantto design the hardware components efficiently.So the usage of deployment diagrams can be described as follows: • To model the hardware topology of a system. • To model embedded system. • To model hardware details for a client/server system. • To model hardware details of a distributed application. • Forward and reverse engineeringComponent diagrams are different in terms of nature and behaviour. Component diagrams areused to model physical aspects of a system.Now the question is what are these physical aspects? Physical aspects are the elements likeexecutables, libraries, files, documents etc which resides in a node.So component diagrams are used to visualize the organization and relationships amongcomponents in a system. These diagrams are also used to make executable systems. 29