Download EECE 310: Software Engineering ‐ Project Description

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
EECE 310: Software Engineering ‐ Project Description First Phase (Due date: see class website) Part A0: Form project groups. In group formation we aim to combine your preferences and random assignment. You will need to pick another student as your pair and we’ll randomly match pairs to form groups of four. TO DO: email your pair information including full name, student number and emails to Armin by 11:59pm on Wednesday January 16th, 2008. There will be a few groups of 3 students, and the last people who send their pairing information may lose their preference. Part A1: Subscribe to mailing list by 11:59pm on Wednesday January 16th, 2008 if you have not already subscribed. Part B: Setup your environment. To get used with the development environment write a simple java program which prints the command line arguments passed in to the program to the screen (this step will not be graded). Step 1: Check the following link for Eclipse and SVN setup instructions: http://www.ece.ubc.ca/~abdullah/310/eclipse.html Step 2: You may want to download the latest Java Development Kit (JDK) from http://java.sun.com/javase/downloads/index.jsp Step 3: Eclipse is a friendly and easy to use IDE and there are lots of tutorials available online to use this IDE. You may use the tutorial provided by the IDE itself to familiarize yourself with this application. And if you need further help, the https://eclipse‐tutorial.dev.java.net/ can be a good source. And finally if you are still having problems, mailing list can be a good source as other students may have experienced the same problems. Step 4: There are many online Java tutorials. Google can help finding tutorials for specific topics. Here are some of the links you may like to use as starters: •
http://java.sun.com/docs/books/tutorial/index.html •
http://java.sun.com/docs/books/tutorial/getStarted/index.html •
http://java.sun.com/docs/books/tutorial/ui/index.html •
http://www.ugrad.cs.ubc.ca/~cs219/CourseNotes/Java/intro.html •
http://www.ugrad.cs.ubc.ca/~cs219/CourseNotes/Swing/intro.html Part C: Write a simple java class which checks that a password is “well formed”: each password should be at least 6 characters long and include at least two upper case letters, two lower case letters and two numbers. As it is not a great idea to store raw passwords, this class should additionally provide support for an alternative way to store passwords and validate stored passwords. There are many solutions to this (we will discuss in class a few of them) find the easiest and best solution to this problem and mention your assumptions if you make any. Part D: Implement a persistent account management component that uses java FileIO for persistence (storage). This component will be used to perform various account management operations as well as store the user/password information of the chat server. You should implement this component within a class named AccountManagement (It is recommended to create a separate helper class for performing the FileIO operations e.g. PersistenceStorage class). The name for the filene used for FileIO should be passed in the Constructor of the AccountManagement class (e.g. public AccountManagement(String filename)). The AccountManagement class is responsible for supporting the following functions: 1. Account Creation: This function is supposed to create a new account. It has to validate the password to make sure it is “well formed” (Use the component implemented in Part C); it also has to make sure that the username is unique and not previously used. The signature of this function is: boolean CreateAccount( String username, String password ); 2. List Accounts: This function is supposed to return an array including the list of all created accounts (usernames). The signature of this function is: String[] GetAccountList( ); 3. Authenticate: This function is supposed to authenticate a user into the system using using the provided username and password combination. The signature of this function is: boolean Authenticate (String username, String password); 4. Persist: This function is called on program termination. It is responsible for making sure all required information such as username and password combinations are stored to the file. This action is crucial as the next time you run the program the AccountManagement class, it is required to read the file and load to the previously terminated state. (e.g. The AccountManagement class has to load the previously created accounts from the file). Following is a sample signature of this function: void Persist(); Create a program that tests the AccountManagement class and verifies that it functions correctly. Part E: In this section you are required to use the AccountManagement class previously implemented and build an interactive command line program that iteratively asks the user for a one line input and responds accordingly. User will interact with your program to create accounts. Additionally, users will login/logout so you are also required to keep a list of all online accounts. The filename where the user/passwd database needed by AccountManagement has to be passed to your program as a program argument. Your program should validate the program arguments. You can simply print an error message if the arguments are not valid. You will need to design and implement a Java class that parses the command sent by users for processing. You will implement a class named CommandParser that is only responsible for parsing the command passed in as a String. Commands are expected to be in form of “COMMAND ARG1 ARG2 …” Then write a simple java program that iteratively asks the user for a user a one line input and parses it using the CommandParser class. Note: It is recommended to use java.util.StringTokenizer. StringTokenizer is a great tool for parsing strings and searching for specific keywords and patterns. Some of the commands you are required to support are: •
Create new account with required arguments username and password: Line format: CreateNewAccount [UserName] [Password] For example, for the command string: “CreateNewAccount xxx secretPassword” The program should print a message if the account is created successfully or an error message explaining the failure cause (e.g. A new account with username “xxx” has been created successfully, Account creation has failed, username “xxx” is already taken, Command improperly formatted) •
Login with required arguments username and password: Line format: Login [UserName] [Password] The program should print a message if the login has been successful or not. (e.g. “xxx” has successfully logged into the system, Login has failed, username password don’t match, or Command improperly formatted) •
Logout with required argument username: Line format: Logout [UserName]
The program should print a message if the logout has been successful or not. (e.g. “xxx” has logged out. Logout failed, “xxx” is not logged in, or Command improperly formatted) •
List Online Users with no arguments: Line format: ListOnlineUsers The program should print the list of users logged into to the system. (e.g. Following is the list of online users: User1, User2, User3, …, or Command improperly formatted) •
List Users with no arguments: Line format: ListUsers The program should print the list of all accounts created. (e.g. Following is the total list of users: User1, User2, …, or Command improperly formatted) •
Exit with no arguments: Line format: Exit
The program should store its information to a file and terminate. (e.g. Saving server information to “FILENAME”. Terminating the server, or Command improperly formatted ) After completing this section of the project one should be able to use your submission as follows:
>java –jar server.jar serverFile.txt
Initializing the server
No server file is found, Initializing to default state.
ServerPrompt>>CreateNewAccount User1 password
Account is not created! Your password is required to have …
ServerPrompt>>CreateNewAccount User1 MYpassword01
A new account with username “User1” has been created successfully
ServerPrompt>>CreateNewAccount User1 MYpassword02
Account creation has failed, username “User1” is already taken
ServerPrompt>>CreateNewAccount User2 MYpassword02
A new account with username “User2” has been created successfully
ServerPrompt>>ListUsers
Following is the total list of users: User1, User2
ServerPrompt>>Exit
Saving server information to “serverFile.txt”
Terminating the server
>java –jar server.jar serverFile.txt
Initializing the server
Server file “serverFile.txt” is found, loading server state.
ServerPrompt>>Login User1 password
Login has failed, username password don’t match
ServerPrompt>>Login User1 MYpassword01
“User1” has successfully logged into the system
ServerPrompt>>ListOnlineUsers
Following is the list of online users: User1
ServerPrompt>>CreateNewAccount User3 MYpassword03
A new account with username “User3” has been created successfully
ServerPrompt>>ListUsers
Following is the total list of users: User1, User2, User3
ServerPrompt>>Logout User1
“User1” has logged out.
ServerPrompt>>Exit
Saving server information to “serverFile.txt”
Terminating the server
Note: The design and clarity of code is important and is considered during the evaluation of your project. Make sure the code is well commented and follows good programming standards. Deliverables •
•
•
Code for all sections of the project. Note that all methods in your code have to be properly specified (i.e., they have REQUIES, MODIFIES. EFFECTS clauses) JAR file of your work from “Part E” (I should be able to run the JAR file from command line e.g. “java –jar server.jar filename”) Document explaining the work that you have done on all sections of the project, including a sample output of the program. The document should also include a brief summary of the tests that you have performed and any known bugs Hand­in Procedure Only one submission per group is required (Extra/Later submissions are ignored). Please ZIP all the deliverables into one zip file, and name it like following: EECE310‐P[Phase Number]‐[Group Name].zip e.g. EECE310‐P1‐GroupA.zip Email your zip file to [email protected] with subject exactly the same as your zip file e.g. EECE310‐P1‐GroupA Late Submissions Policy Late submissions are only accepted until three days after the due date, and there is a 25% penalty per day