Assignment 2. Login

Goals

Assignment 2 aims to let you work with real tools, requirements, tests and release a web application on a public server.

After completing the assignment the student should have...

  • ...worked with tools and servers
  • ...read and successfully implemented requirements with PHP
  • ...tested those requirements carefully.
  • ...created an application with functionality similar to the example application.

Rules

Examiner sets the degree using the following:

  • Minimum requirements must all be fulfilled
  • Requirement fulfillment
  • Code quality
  • MVC implementation

The set of minimum requirements for approved is:

  • Solution has been submitted before the deadline
  • Code should be available on a public git repository.
  • The application must be deployed on a public web server, the server must be available to the examiner for the rest of the course.
  • The Assignment is done individually! You are not allowed to copy or take solutions from others.
  • No code is copied from others, student has worked alone
  • No external code except the code given in task, no libraries are used
  • No javascript is used
  • HTML follows web standards
  • Application can be tested with the automated test application.
  • Code has one single page (index.php)
  • Your solution will/may be shared with other students after the deadline.

Requirement fulfillment

  • All mandatory test-cases MUST be successful
  • The more testcases that are fullfilled, the better
  • Test-cases should be manually and automatically testable (using the test application).
  • The application is well tested even outside of the explicit tests
  • Application works as the example implementation

Code Quality

  • Code MUST be object oriented.
  • Code looks good
  • Errors are handled well (assert and exceptions)
  • Code Repository is presented well on git (eg. README.md )
  • Dependencies are explicit or encapsulated
    • No string dependencies, uses strategies to avoid them
  • Avoid complexity

MVC implementation

  • Code is separated into Model View Controller components
    • No dependencies from Model to Controller or View
    • No dependencies from View to Controller
    • Only use $_GET, $_POST, $_COOKIES etc in View-classes
    • No output generation in Model or Controller
    • No View responsibilities in Model or Controller
    • No Model responsibilities in View or Controller
    • No Controller responsibilities in View or Model

Task 1. Explore requirements, example application, and test-cases.

The requirements of the application is written below and consists of three use-cases.

Use Cases

For each of the use-cases there are a number of test-cases. The test cases are given in the following format.

  • Input, steps to do. In some cases another test-case, if so do the input steps of that test-case.
  • Output, things you should observe or not observe if the test-case is successful.
  • Image, an image of the result after Input steps are done.

Testing of the application requires two different browsers, and a tool to manipulate cookies, like "firebug".

Mandatory Test Cases, These are the requirements everyones solutions must fullfill all of.

Extra Test Cases for higher grades These are the extra test-cases for extra credit.

Test Application. This is an example solution for assignment 2. It fulfills all the test-cases above.

Automated tests Application. This is an automated acceptance test system to speed up the testing process.

Task 2. Copy the code and get your servers set up.

Now its time to implement the requirements using use-cases and test-cases.

Get the startup code

The assignment will be tested using a Automated unit test application. To allow this we will first copy the interface application for that project on GitHub.

Get the startup code running locally

You are going to develop locally and make "releases" to a public server. This means you need to setup both a local server and a public server.

  • Startup your local server and configure it to use your copy of Login_1DV608
  • browse to local server(For example http://localhost:8080/ ) and check that you see the correct output with a header of "Assignment 2".

Make a release to a public web server

In order to hand in this project you must have a public web-server that is online 24-7. There are many possible solutions

  • you could host yourself if you have a public IP-adress and wants to keep a server up and running
  • you could buy hosting from a web-hotel
  • you could use a free hosting such as http://www.000webhost.com/ (PHP 5.2)

Test your release

  • Transfer your files to the server, for example by FTP, SFTP, or git.
  • Browse to the server and make sure you see the output of the PHP-scripts
  • Go to http://csquiz.lnu.se:82/ and enter your server adress with your user-id
    • press Check
    • you should get a "Estimated score on assignment: 5%." and a LOT of errors

Task 3. Implement the requirements.

  • while (you have requirements to implement)
    • Implement a requirement
    • Test locally using the manual test-cases
    • Commit and push to repository
  • Release code to server
    • Go to http://csquiz.lnu.se:82/ and enter your server adress with your user-id
    • Fix problems locally, then release to server and retest

Assignment submission

Welcome to CoursePress

en utav Linnéuniversitets lärplattformar. Som inloggad student kan du kommunicera, hålla koll på dina kurser och mycket mer. Du som är gäst kan nå de flesta kurser och dess innehåll utan att logga in.

Läs mer lärplattformar vid Linnéuniversitetet

Student account

To log in you need a student account at Linnaeus University.

Read more about collecting your account

Log in LNU