Shopping Platform Architecture Overview for QEs
A practical guide to understanding the enterprise e-commerce platform architecture from a testing perspective
Understanding the Platform You're Testing
As a QE in an Enterprise Shopping & Buying Platform, you need to understand the system architecture to test effectively. This guide provides a testing-focused view of typical e-commerce platform components.
High-Level Architecture
┌─────────────────────────────────────────────────────────┐
│ Customer-Facing Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Web App │ │ Mobile App │ │ Mobile Web │ │
│ │ (React/ │ │ (iOS/ │ │ (Responsive)│ │
│ │ Next.js) │ │ Android) │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────┘
↓ REST/GraphQL APIs
┌─────────────────────────────────────────────────────────┐
│ API Gateway Layer │
│ (Authentication, Rate Limiting, Routing) │
└─────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────┐
│ Microservices Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Product │ │ Cart & │ │ Payment │ │ Order │ │
│ │ Catalog │ │ Checkout │ │ Service │ │ Mgmt │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Inventory │ │ Pricing │ │ User │ │Notification│ │
│ │ Service │ │ Service │ │ Service │ │ Service │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────┐
│ Data Layer │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
│ │ PostgreSQL │ │ MongoDB │ │ Redis │ │
│ │ (Orders, │ │ (Product │ │ (Cache, │ │
│ │ Users) │ │ Catalog) │ │ Sessions) │ │
│ └────────────┘ └────────────┘ └────────────┘ │
└─────────────────────────────────────────────────────────┘Core Services: What They Do & How to Test
1. Product Catalog Service
What it does:
- Manages product data (SKUs, titles, descriptions, images)
- Handles product search and filtering
- Provides product recommendations
- Manages categories and attributes
Testing approach:
@Test
public void testProductSearch() {
// Test search by keyword
Response response = given()
.queryParam("q", "laptop")
.queryParam("page", 1)
.queryParam("limit", 20)
.when()
.get("/api/v1/products/search")
.then()
.statusCode(200)
.extract().response();
// Verify results structure
assertEquals(20, response.jsonPath().getList("products").size());
assertTrue(response.jsonPath().getString("products[0].title")
.toLowerCase().contains("laptop"));
}Key test scenarios:
- Search with valid/invalid keywords
- Filter by category, price range, brand
- Product details retrieval
- Image availability and URLs
- Handling out-of-stock products
- Performance: Search response time < 500ms
2. Shopping Cart & Checkout Service
What it does:
- Add/remove/update items in cart
- Apply discount codes and promotions
- Calculate totals (subtotal, tax, shipping)
- Manage cart persistence across sessions
- Handle multi-step checkout flow
Testing approach:
@Test
public void testAddToCartAndCheckout() {
// Step 1: Add item to cart
String cartId = given()
.body("{ \"sku\": \"LAPTOP-123\", \"quantity\": 2 }")
.contentType("application/json")
.when()
.post("/api/v1/cart/items")
.then()
.statusCode(201)
.extract().path("cartId");
// Step 2: Apply discount
given()
.pathParam("cartId", cartId)
.body("{ \"code\": \"SAVE10\" }")
.when()
.post("/api/v1/cart/{cartId}/discount")
.then()
.statusCode(200)
.body("discount.amount", equalTo(10.0));
// Step 3: Initiate checkout
given()
.pathParam("cartId", cartId)
.body(checkoutPayload)
.when()
.post("/api/v1/checkout/{cartId}")
.then()
.statusCode(200)
.body("status", equalTo("pending_payment"));
}Key test scenarios:
- Cart operations: add, update quantity, remove items
- Cart persistence across browser sessions
- Invalid discount codes
- Price calculation accuracy (including tax)
- Cart limits (max items, max quantity)
- Concurrent cart modifications
- Abandoned cart recovery
3. Payment Service
What it does:
- Process payments via multiple payment gateways
- Handle credit cards, debit cards, digital wallets
- Manage refunds and chargebacks
- Ensure PCI compliance
- Fraud detection integration
Testing approach:
@Test
public void testSuccessfulPayment() {
PaymentRequest request = PaymentRequest.builder()
.orderId("ORD-12345")
.amount(99.99)
.currency("USD")
.paymentMethod("credit_card")
.cardToken("tok_visa") // Test token
.build();
Response response = given()
.body(request)
.contentType("application/json")
.when()
.post("/api/v1/payments/process")
.then()
.statusCode(200)
.extract().response();
assertEquals("success", response.path("status"));
assertNotNull(response.path("transactionId"));
}Critical test scenarios:
- Successful payment with valid card
- Declined payment scenarios
- Insufficient funds handling
- Invalid card details
- Payment timeout handling
- Refund processing
- Idempotency (duplicate payment prevention)
- Security: Never log real card numbers!
4. Order Management Service
What it does:
- Create and track orders
- Manage order status (processing, shipped, delivered)
- Handle order modifications and cancellations
- Integration with fulfillment systems
- Generate invoices and receipts
Testing approach:
@Test
public void testOrderCreationAndTracking() {
// Create order
String orderId = given()
.body(orderPayload)
.when()
.post("/api/v1/orders")
.then()
.statusCode(201)
.extract().path("orderId");
// Track order status
given()
.pathParam("orderId", orderId)
.when()
.get("/api/v1/orders/{orderId}")
.then()
.statusCode(200)
.body("status", equalTo("processing"))
.body("items.size()", equalTo(2))
.body("totalAmount", equalTo(199.98f));
// Verify order in database
Order dbOrder = orderRepository.findById(orderId);
assertEquals("processing", dbOrder.getStatus());
}Key test scenarios:
- Order creation with valid data
- Order status transitions
- Order cancellation (before/after shipment)
- Order history retrieval
- Order modification (address change)
- Email notifications on status change
- Data consistency across services
5. Inventory Service
What it does:
- Track stock levels for all SKUs
- Reserve inventory during checkout
- Release inventory on order cancellation
- Real-time stock updates
- Low-stock alerts
Testing approach:
@Test
public void testInventoryReservation() {
String sku = "LAPTOP-123";
// Check initial stock
int initialStock = given()
.pathParam("sku", sku)
.when()
.get("/api/v1/inventory/{sku}")
.then()
.statusCode(200)
.extract().path("availableQuantity");
// Reserve inventory
given()
.pathParam("sku", sku)
.body("{ \"quantity\": 2, \"reservationId\": \"RES-123\" }")
.when()
.post("/api/v1/inventory/{sku}/reserve")
.then()
.statusCode(200);
// Verify stock reduced
int afterReservation = given()
.pathParam("sku", sku)
.when()
.get("/api/v1/inventory/{sku}")
.then()
.extract().path("availableQuantity");
assertEquals(initialStock - 2, afterReservation);
}Critical test scenarios:
- Stock availability checks
- Inventory reservation and release
- Concurrent purchases (race conditions)
- Overselling prevention
- Stock synchronization with warehouse
- Low stock alerts
6. Pricing Service
What it does:
- Calculate product prices dynamically
- Apply discounts and promotions
- Handle tiered pricing (volume discounts)
- Manage regional pricing
- Tax calculation by location
Testing approach:
@Test
public void testDynamicPricing() {
// Get price for single item
given()
.queryParam("sku", "LAPTOP-123")
.queryParam("quantity", 1)
.queryParam("zipCode", "12345")
.when()
.get("/api/v1/pricing/calculate")
.then()
.statusCode(200)
.body("basePrice", equalTo(999.99f))
.body("tax", greaterThan(0f))
.body("finalPrice", greaterThan(999.99f));
// Test volume discount
given()
.queryParam("sku", "LAPTOP-123")
.queryParam("quantity", 10)
.when()
.get("/api/v1/pricing/calculate")
.then()
.statusCode(200)
.body("discount", greaterThan(0f));
}Key test scenarios:
- Base price retrieval
- Discount application (percentage vs. fixed)
- Tax calculation accuracy
- Promotional pricing
- Price rounding issues
- Currency conversion (if multi-region)
7. User Service
What it does:
- User registration and authentication
- Profile management
- Address management
- Password reset
- Session management
Testing approach:
@Test
public void testUserRegistrationAndLogin() {
// Register new user
String userId = given()
.body("{ \"email\": \"test@example.com\", \"password\": \"Pass123!\" }")
.when()
.post("/api/v1/users/register")
.then()
.statusCode(201)
.extract().path("userId");
// Login
String token = given()
.body("{ \"email\": \"test@example.com\", \"password\": \"Pass123!\" }")
.when()
.post("/api/v1/users/login")
.then()
.statusCode(200)
.extract().path("token");
// Access protected resource
given()
.header("Authorization", "Bearer " + token)
.when()
.get("/api/v1/users/profile")
.then()
.statusCode(200);
}8. Notification Service
What it does:
- Send order confirmation emails
- SMS notifications for shipment updates
- Push notifications for mobile apps
- Marketing emails (with opt-out)
Testing approach:
- Verify notification triggers
- Check email templates rendering
- Test SMS delivery (use test numbers)
- Validate unsubscribe functionality
- Monitor notification delivery rates
Integration Points to Test
Service-to-Service Communication
Cart Service → Inventory Service (reserve stock)
Cart Service → Pricing Service (calculate totals)
Checkout → Payment Service (process payment)
Checkout → Order Service (create order)
Order Service → Notification Service (send confirmation)
Order Service → Fulfillment System (ship products)Test approach:
- Use contract testing (Pact, Spring Cloud Contract)
- Mock downstream services for unit tests
- Integration tests with real service instances
- Monitor service dependencies and circuit breakers
External Integrations
- Payment gateways (Stripe, PayPal, etc.)
- Shipping providers (FedEx, UPS, USPS)
- Email service (SendGrid, AWS SES)
- SMS gateway (Twilio)
- Analytics (Google Analytics, Segment)
- Fraud detection services
Test approach:
- Use sandbox/test environments provided by vendors
- Mock external services for offline testing
- Test error handling for external service failures
- Monitor API quotas and rate limits
Critical User Journeys to Test End-to-End
Journey 1: Guest Checkout
- Browse products → 2. Search and filter → 3. Add to cart → 4. Apply discount → 5. Guest checkout → 6. Payment → 7. Order confirmation
Journey 2: Registered User Purchase
- Login → 2. Add items to cart → 3. Use saved address → 4. Use saved payment method → 5. Place order → 6. Track shipment
Journey 3: Order Modification
- Place order → 2. Change shipping address → 3. Verify address updated → 4. Receive at new address
Journey 4: Return & Refund
- Initiate return → 2. Generate return label → 3. Ship back → 4. Refund processed → 5. Confirmation email
Testing Environments
Local Development
- Run services locally with Docker Compose
- Use local databases with test data
- Mock external dependencies
- Fast feedback for developers
QA Environment
- Full platform deployed in cloud
- Shared among QA team
- Automated tests run here
- Manual exploratory testing
Staging Environment
- Production-like setup
- Performance testing
- Pre-release validation
- Limited access
Production
- Live customer traffic
- Monitoring and alerting
- Smoke tests only
- Synthetic transaction monitoring
Common Architecture Patterns to Understand
1. Circuit Breaker
When a service is down, stop calling it repeatedly—fail fast instead.
Test: Simulate service downtime, verify graceful degradation.
2. Rate Limiting
Prevent abuse by limiting API calls per user/IP.
Test: Make rapid API calls, verify 429 Too Many Requests.
3. Caching
Store frequently accessed data in Redis to reduce database load.
Test: Verify cache hits, cache invalidation on updates.
4. Event-Driven Architecture
Services communicate via message queues (RabbitMQ, Kafka).
Test: Verify events published, consumed correctly.
5. API Versioning
Support multiple API versions for backward compatibility.
Test: Verify both /api/v1/ and /api/v2/ endpoints.
Monitoring & Observability
What to Monitor as a QE
- Response times: API latency, page load times
- Error rates: 4xx and 5xx errors
- Success rates: Checkout completion, payment success
- Resource usage: CPU, memory, database connections
- Business metrics: Orders per minute, revenue per hour
Tools You'll Use
- Logs: Splunk, ELK stack, CloudWatch
- Metrics: Grafana, Datadog, New Relic
- Tracing: Jaeger, Zipkin (distributed tracing)
- Alerts: PagerDuty for production incidents
Key Takeaways for QE
-
Understand data flow: Where does cart data come from? How does it reach the order service?
-
Know integration points: Which services depend on each other? What happens if one fails?
-
Test for failures: Network errors, service timeouts, database unavailability
-
Verify data consistency: Is the cart total correct? Does inventory decrease after purchase?
-
Performance matters: 2-second checkout delay can lose millions in revenue
-
Security is critical: Test authentication, authorization, data encryption
-
Think like a hacker: Try SQL injection, XSS, unauthorized access
-
Monitor production: Use logs and metrics to understand real user behavior
Next Steps
- Draw the architecture diagram for your platform
- Identify the services your team owns
- Map API endpoints and their purposes
- Set up local environment and run services
- Execute a complete user journey manually
- Write your first API integration test
Understanding the architecture transforms you from someone who just runs tests to a QE who designs comprehensive testing strategies. Keep this guide handy and refer back as you learn more about your platform!
Comments (0)
Loading comments...