Guided Project: Lunch Ordering Service
Project Overview
In this guided project, you'll develop functional requirements and test cases for a Lunch Ordering Service application. This service allows employees to order lunch from partner restaurants for delivery to their workplace. You'll practice writing clear, testable requirements and comprehensive test cases to verify the application's behavior.
Business Context
A tech company wants to streamline lunch ordering for its employees. They're partnering with local restaurants to offer a variety of food options delivered to the office. The application needs to handle ordering, payment processing, delivery scheduling, and special dietary requirements.
Functional Requirements
Lunch Ordering Service Core Requirements
The application must allow users to:
- Browse menus from multiple partner restaurants
- Filter food options based on dietary restrictions (vegetarian, gluten-free, etc.)
- Place lunch orders with customizations
- Schedule deliveries for specific dates and time slots
- Process payments through multiple methods (credit card, company account)
- Track order status in real-time
- Cancel orders (with restrictions based on time to delivery)
- Leave reviews for restaurants and specific menu items
Use Cases
UC001: Place Lunch Order
Primary Actor: Employee
Preconditions:
- User is authenticated and logged into the application
- At least one restaurant is available for ordering
- Current time is within the ordering window (before 10:30 AM for same-day delivery)
Steps:
- User selects "Place New Order" from the dashboard
- System displays a list of available restaurants
- User selects a restaurant
- System displays menu items with prices and dietary information
- User selects one or more menu items
- User customizes items if needed (e.g., "no onions")
- User selects delivery date and time slot
- User selects payment method
- User confirms the order
- System processes payment
- System confirms the order and provides order tracking number
Postconditions:
- Order is created in the system with status "Confirmed"
- Payment is processed successfully
- Restaurant is notified of the new order
- User receives order confirmation via email
- Order appears in user's order history
Alternative Flows:
- Payment fails: System notifies user and allows them to try a different payment method
- Time slot unavailable: System suggests alternative time slots
UC002: Filter Menu by Dietary Restrictions
Primary Actor: Employee
Preconditions:
- User is viewing a restaurant's menu
- Menu items have dietary information available
Steps:
- User selects "Filter Options" button
- System displays available dietary filters (vegetarian, vegan, gluten-free, nut-free, etc.)
- User selects one or more dietary filters
- User applies filters
- System displays only the menu items that match the selected dietary restrictions
Postconditions:
- Only menu items matching the dietary restrictions are visible
- Filter selections remain active until cleared by the user
UC003: Cancel an Order
Primary Actor: Employee
Preconditions:
- User has at least one active order
- The order's scheduled delivery time is more than 1 hour in the future
Steps:
- User navigates to "My Orders" section
- User selects the order to cancel
- User clicks "Cancel Order" button
- System requests confirmation
- User confirms cancellation
- System processes cancellation and initiates refund if applicable
Postconditions:
- Order status is updated to "Cancelled"
- Restaurant is notified of the cancellation
- User receives cancellation confirmation
- Payment is refunded to the user (if within refund policy timeframe)
Alternative Flows:
- Order is within 1 hour of delivery: System prevents cancellation and displays message about cancellation policy
Test Cases
TC001: Successful Order Placement
Test Case ID: TC001
Description: Verify that a user can successfully place a lunch order
Related Use Case: UC001
Preconditions:
- User is logged in
- Current time is 9:00 AM (within ordering window)
- "Pasta Palace" restaurant is available
- User has a valid credit card on file
Test Steps:
- Click "Place New Order" button on dashboard
- Select "Pasta Palace" from restaurant list
- Select "Spaghetti Carbonara" from menu
- Add customization: "Extra cheese"
- Select today's date and 12:30 PM delivery slot
- Select "Saved Credit Card" as payment method
- Click "Confirm Order" button
Expected Results:
- Order confirmation screen is displayed
- Order tracking number is provided
- Order status shows "Confirmed"
- Confirmation email is sent to user's email address
- Order appears in "My Orders" section with correct details
- Credit card is charged the correct amount ($12.99 + tax)
TC002: Menu Filtering by Dietary Restriction
Test Case ID: TC002
Description: Verify that menu items can be filtered by dietary restrictions
Related Use Case: UC002
Preconditions:
- User is logged in
- User is viewing "Global Cuisine" restaurant menu
- Menu contains items with various dietary properties
Test Steps:
- Note the total number of menu items displayed
- Click "Filter Options" button
- Select "Vegetarian" checkbox
- Select "Gluten-Free" checkbox
- Click "Apply Filters" button
Expected Results:
- Only menu items that are both vegetarian and gluten-free are displayed
- Filter indicators are shown at the top of the menu
- Each displayed item shows both the "Vegetarian" and "Gluten-Free" icons
- Number of items displayed is less than the initial count
TC003: Order Cancellation Within Policy Timeframe
Test Case ID: TC003
Description: Verify that orders can be cancelled when more than 1 hour before delivery
Related Use Case: UC003
Preconditions:
- User is logged in
- User has an active order with status "Confirmed"
- Order is scheduled for delivery at 1:00 PM
- Current time is 11:30 AM (90 minutes before delivery)
Test Steps:
- Navigate to "My Orders" section
- Select the order for 1:00 PM delivery
- Click "Cancel Order" button
- Confirm cancellation in the dialogue
Expected Results:
- Cancellation confirmation message is displayed
- Order status is updated to "Cancelled"
- Refund information is displayed
- Cancellation confirmation email is sent
TC004: Order Cancellation Outside Policy Timeframe
Test Case ID: TC004
Description: Verify that orders cannot be cancelled when less than 1 hour before delivery
Related Use Case: UC003
Preconditions:
- User is logged in
- User has an active order with status "Confirmed"
- Order is scheduled for delivery at 1:00 PM
- Current time is 12:15 PM (45 minutes before delivery)
Test Steps:
- Navigate to "My Orders" section
- Select the order for 1:00 PM delivery
- Attempt to click "Cancel Order" button (if available)
Expected Results:
- "Cancel Order" button is disabled or not shown
- Message is displayed explaining cancellation policy
- Order status remains "Confirmed"
- No refund is processed
Implementation Plan
Project Phases
-
Requirements Gathering and Analysis
- Interview stakeholders to understand business needs
- Document functional and non-functional requirements
- Prioritize features for implementation
- Create user personas and scenarios
-
Design and Architecture
- Design database schema for order management
- Create API specifications for restaurant integration
- Design user interface wireframes
- Define system architecture and components
-
Implementation
- Set up development environment
- Implement restaurant menu browsing functionality
- Develop order placement and tracking features
- Integrate payment processing system
- Implement notification services
-
Testing
- Develop comprehensive test plan
- Write unit tests for core functionality
- Perform integration testing with restaurant APIs
- Conduct user acceptance testing
- Identify and fix bugs and issues
-
Deployment and Maintenance
- Deploy application to production environment
- Monitor system performance and user feedback
- Implement enhancements based on user input
- Scale system as user base grows
Sample Java Implementation for Order Processing
public class LunchOrder { private String orderId; private User customer; private Restaurant restaurant; private List<MenuItem> items; private LocalDateTime deliveryTime; private OrderStatus status; private PaymentMethod paymentMethod; private double totalAmount; // Constructor, getters, setters public boolean isEligibleForCancellation() { LocalDateTime now = LocalDateTime.now(); return now.plusHours(1).isBefore(deliveryTime); } public void cancel() throws OrderException { if (!isEligibleForCancellation()) { throw new OrderException("Orders can only be cancelled at least 1 hour before delivery"); } this.status = OrderStatus.CANCELLED; // Process refund logic } public void addCustomization(MenuItem item, String customization) { // Add customization to menu item } // Other methods for order processing }