← Back to Home

Module 1: Functional Requirements

Module Overview

In this module, you'll learn how to create effective functional requirements for your Java applications. You'll understand how to identify and document requirements that are testable, measurable, and implementable.

Learning Objectives

Key Topics

Introduction to Functional Requirements

Learn the basics of functional requirements and why they're important for software development.

Understanding Functional Requirements

Functional requirements describe functions the software must perform. They define what the system should do, such as:

  • The order number retriever function shall throw an Exception when the provided order number is invalid
  • The ATM shall log a user in when they provide a valid card and matching PIN
  • The game shall merge two blocks with the same value when the player swipes them together

Difference Between Functional and Non-Functional Requirements

While functional requirements define what a system should do, non-functional requirements describe how the system should perform:

  • The program shall require no more than 6GB of memory
  • The service shall retrieve the orders for an order ID in less than 500ms
  • The online chat shall display messages from 1000 simultaneous users

Example Java Implementation

public class OrderProcessor {
    /**
     * Processes an order based on functional requirements
     * @param orderId The unique identifier for the order
     * @throws IllegalArgumentException if the orderId is invalid
     * @return The processed order details
     */
    public Order processOrder(String orderId) {
        // Check precondition - valid orderId
        if (orderId == null || orderId.isEmpty()) {
            throw new IllegalArgumentException("OrderId cannot be null or empty");
        }
        
        // Process the order
        Order order = retrieveOrder(orderId);
        
        // Check postcondition - order must be valid
        if (order == null) {
            throw new IllegalStateException("Could not retrieve a valid order");
        }
        
        return order;
    }
}

Requirements and Use Cases

Understand both functional and non-functional requirements, and create test cases to verify them.

Read More

Testing Functional Use Cases

Learn how to test functional use cases to ensure they're working as expected.

Read More

Guided Project

Practice writing functional requirements for a guided project.

Read More

Resources

Code Resources