Assignment 2: Upgrading your e-Commerce Web-site

Scenario: 
The marketing director of the company asks you (and, optionally, a partner) to upgrade the website that you had previously designed for him (you can choose to start from your assignment #1 projects or start an entirely new project). He is very pleased with the original website but now wants you to personalize the website for each user. He thinks that will increase the overall appeal of the site to users. He asks that you create a registration form through which users can register their pertinent data and that you create a login form and save this in the system. He also wants the site to be more “personalized” so after the user logs in, the pages should greet the user by name and thanks them by name in the invoice. He only wants registered users to be able to purchase products, so you will need get users to login or register before allowing them to purchase products but anyone should be able to view products. The Page sequence should be something like that illustrated below:

[data flow]

Note : it should be impossible to get to the Invoice Display Page without first logging in!

This assignment involves the following new requirements (in addition to all previous requirements):

The minor requirements for this assignment are:

NOTE:   Please do not use sessions or cookies for this assignment! One purpose of this assignment is to understand the value of using these, which we will do in Assignment 3.

Some general tips:

Remember to start early and finish early!!

“Use-Cases” for Key Requirements

(1-2) Login, Registration, and Persistence

(A) Implementing User Login

**** VERY IMPORTANT: You must have the email address “itm352@hawaii.edu” with the password “grader” set in your program to enable grading of your assignment.

Hints:

Extra Credit: Would it be better to store and access user data using a database? Explain the pros and cons of this. Using this list, what is best for this particular application and why?

Login Page

Processing the submitted login form

HINT:

Keep the product quantities in a query string that is added to every page request. Handling separate server requests is probably easier than using complicated if-statements on the server to route everything.

Extra Credit: Use microservices to process a login and registration without leaving the page unless successful.

Registration

The following input fields for the registration form are required, but you can add more if you want:

Note: Validating email addresses can be tricky. Even if you follow the above guidelines, it may still not be valid, so feel free to get clever and find interesting ways to ensure a truly valid address. Extra credit will be given for any additional checks that correctly validate the address.

Processing the registration

** IMPORTANT ** As in Assignment 1 you MUST do validation on the server before you save registration data. You may not use guards on the client page, but it is not enough by itself.

HINTS:

Extra Credit: Logged in users should be able to view edit their registration data. Edits must be validated before being saved. Notify the user that the update was successful and allow them to go back to the products page (or redirect them there after notification).

(3-4) Security

Hint: Think about…

Extra Credit: Explain how a user could defeat your security scheme and gain access to your main application page without having to log in.

(5) Personalization on the invoice page

Think about:

Individual additional requirements:

The following are additional requirements that will be assigned to you by the instructor or TA. Your assigned individual requirements are not optional and if not implemented, your assignment score will be severely penalized. You may not copy the implementation code from someone (or somewhere) else. You must design and write the code yourself. Copied code, referenced or not, will result in 0 for the entire assignment. If you are confused about the requirement or expectations, ask the instructor immediately. Once you submit your assignment, there are no excuses for not understanding the requirements and expectations. Code for your individual requirement must be generously commented. Clearly indicate in the these comments what your individual requirement is and how it is implemented. If you are working with a partner you must implement all the individual requirements.

User Acceptance Testing

(1) Copy your Tests.txt from Assignment1 and update the tests for Assignment2. This should include changing the existing tests (e.g. after user selects products they see the login page rather than invoice) and adding new tests (e.g. User logs in) to check that all the requirements listed above. You should have at least 9 new test scenarios.

(2) Test your application with the scenarios you have written. Make sure to test all the requirements listed above. Document your test results in the Tests.txt file by adding a Status: entry at the end of each test indicating if the test passes, fails, or partially fails. At the end of the file, write a brief summary of your testing experience and if your application passed all the tests. Here is an example of a new tests you should have:

Test11
Scenario: User login with unregistered email address
Expected Result: User is sent back to login page and informed that there is no account for email address. Email address entered remains in textbox (sticky) but password textbox is empty. 
Actual Result: User is sent back to login page but not informed that account does not exist, email not sticky
Tested by: Entering xxx@yyy.zz in email textbox and clicking login submit button
Status: Partial fail

Submission: Same as Assignment1 (see Deploying Assignment 1 Experience. Note that you will need to make your private repo available grader and deploy your application in order to submit your assignment. See the Laulima assignment for details.

Checklist:

If working with a partner the following are also required: