Question: Your very first task is to create a registration and login feature. This feature needs to allow usersto ( Read through the entire task before

Your very first task is to create a registration and login feature. This feature needs to allow usersto (Read through the entire task before you start any work):
1.Create an account by entering username, password, first name and last name.
a. The system needs to check that the following conditions are met, and reply with theappropriate output message:
7/23
Conditions
Messages
True
False
Username contains an underscore and is nomore than 5 characters long
Usernamesuccessfullycaptured
Username is notcorrectly formatted,please ensure thatyour usernamecontains anunderscore and is nomore than 5characters in length .
Password meets the following passwordcomplexity rules, the password must be:
At least 8 characters long
Contain a capital letter
Contain a number
Contain a special character
Passwordsuccessfullycaptured
Password is notcorrectly formatted,please ensure thatthe passwordcontains at least 8characters, a capitalletter, a number anda special character.
2.Login to the account using the same username and password.
a. The system should provide the following messages to verify the users authenticationstate:
Conditions
Messages
True
False
The entered username and password arecorrect, and the user is able to log in.
Welcome , it is great tosee you again.
Username orpassword incorrect,please try again
3. You will need to implement aLoginclass with the following methods to ensure that yourapplication meets good coding standards and that the code you write is testable.
8/23
Method Name
Method Functionality
Boolean: checkUserName()
This method ensures that any username contains an underscore (_) and is no more than
Boolean:checkPasswordComplexity()
This method ensures that passwords meet the followingpassword complexity rules, the password must be:
At least eight characters long.
Contain a capital letter
Contain a number
Contain a special character
String registerUser()
This method returns the necessary registration messagingindicating if:
The username is incorrectly formatted
The password does not meet the complexityrequirements.
The two above conditions have been met and the userhas been registered successfully.
Boolean loginUser()
This method verifies that the login details entered matchesthe login details stored when the user registers.
String returnLoginStatus
This method returns the necessary messaging for:
A successful login
A failed login
4. It is good practice to never push code that has not been tested, you will need to create thefollowing unit tests to verify that your methods are executing as expected:
Test: (assertEquals)
Test Data and expected system responses.
Username is correctly formatted:
The username contains an underscore and is nomore than 5 characters long
Test Data: kyl_1
The system returns:
Welcome ,it is great to see you.
Username incorrectly formatted:
Test Data: kyle!!!!!!!
9/23
The username does not contain an underscoreand is no more than 5 characters long
The system returns:
Username is not correctly formatted, pleaseensure that your username contains anunderscore and is no more than 5 characters inlength.
The password meets the complexityrequirements
Test Data: Ch&&sec@ke99!
The system returns:
Password successfully captured
The passworddoes notmeet the complexityrequirements
Test Data: password
The system returns:
Password is not correctly formatted, pleaseensure that the password contains at least 8characters, a capital letter, a number and aspecial character.
Test (assertTrue/False)
Login Successful
The system returns:
True
Login Failed
The system returns:
False
Username correctly formatted
The system returns:
True
Username incorrectly formatted
The system returns:
False
Password meets complexity requirements
The system returns:
True
Password does not meet complexityrequirements
The system returns:
False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!