Integrate web front­end with java api

Assignment Help Software Engineering
Reference no: EM133673729

Task: Integrate web front­end with Java API back end as part of integration testing

Overview

Web applications are often developed as separate front­end and back­end modules where HTML based front ends (or web pages or client interface) interact with the back end (or cloud) through well­defined APIs to receive services including authentication and access cloud resources. Development of front and back ends may progress separately until they are merged to test their integration. In this task you will need to develop HTML pages which will then communicate to the HTTP endpoints (such as Java Servlets). These back­end HTTP request handlers invoke business logic to provide services such as a login service that can access user directory or database to authenticate a login request. You will need to create business logic functions as needed and unit test them as you develop - wearing a developer hat to test all your function features. Next you will need to use login HTML pages and use selenium to do functional testing of this page - wearing a software quality assurance team member's hat. The main goal wearing both hats would be to test the software to break it from dev team and testing team's point of view. This also facilitates to experience an integration testing - connecting front­end to back­ end. In addition, you would need to justify if the tests generated in this task covered aspects of integration testing and at what level and recommend, if any.

Submission details
Use the instructions on the following page to carry out this task's steps. Submit the following files to OnTrack.
A PDF file listing unit test cases from developer point­of­view and functional test cases from test­team point­of­view. You can use a table to describe each test case name, description, intended result and test results.
A self­reflection on the difference between writing test cases for developers themselves (unit tests) and testing team­members (functional tests). Justify your findings w.r.t. a Venn diagram specially, any untested regions of functional requirements.
Your justification regarding aspects of integration testing this project covers.
Your program's source code.
A screenshot of your GitHub page where your latest project folder is pushed.
You want to focus on the following key ideas, and make sure you can explain them in relation to your program.

Unit testing and functional testing.
Satisfy functional specifications.
Integration tests in terms of functional testing (integrating front­end with the back end).

Instructions
For this task you will need to
Download task8_1P.zip Java project and unzip it in a common folder (say, java_projects) which you will be using to store all the weekly projects.
Import the project (as a maven project) in Eclipse IDE.
Observe the project folder structure as below ­

Directory structure MyServer.java

File name Description
MyServer.java
Package: web HTTP server module, you need to run this file to start web server. It listens to port 8082. Open URL https://127.0.0.1:8082 in a browser and you should see a greeting message from the running
server.
WelcomeServlet.java
package: web.handler Handles URL /  and displays a greeting
message.
LoginServlet.java
Package: web.handler Handles URL /login  and calls
LoginService.login() function to authenticate user.
RegistrationServlet.java
Package: web.handler Handles URL /reg and calls RegistrationService.register() function.
PASS tasks can leave this function as it is.

The /login URL is routed to LoginServlet which extracts HTML form parameters such as username, password and DoB and calls LoginService.login() to authenticate user. The login function does not make use of DoB field in the example which you need to use for authentication. Finally, renders a HTML string to display on browser as a response. Note that the generated HTML string creates page title to reflect the login status, this is to help to test the response by checking the page title from Selenium. You can come up with your own response mechanism so that a form submission response can be validated from Selenium side.
LoginServlet.java

LoginService.java

As a developer, you must update the login function to make use of all 3 parameters such as username, password and dob (date string format yyyy­mm­dd) and generate

unit test cases to test to cover any anomaly using one or more of boundary value, equivalence class or decision­table based tests as appropriate.
As a test­team member, you must use Selenium to write functional test cases by loading login.html and testing the login function and aim to find function flaws by using all ranges of values including valid and invalid values. You may need to update Java files in web.service package (LoginService.java) to enhance the authentication logic and unit test them and update Java files in web.handler package (LoginServlet.java) to generate authentication response which can be easily tested in Selenium. Currently response HTML page's title is set to string ‘success' or 'fail' based on authentication logic. You may not require updating login.html file, but you should keep the fields same (username, password, and dob).
Login.html
Web view

Selenium test example is shown in below figure and described in a table.

Line 40­48 Locates fields including username and passwd and fills in new values.
Line 52­53 Locates submit button and clicks on it to submit the form.
Line 64 Verifies authentication response if it equals to a page title "success".
LoginServiceTest.java
You will need to update the LoginServiceTest.java file to add additional functional test cases using Selenium.
You will need to create a new test file to include your unit test cases.
Upload your project folder to your GitHub account and take a screenshot.

Your Task
For this task, you will need to ­
Study login.html page and webserivce1 Eclipse Java project's source and test files to understand how the HTML form in login.html is submitted to interact with Java web handler function located in LoginServlet.java. For this, you will need to run the MyServer.java file to start HTTP web server.
Improve authentication logic in LoginService.java and write unit test cases (create a new test file) to cover above 90% code coverage.
Update LoginServlet.java to generate HTTP response suitable for Selenium to receive it so functional tests can be done easily. Currently, the response web page's title reflects the authentication response.
Update LoginServiceTest.java to include more functional test cases based on Selenium.
Your goal should be to critically write test cases from both developer and test­team member's point of view to find flaws in the system.
Follow submission instructions on the first page and submit your work.

Reference no: EM133673729

Questions Cloud

Test driven development and CI : Test driven development and CI - Prepare a short story as a customer requirement for the function - why it is needed and how it should behave
How to organise your functional test cases : Describe each test case name, description, intended result and test results - explain them in relation to your program-how to organise your functional test case
Application hosted in cloud or on-premises : Is the application hosted in the Cloud or on-premises. If the application is hosted in the cloud is it hosted as Infrastructure as a Service (IaaS),
What is your recommendation to the boss : Your boss would like to use social media to screen candidates and has asked for your input. What is your recommendation to the boss?
Integrate web front­end with java api : Integrate web front­end with Java API back end as part of integration testing - Development of front and back ends may progress separately
Describe the qualities that you think are most important : Describe the qualities that you think are most important for someone to be recognized as a conscious leader. How to develop the qualities you described above.
Programmer uses algorithm : A programmer uses an algorithm that will determine if a number is odd or even using modulus.
What are three virtues that you think are most important : What are two or three virtues that you think are most important in our personal lives and in our business affairs and explain why you selected those?
Discuss why we need both mocking and stubbing instead : Integration testing by mocking and stubbing dependencies - Discuss why we need both mocking and stubbing instead of any one of them with proper references

Reviews

Write a Review

Software Engineering Questions & Answers

  Draw a use-case diagram and a set of activity diagrams

Draw a use-case diagram and a set of activity diagrams for the process of buying glasses from the viewpoint of the patient. The first step is to see an eye doctor who will give you a prescription. Once you have a prescription, you go to a optical dis..

  How you would present some of the best practices in security

Detail how you would present some of the best practices in security, including concerns surrounding operating systems, databases, authentication and password policies, user administration, etc. Be sure to consider the audience of this presentation..

  Contribute to producing program code

Under what circumstances is this view sensible, and under what circumstances is it foolish and in the latter case, how would you persuade such a manager that the specification does need to be high quality

  Unit 27 artificial intelligence assignment

Unit 27 Artificial Intelligence Assignment Help and Solution and Implement an intelligent system using a technique of the top-down approach of Al

  Computing open-circuit voltage and short-circuit current

Compute the open-circuit voltage and short-circuit current of combination of cells.

  Modularity can have negative as well as positive effect

Modularity can have a negative as well as a positive effect. A program that is overmodularized performs its operations in very small modules, so a reader has trouble acquiring an overall perspective

  How to sketch flow chart to read employee master file

How to sketch flow chart to read employee master file and to output number of employees in each department who have a basic degree.

  Explain the concept of modular software design

Describe how the causes of software failures differ from hardware failures. Give at least three examples to support your explanation.

  Identify the rooms that contain chests riddles

Identify the rooms that contain chests riddles that are unsolvable, you remove those from the game and request the level designers to craft new riddles

  Create storyboards interactivity diagram object dictionary

Create storyboards interactivity diagram object dictionary and any essential scripts for an interactive program for customers of sunflower floral designs.

  Difference between network scanning or network mapping

Explain the difference between network scanning or network mapping and enumeration - Why is it important to enumerate systems for available services, shares, users, and so on and What Microsoft command utility can provide you with the NetBIOS name of..

  Prepare a system flowchart for shop floor control process

Prepare a systems flowchart for the shop floor control process only.- Prepare a level 0 data flow diagram for the shop floor control process only.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd