E-Commerce Architecture
E-commerce platforms are among the most complex web applications, combining catalog management, real-time inventory, payment processing, and logistics into a seamless customer experience. Every bug in the purchase flow directly translates to lost revenue.
Core Components
- Product Catalog: Product data, categories, attributes, images, pricing, and variants (size, color)
- Search Engine: Product search with relevance ranking, filters, faceted navigation, and autocomplete
- Shopping Cart: Temporary storage of selected items with quantity, pricing, and discount calculations
- Checkout: Multi-step process: address, shipping method, payment, order confirmation
- Payment Processing: Integration with payment gateways (Stripe, PayPal, Adyen) for card and alternative payments
- Order Management: Order lifecycle from placement through fulfillment, shipping, and returns
- Inventory Management: Stock levels, warehouse allocation, backorder handling
Critical E-Commerce Test Scenarios
Cart Operations
The shopping cart is the bridge between browsing and buying:
| Scenario | Expected Behavior |
|---|---|
| Add item | Cart updates count, shows item, calculates subtotal |
| Update quantity | Price recalculates, inventory check validates availability |
| Remove item | Item removed, totals recalculate, empty cart state handled |
| Cart merge on login | Guest cart merges with saved cart, conflicts resolved |
| Cart expiration | Items released back to inventory after timeout |
| Price change | Customer notified if price changed since adding to cart |
Checkout Flow
Test the complete flow for:
- Guest checkout vs. registered user checkout
- Address validation and suggestions
- Multiple shipping methods with correct pricing
- Discount code application (single, stacking rules)
- Payment with 3D Secure authentication
- Order confirmation email with correct details
Inventory Management
Preventing overselling requires testing concurrent scenarios:
Scenario: Last item in stock
- User A adds item to cart
- User B adds same item to cart
- User A completes checkout
- User B attempts checkout → should fail with "out of stock" message
Search and Discovery Testing
Product search directly affects conversion rates:
- Relevance: Search for “red dress” returns red dresses, not red shoes or blue dresses
- Typo tolerance: “iphon” should still find iPhone products
- Filters: Category, price range, brand, size, color — all combinations work correctly
- Sorting: Price low-to-high, rating, newest, best-selling — all produce correct order
- Empty results: Helpful message with suggestions, not a dead end
Advanced E-Commerce Testing
Flash Sale and High Traffic Testing
Flash sales create extreme concurrency:
- Thousands of users attempting to buy limited inventory simultaneously
- Payment gateway must handle the spike without timeouts
- Inventory must be accurately tracked under extreme load
- Queue management for fair access when demand exceeds supply
Cross-Border Commerce
International e-commerce adds complexity:
- Multi-currency pricing and conversion
- Customs duties and import tax calculations
- Restricted products by country
- International shipping options and tracking
- Localized payment methods (iDEAL in Netherlands, PIX in Brazil)
Subscription Commerce
Recurring purchases have unique testing needs:
- Subscription creation, modification, and cancellation
- Recurring payment processing and failure handling
- Delivery schedule management
- Price change notifications for existing subscribers
Hands-On Exercise
Design an end-to-end test plan for a checkout flow:
- Guest checkout: Complete purchase without account, verify order confirmation
- Address validation: Test invalid addresses, PO boxes, international addresses
- Shipping methods: Verify pricing for standard, express, and same-day delivery
- Discount codes: Apply valid code, expired code, minimum purchase requirement not met
- Payment: Test successful payment, declined card, 3D Secure challenge
- Order confirmation: Verify email with correct items, prices, shipping address, and estimated delivery
Solution Guide
Guest checkout tests:
- Complete purchase with valid data — verify order created
- Navigate away during checkout and return — verify cart preserved
- Verify guest can track order via email link without account
Discount code tests:
- Valid 20% code on $100 order: verify $80 total
- Expired code: clear error message, original price maintained
- Minimum $50 code on $30 order: error explaining minimum not met
- Two codes: verify stacking rules (allowed or “one code per order”)
Payment tests:
- Successful Visa payment: order confirmed, inventory decremented
- Declined card: clear error, order not created, inventory not decremented
- 3D Secure: complete challenge, verify order creation after authentication
Pro Tips
- Test the cart across sessions and devices — cart merge on login is a common bug source
- Verify inventory is reserved at checkout, not just at cart addition — race conditions cause overselling
- Test with products at $0.01 and maximum price — boundary values reveal calculation bugs
- Always test tax calculation with multiple jurisdictions (US state tax, EU VAT, zero-tax items)
- Test email sending for every order state change — confirmation, shipped, delivered, refund
Key Takeaways
- E-commerce testing directly impacts revenue — bugs in cart and checkout mean lost sales
- Concurrency testing prevents overselling and pricing errors under high traffic
- The complete purchase flow from search to returns needs end-to-end coverage
- Multi-jurisdiction tax and shipping calculation testing requires a careful combinatorial approach