Skip to main content

Lab-6-1

(10 % of the course mark)

Monolith and Microservices App Testing

  • In monolithic applications, testing focuses on the entire system as a single unit. It's easier to set up but can become complex as the codebase grows. Integration and end-to-end testing are crucial to ensure all components work together seamlessly.

  • Testing microservices involves validating each service independently and as part of a distributed system. It includes unit, integration, contract, and end-to-end tests. Challenges include service communication, data consistency, and test environment setup.

Lab objectives

  • Compare testing strategies for monolithic and microservices architectures.

  • Configure appropriate test environments for both monolithic and microservices-based applications.

  • Validate interaction between components (monolith) or services (microservices) through integration testing.

  • Simulate real-world user workflows to verify system behavior across both architectures.

  • Utilize tools like Postman, Selenium, or Cypress to automate testing workflows.

  • Generate and interpret test reports to identify bugs, performance issues, or service failures.

Setup and execute Monolith-App

  1. Download and extract the file Lab-6-1.zip.

  2. Open Visual Studio Code and open the folder of the directory where the folders and files were extracted. Navigate to the folder named Monolith-App.

  3. Open the terminal and ensure that you are on the root folder of Monolith-App.

  4. Type the following commands and press enter:

npm install
npm run start

Monolith Manual Testing

  1. Load the monolith app by opening your browser and typing http://localhost:3000.

  2. Manually test the app by performing CRUD operations. At a minimun try to test if the app is able to: create a new item, update an existing item, and delete an existing item.

  3. Take note of the tests that you are doing by creating a file named: monolith-manual-test.txt and recording the result of the tests that you are doing. Write down if the app's main functionality is working. Also write down if you discovered some bugs.

Monolith Automated Testing

  1. Based on the testing activities done on the previous section, use a web automation tool ie: Selenium or Cypress of your choice and create a script that will automate the manual CRUD activities.

  2. Run the script, take a screenshot of the results and name it monolith-automated-test.png.

Setup and execute Microservice-BE-App

  1. Open Visual Studio Code and open the folder of the directory where the folders and files were extracted. Navigate to the folder named Microservice-BE-App.

  2. Open the terminal and ensure that you are on the root folder of Microservice-BE-App.

  3. Type the following commands and press enter:

npm install
npm run start

Setup and execute Microservice-FE-App

  1. Open Visual Studio Code and open the folder of the directory where the folders and files were extracted. Navigate to the folder named Microservice-FE-App.

  2. Open the terminal and ensure that you are on the root folder of Microservice-FE-App.

  3. Type the following commands and press enter:

npm install
npm run start

Microservice Frontend Manual Testing

  1. Load the microservice frontend app by opening your browser and typing http://localhost:3001.

  2. Manually test the app by performing CRUD operations. At a minimun try to test if the app is able to: create a new item, update an existing item, and delete an existing item.

  3. Take note of the tests that you are doing by creating a file named: microservice-manual-test.txt and recording the result of the tests that you are doing. Write down if the app's main functionality is working. Also write down if you discovered some bugs.

Microservice Frontend Automated Testing

  1. Based on the testing activities done on the previous section, use a web automation tool ie: Selenium or Cypress of your choice and create a script that will automate the manual CRUD activities.

  2. Run the script, take a screenshot of the results and name it microservice-automated-test.png.

Microservice Backend Manual Testing

  1. The Microservice-BE-App has 3 endpoints that can be tested.
Method: GET
Url: http://localhost:3002/
Method: POST
Url: http://localhost:3002/
Body:
{
"countryCode":"CA",
"countryName":"Canada"
}
Method: DELETE
Url: http://localhost:3002/countryCode
  1. Use Postman to test the 3 endpoints. Take a screenshot and name them: get.png, post.png, and delete.png.

Submission

  1. Create a folder named submit.

  2. Copy all (monolith-manual-test.txt,monolith-automated-test.png, microservice-manual-test.txt, microservice-automated-test.png, get.png, post.png, and delete.png ) the previously saved screenshots / files to this folder.

  3. Copy the node automated apps / script that was used for testing.

danger

Ensure that the node_modules folder is not included when submitting your work.

  1. Create a zip file of this folder.

  2. Navigate back to where the lab was originally downloaded, there should be a Submissions section (see below) where the zip file can be uploaded.

submission