0% found this document useful (0 votes)
3 views5 pages

Chapter4 EvaluationTesting

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Chapter4 EvaluationTesting

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CHAPTER IV EVALUATION AND TESTING

4.1 Introduction
This chapter covers the testing and evaluation methodology applied to ShopEase. A

multi-layered testing strategy was followed — unit testing, integration testing, and system

testing — to verify functional correctness, module interaction, and end-to-end behavior.

Testing was performed iteratively alongside development, with each module tested before

integration.

4.2 Testing Strategy


The testing approach for ShopEase consisted of three levels:

Unit Testing — Individual service methods and utility classes were tested in isolation

using JUnit 5 and Mockito for mocking dependencies such as repositories and email

services.

Integration Testing — Complete flows spanning controllers, services, and repositories

were tested using Spring Boot Test and MockMvc to simulate HTTP requests and assert

responses.

System Testing — End-to-end scenarios were manually executed across all three user

roles to verify that the full application behaves as per requirements. Figure 4.1, 4.2, and

4.3 illustrate the testing summaries.

PAGE
4.3 Unit Testing
Unit tests targeted the business logic layer (service classes) where core computations,

validations, and state transitions occur. Mock objects replaced real database and cloud

service dependencies to isolate each unit under test.

Table 4.1 Unit Testing Results


Test Component Test Description Expected Output Result
ID

UT-01 OtpService Generate and send OTP to 6-digit OTP sent PASS
valid email successfully

UT-02 OtpService Validate correct OTP within OTP verified, account PASS
expiry activated

UT-03 OtpService Validate expired OTP Validation failure PASS


exception thrown

UT-04 ProductService Change product status to Status updated in DB PASS


APPROVED

UT-05 ProductService Change product status to Status + rejection reason PASS


REJECTED with reason saved

UT-06 OrderService Calculate order total for 3 Total = 425.00 PASS


items (100, 250, 75)

UT-07 SpecValidator Submit spec with missing ValidationException PASS


required field thrown

UT-08 SpecValidator Submit complete valid spec Spec saved as JSON PASS
blob

UT-09 CloudinaryHelper Upload valid image file Cloudinary URL PASS


returned

UT-10 AuthService Login with wrong password Authentication failure PASS


returned

4.4 Integration Testing


Integration tests verified end-to-end flows across multiple application layers. Spring Boot

Test loaded the full application context, and MockMvc simulated HTTP requests to assert

controller behaviour and database outcomes.

Table 4.2 Integration Testing Results

PAGE
Test Flow Tested Expected Result Result
ID

IT-01 Customer registers → OTP sent Account active; session PASS


→ OTP verified → Login created

IT-02 Merchant adds product → Admin Product visible on customer PASS


approves → Customer views listing page
listing

IT-03 Customer adds to cart → Order in DB; confirmation PASS


Checkout → Order saved → email received
Email sent

IT-04 Merchant adds fashion specs → Specifications rendered PASS


Customer views on product page correctly via REST

IT-05 Admin rejects product → Rejection reason displayed in PASS


Merchant views rejection reason merchant dashboard

IT-06 Customer orders out-of-stock Error displayed; order not PASS


product persisted

IT-07 Merchant sends reply in Message stored; customer PASS


messaging module inbox updated

IT-08 Customer resets password via New password active; old PASS
OTP flow password rejected

4.5 System Testing


System testing evaluated the complete application against specified requirements across

all user roles. Both happy-path and negative scenarios were covered. Figure 4.3 shows the

system testing overview.

Table 4.3 System Testing Results


Test Scenario Role Expected Result Status
ID

ST-01 Admin approves 10 Admin All 10 visible to customers PASS


products

ST-02 Multiple customers order Customer Stock decremented PASS


same product correctly; no oversell
simultaneously

ST-03 Customer accesses /admin Customer Redirected to customer PASS


URL directly home page

ST-04 Merchant uploads 4 MB Merchant Image stored on Cloudinary; PASS


product image URL saved

PAGE
ST-05 Order confirmation email on Customer HTML email received with PASS
checkout full order details

ST-06 Invalid OTP entered during Customer Error message shown; PASS
registration account not activated

ST-07 Product keyword search Customer Relevant approved products PASS


returned

ST-08 Session timeout scenario All roles User redirected to login PASS
page

ST-09 Admin dashboard loads Admin User count, product count, PASS
with all stats order count displayed

ST-10 Docker container startup System App accessible on PASS


configured port

4.6 Test Cases and Expected Outputs


Table 4.4 presents selected detailed test cases covering critical functional paths across

all modules. Figure 4.4 shows a test execution screenshot.

Table 4.4 Test Cases and Expected Outputs


TC Module Input Expected Output Actual Output Status
ID

TC- Auth Valid email + Account activated Account activated PASS


01 correct OTP

TC- Auth Login with correct Merchant Dashboard loaded PASS


02 credentials dashboard loaded
(MERCHANT)

TC- Auth Login with Error: Invalid Error shown PASS


03 incorrect password credentials

TC- Product Merchant adds Product in Status = PENDING PASS


04 product with image PENDING state

TC- Product Admin approves Product status = Status updated PASS


05 PENDING product APPROVED

TC- Spec Submit Spec saved as JSON blob stored PASS


06 CLOTHING spec JSON
with all required
fields

TC- Spec Submit spec Validation error Error displayed PASS


07 missing required shown
field

TC- Order Customer places Order saved; stock Order in DB PASS

PAGE
08 order for 2 items reduced

TC- Email Order placed by HTML email Email received PASS


09 customer dispatched

TC- Messaging Customer sends Message stored; Message saved PASS


10 message to merchant notified
merchant

4.7 Performance Observations


Basic performance was assessed on a local machine (Intel Core i5, 16 GB RAM).

Average page load time was approximately 350 ms. Product listing queries with indexing

completed under 100 ms. Cloudinary image delivery via CDN averaged 800 ms to 1.5

seconds depending on network. Email dispatch via Spring Mail averaged 2–5 seconds. No

errors were observed under 10 concurrent simulated requests.

4.8 Summary
All critical unit, integration, and system test cases passed successfully. The ShopEase

platform correctly handles multi-role access control, product lifecycle management, order

processing, email notifications, and dynamic specifications. Identified areas for

improvement include server-side pagination for large product catalogs, HTTPS

enforcement for production, and input sanitization enhancements.

PAGE

You might also like