Vous êtes sur la page 1sur 17

UML Documentation

for

<Project>
Version 1.0 approved

Prepared by <author 1> <author >

<or!ani"ation>

<date created>

Revision History
#ame Date $eason %or &han!es Version

Use Cases for <project>

Page 2

Contents
1. Introduction <Introduction of your Project> 2. Actors <Identify Actors and Explain their roles> 3. Use Case <Identify Use cases and document them as per the use case template given> 4. Class Diagram <Identify classes and explain the attributes and methods of each class;

Mention the relationship between the classes properly>


5. Activity Diagram < raw and explain the activity diagram of your system> 6. #.

e!uence and Colla"oration Diagrams <for each use case> tate $ac%ine Diagram < escribe possible states and transitions of your system>

&. Com'onent Diagram <Explain each components and their inter!relationships" (. De'loyment Diagram < #how the configuration of the hardware elements $nodes% and shows

how software elements and artifacts are mapped onto those nodes>

Use Cases for <project>

Page 3

Introduction:

Use Cases for <project>

Page 4

Actors:
'dmin) A 'rivileged user *%o is allo*ed to create+edit 'ro"lems, create+edit contests, moderate comment t%reads and users. User( A normal user *%o is -ust allo*ed to attem't 'ractice and contest 'ro"lems, discuss t%em on comment t%reads. Prob)em( A 'ro"lem re'resents a 'rogramming 'ro"lem *it% a 'ro"lem statement, a set o. in'ut and out'ut test cases, a descri'tion, a sam'le test case. /ac% 'ro"lem is associated *it% a comment t%read and a leader"oard. &ontest( A contest is a collection o. 'ro"lems *%ic% collectively %as a leader"oard o. to' 'ro"lem solvers. A contest is managed "y an admin. It normally %as a deadline. Leaderboard( A leader"oard 0contest1 is a list o. to' 'er.ormers o. a contest. A leader"oard 0'ro"lem1 is a list o. to' su"missions to a 'ro"lem. It gets u'dated automatically *%en 'ro"lems are attem'ted. Lo!in*ystem( 2ogin ystem is t%e actor t%at is res'onsi"le .or user registration, user login, user logout.

Use Cases for <project>

Page 5

Use Case List


Use &ase +D UC31.1 UC31.2 UC31.3 UC32.1 UC32.2 UC33.1 UC33.2 Primary 'ctor 4on3mem"er 4on3mem"er User+Admin Admin Admin User User+Admin Use &ases
A non-member of the system registers with the system. A non-member of the system logs into the system. An admin or member logs out of the system. An admin creates a problem and adds it to the system. An admin creates a contest and adds it to the system. A member attempts to solve a problem. A member or admin comments on a problem.

1. Login System
1.1. Registration 1.2. Use Case(s)
Use &ase +D( UC-1.1 Use &ase #ame( A non-member of the system registers with the system. (Registration) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! "on-member 'ctors( Description( -ri!!er( Preconditions(

#econday! $ogin #ystem A non-member registers with the system. %f the person is trying to become an admin he needs to use a special invitation code that is given to him by an e&isting admin. An action related to using the coding 'udge system. 1. All the credentials needed to register with the system! username( password( "ame( )*+( email,%) -. %nvitation code (in case of admins)

Postconditions( 1. I. t%e details *ere entered correctly "y t%e 'erson, t%e system enters %is data in t%e data"ase and 'erson "ecomes a mem"er. 2. I. t%ere *ere missing credentials+incorrect credentials, t%e 'erson is told a"out t%e same and %e is e5'ected t%e .i5 t%em. #orma) %)o.( 1. 6erson o'ens t%e registration 'age. 2. 6erson enters registration credentials. 3. ystem validates t%e in'ut. 4. ystem adds data to data"ase. 5. ystem noti.ies t%e user o. success. ')ternative %)o.s( After -.( if any of the credentials are wrong.
1. #ystem mar.s those fields as incorrect and as.s him to re-enter them.

/0ceptions( During 4. i. some .aulty data"ase transaction is noticed, 1. ystem does a D7 roll"ac8. 2. ystem t%ro*s an e5c'etion 'age t%at tells t%e user a"out t%is %a''ening. During 2, i. t%ere is are missing .ields or .ields o. incorrect .ormats, 1. ystem %ig%lig%ts t%ose .ields. 2. ystem re'orts t%at t%e user must re3enter t%ese .ields.

Use Cases for <project>

Page 6

+nc)udes( %re1uency of Use( *pecia) $e1uirements( 'ssumptions( #otes and +ssues(

4one
/0 per day

4one
User understands 1nglish and his browser has 2ava#cript enabled. 1. 3hat is the minimum and ma&imum length of password and its character-set.

Use &ase +D( UC-1.Use &ase #ame( A non-member of the system logs into the system. ($ogin) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! 4ember5Admin 'ctors( Description( -ri!!er( Preconditions(

#econday! $ogin #ystem Admin54ember logs into the system to gain the privileges that members have by identifying himself to the system. An action related to using the coding 'udge system. 1. Admin54ember must have an account with the system. -. Admin54ember must have the user name and password with him.

Postconditions( 1. I. t%e log3in attem't *as a valid one, t%e user gets logged in. 9%e system sets some to8ens in it to recogni:e t%e user. 2. I. t%e log3in attem't *as an invalid one, t%e user gets noti.ied a"out t%e same and %e may try again. #orma) %)o.( 1. 6erson enters t%e login 'age. 2. 6erson enters %is username and 'ass*ord. 3. 6erson %its su"mit. 4. 6erson gets logged in. ')ternative %)o.s( After 6.( if user name doesn7t e&ist!
1. #ystem as.s the user to register.

/0ceptions( A.ter 3, i. t%e 'ass*ord *as *rong, 1. ystem as8s t%e user to re3try *it% t%e rig%t 'ass*ord. +nc)udes( UC31.1 %re1uency of Use( 1000 per day *pecia) $e1uirements( 4one 'ssumptions( User understands 1nglish and his browser has 2ava#cript enabled. #otes and +ssues(

Use &ase +D( UC-1.6 Use &ase #ame( An admin or member logs out of the system. (logout) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! 4ember5Admin 'ctors(
#econday! $ogin #ystem him in the system.

Description( Admin54ember logs out of the system to destroy the to.ens that were set for

Use Cases for <project>

Page 7

-ri!!er( Preconditions( Postconditions( #orma) %)o.(

User wanting to leave the system. 1. Admin54ember must have logged in to the system.

1. 9%e user gets logged out. 1. User %its log3out "utton. 2. User gets logged out.

')ternative %)o.s( "one /0ceptions( I. a.ter 1, i. t%e user;s to8en %as e5'ired, 1. User is told is already logged out. +nc)udes( UC31.1, UC31.2 %re1uency of Use( 1000 per day *pecia) $e1uirements( 4one 'ssumptions( User understands 1nglish and his browser has 2ava#cript enabled. #otes and +ssues(

2. Administrative Tas s
2.1. !eature "rocess !#o$ % Use Case &ode# 2.2. Use Case(s)
Use &ase +D( UC--.1 Use &ase #ame( An admin creates a problem and adds it to the system. (create problem) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! Admin 'ctors(
#econdary! roblem( Contest (optional) contest problem. contest( etc.

Description( Admin adds a problem to the system database either as a practice problem or a -ri!!er( Admin wants to add a practice problem upon re8uest or to add problems to a Preconditions( 1. Admin must have logged into his account.
-. Admin must have have a list of test inputs and corresponding outputs. 6. Admin must have problem statement. 9. Admin must have the contest %) to which he wants to add the problem (optional).

Postconditions( 1. A 'ro"lem a''ears in t%e list o. 'ro"lems in t%e system 0contest or 'ractice1. 2. A 'ro"lem 'age is created .or t%e 'ro"lem *it% a comment t%read and a leader"oard. #orma) %)o.( 1. Admin clic8s on <add 'ro"lem= on eit%er a contest or 'ractice set. 2. Admin is 'resented *it% a .orm. 3. Admin .ills u' t%e .orm *it% 'ro"lem statement, 'ro"lem test in'uts and out'uts. 4. 9%e 'ro"lem gets added to t%e data"ase and it a''ears in t%e rig%t lists. ')ternative %)o.s( Admin leaves some of the fields in the form empty after -.
1. :he system re'ects the submission.

/0ceptions( 4one. /ven t%oug% t%e test cases may "e entered *rongly, t%at *ill "e .ound out only u'on receiving .eed"ac8 .rom t%e users. +nc)udes( UC31.1, UC31.2 %re1uency of Use( 1 time every 6 days.

Use Cases for <project>

Page 8

*pecia) $e1uirements( A t%oroug%ly analy:ed and tested 'ro"lem *it% test cases. 'ssumptions( User understands 1nglish and his browser has 2ava#cript enabled. #otes and +ssues(
Admin enters problem in 1nglish and is understandable. A good way to chec. the validity of entered test cases.

Use &ase +D( UC--.Use &ase #ame( An admin creates a contest and adds it to the system. (create contest) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! Admin 'ctors(
#econdary! Contest

Description( Admin creates a contest. -ri!!er( :he admin decides it is appropriate to have a contest then. Preconditions( 1. Admin must have logged into his account.

-. Admin must have a name for the contest. 6. Admin must have a deadline for the contest. 9. Admin must have some information that the users wish to see about the contest.

Postconditions( 1. A 'ro"lem a''ears in t%e list o. 'ro"lems in t%e system 0contest or 'ractice1. 2. A 'ro"lem 'age is created .or t%e 'ro"lem *it% a comment t%read and a leader"oard. #orma) %)o.( 1. Admin clic8s on <create contest=. 2. Admin enters contest details in t%e .orm 'resented to %im 3. Admin %its su"mit. 4. Contest gets created. ')ternative %)o.s( Admin leaves some of the fields in the form empty after -.
1. :he system re'ects the submission.

/0ceptions( +nc)udes( %re1uency of Use( *pecia) $e1uirements( 'ssumptions( #otes and +ssues(

UC31.1, UC31.2
1 time every -0 days.

A *ell de.ined contest.


User understands 1nglish and his browser has 2ava#cript enabled. Admin enters contest details in 1nglish and is understandable.

'. (orma# o)erations


'.1. !eature "rocess !#o$ % Use Case &ode# '.2. Use Case(s)
Use &ase +D( UC-6.1 Use &ase #ame( A member attempts to solve a problem. (attempt problem) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date(

Use Cases for <project>

Page 9

'ctors( Description( -ri!!er( Preconditions(

rimary! 4ember #econdary! roblem( Contest (optional) A member submits a solution to a problem to the 'udge( which the 'udge then evaluates and shows the results to the member and updates the leaderboards. 4ember wants to solve a problem for practice or participating in a contest 1. 4ember must have logged into his account. -. 4ember must have a source program that attempts to solve the problem.

Postconditions( 1. A result is s%o*n to t%e user. 2. U'on ac%ieving a 'ositive result, t%e 'ro"lem 0and contest1 leader"oard0s1 are u'dated. 3. 9%e 'ro"lem is mar8ed >solved> in t%e user;s inter.ace. #orma) %)o.( 1. User clic8s on < olve 'ro"lem= 2. User su"mits %is solution 0source code1 3. User %its </valuate=. 4. User;s attem't correct. 5. 9%e 'ro"lem;s 0and contest;s1 leader"oard0s1 are u'dated. ')ternative %)o.s( User7s solution is wrong!
1. :he user is notified of the error and he is e&pected to resubmit a solution.

/0ceptions( User;s solution e5ceeds time limit) 1. 9%e 'rogram is interru'ted and t%e user is noti.ied a"out t%e same. +nc)udes( UC31.1, UC31.2, UC32.1 %re1uency of Use( 6000 times every 1 day. *pecia) $e1uirements( Code to "e su"mitted in a su''orted language. 'ssumptions( User understands 1nglish and his browser has 2ava#cript enabled. #otes and +ssues(

Use &ase +D( UC-6.Use &ase #ame( A member or admin comments on a problem. (comment) &reated ,y( Last Updated ,y( Date &reated( Last $evision Date( rimary! Admin 'ctors( Description( -ri!!er( Preconditions(

#econdary! roblem( Comment :hread A member or admin comments on a problem( possibly see.ing clarification( providing clarification discussing the problem. User wants clarification or wants to discuss a problem. 1. 4ember must have logged into his account. -. 4ember must be at the problem page.

Postconditions( 1. 9%e comment a''ears on t%e comment t%read o. t%e 'ro"lem. #orma) %)o.( 1. User goes to 'ro"lem 'age. 2. User enters %is comment in t%e comment "o5. 3. ?its su"mit. 4. Comment a''ears *it% a timestam' and user name. ')ternative %)o.s( User leaves the comment field empty.
1. :he system re'ects the submission.

/0ceptions( 1. Data"ase transaction error) @oll"ac8

Use Cases for <project>

Page 10

+nc)udes( UC31.1, UC31.2, UC32.1 %re1uency of Use( 1000 times every 1 day. *pecia) $e1uirements( 'ssumptions( User understands 1nglish and his browser has 2ava#cript enabled. #otes and +ssues( #pam detection and content filtering.

Use case dia!ram(

Use Cases for <project>

Page 11

&)ass dia!ram

Person(
9%is re'resents any 'erson interacting *it% t%e system. ?e is a user o. t%e system. Attri"utes) 4ame) 4ame o. t%e 'erson userAname) A uni!ue userAname corres'onding to t%e 'erson emailAid) Uni!ue /mail ID o. t%e 'erson 'ass*ord) A 'ass*ord $et%ods) solve01) Any user o. t%e system may a solve a 'ro"lem. 6arams) 6ro"lemAID

'dmin(
9%is in%erits .rom 6erson. It %as t%e e5tra a"ility to add 'ro"lems, contests and manage t%em. $et%ods 0e5tra1) createA'ro"lem01 ) creates a 'ro"lem 6arams) 6ro"lem o"-ect editA'ro"lem01 ) edit an e5isting 'ro"lem 6arams) 6ro"lem o"-ect

Use Cases for <project>

Page 12

createAcontest01 ) create a contest 6arams) Contest o"-ect editAcontest01 ) edit a contest 6arams) Contest o"-ect

Prob)em(
@e'resents a 'ro"lem t%at e5ists in t%e system. It may"e eit%er a contest 'ro"lem or a 'ractice 'ro"lem. Attri"utes) in'ut) An in'ut test case. But'ut) 9%e out'ut corres'onding to t%e in'ut test case. tatement) An e5'lanation o. t%e 'ro"lem 'id) 6ro"lem ID leader"oard) A 2eader7oad o"-ect corres'onding to t%e 'ro"lem 0"est 'er.ormers1 $et%ods) cAt%read01) @eturns t%e Comment9%read o"-ect 'resent in t%e 'ro"lem. C%ec801) C%ec8s a su"mitted solution and returns a''ro'riate res'onse. 6arams) in'ut source code

&omment-hread(
@e'resents a comment t%read associated *it% a 'ro"lem *%ere users may su"mit comments. Attri"utes) commentsCD ) An array o. Comment o"-ects 'resent in t%e comment t%read $et%ods) add01) Adds a comment 6arams) A Comment o"-ect remove01) @emoves a comment 6arams) A Comment o"-ect edit01) /dits a comment 6arams) A Comment o"-ect

&omment(
@e'resents a comment 'resent in a comment t%read. Attri"utes) userAname) user name o. t%e user *%o 'osted t%e comment time) 9ime at t%e *%ic% t%e comment *as 'osted date) Date on *%ic% t%e comment *as 'osted te5t) 9%e actual comment string

Leader,oard(

Use Cases for <project>

Page 13

@e'resents a leader"oard .or a 'ro"lem or a contest. It is generic in t%e sense t%at it su''orts any sc%ema. Attri"utes) sc%ema) 4ames o. columns 'resent in t%e leader"oard. 0an array o. strings1 entries) stringCDCD eac% ro* corres'onding to an entry. sortAcol) 9%e column "y *%ic% it is sorted. Com'are) A .unction t%at tells us *%ic% entry s%ould come "e.ore *%ic%. i:e) 9%e num"er o. entries in t%e leader"oard. $et%ods) add01 ) Add an entry to t%e leader"oard. @emove01) @emove an entry .rom t%e leader"oard

&ontest(
@e'resents a contest in t%e system. Attri"utes) 'ro"lems) An array o. 6ro"lem o"-ects 'resent in t%e contest. 2eader"oard) 9%e 2eader"oard o"-ect associated *it% t%e contest duration) 9%e time 0in milliseconds1 .or *%ic% t%is contest s%ould last. tartAdate) 9%e start date o. t%e contest. tartAtime) 9%e start time o. t%e contest. tatus) A !uic8 descri'tion o. t%e contest. $et%ods) add01) Adds a 'ro"lem to t%e contest. 6arams) A 6ro"lem o"-ect. @emove01) @emoves a 'ro"lem .rom t%e contest. 6arams) A 6ro"lem ID. U'date01) U'dates a 'ro"lem. 6arams) A 6ro"lem o"-et.

MemberUti)s(
A utility class t%at %el's in mem"ers%i' management. $et%ods) login01) 2ogins a user. 6arams) userAname 0 tring1 and 'ass*ord 0 tring1 logout01 ) 2ogs out a user. ignu'01) @egisters a user. 6arams) A data o"-ect in E B4 containing t%e credentials o. t%e user.

Use Cases for <project>

Page 14

'ctivity Dia!ram(

9%e system starts in t%e initial state. A 'erson attem'ts to login. I. %e login *as valid, t%e systems logs %im in. 9%en, i. t%e user *ants to solve a 'ro"lem, %e attem'ts one. Bt%er*ise %e e5its. I. t%e attem't *as correct, t%e 'ro"lem leader"oard is u'dated. Bt%er*ise and error message is s%o*n and t%e user may attem't t%e 'ro"lem again. I. t%e 'ro"lem *as a contest 'ro"lem, t%e contest leader"oard is also u'dated. 9%e user may continue solving 'ro"lems or e5it.

Dep)oyment Dia!ram

Use Cases for <project>

Page 15

9%e client sits at a client mac%ine and interacts *it% a UI erver node. 9%e UI server contains ?9$2 so.t*are o"-ects t%at dis'lays content to t%e user. 9%e admin also interacts t%e same *ay. 9%e UI server in res'onse to t%e interactions o. t%e users and admins, communicates *it% t%e a''lication server, *%ere 'ro-ect o"-ects suc% as 6ro"lem, Comment9%read, 2eader7oard etc. are 'resent. All data is stored in a Data"ase server. 9%e a''lication server *%ic% needed, communicates *it% t%e Data"ase server to retrieve or u'date data.

&o))aboration Dia!ram

Use Cases for <project>

Page 16

1. 2. 3. 4. 5. 6. #.

Admin creates a 6ro"lem o"-ect. 6erson logs in t%roug% t%e login system. 6erson comments on a 'ro"lem 'ossi"ly as8ing .or clari.ications. Comment gets added to t%e comment t%read o. t%e 'ro"lem. 6erson solves t%e 'ro"lem. 6ro"lem u'dates its leader"oad. 6erson logs out t%roug% t%e login system.

*tate dia!ram

Use Cases for <project>

Page 17

Vous aimerez peut-être aussi