UXDL Docs

Functional Testing

Verifying applications against requirements and specifications.

Functional testing is a type of black-box testing that verifies each feature of an application operates in conformance with defined requirements and technical specifications.

Core Concepts

In functional testing, the internal source code of the application is not examined. Instead, the tester (or automated script) provides inputs, captures outputs, and asserts their correctness against expected results.

This testing is applied to multiple layers of the stack:

  • User Interface (UI): Verification of page structures, navigation, and input forms.
  • APIs & Integration: Validating response payloads, status codes, and HTTP method support.
  • Databases: Ensuring data is correctly created, queried, updated, and deleted (CRUD).
  • Security Gates: Validating authentication tokens, roles, and session state enforcement.

Purpose of Functional Testing

  • Test each function of the application: Verifies that every business feature works exactly as expected when given valid and invalid inputs.
  • Test primary entry and exit functions: Checks all application boundaries, API endpoints, and user landing routes.
  • Test the GUI flow: Confirms that a user can seamlessly navigate throughout the entire application without encountering broken routes or layout errors.

Example Scenarios

1. Login Functionality

  • Verify that users can successfully log in with valid credentials.
  • Test login behavior with invalid or missing credentials, asserting that appropriate error messages are displayed.
  • Test the "Remember Me" checkbox, ensuring user sessions persist across browser restarts if selected.

2. User Registration

  • Test the signup flow to verify new accounts are successfully created.
  • Verify that required fields are validated and confirmation/verification emails are dispatched.
  • Test duplicate handling, asserting that a user cannot sign up with an already registered email or username.

3. Search & Filters

  • Test basic keyword searches to verify relevant results are returned.
  • Verify that results are displayed in a clear, paginated, and ordered layout.
  • Test advanced search options, such as filtering by category, sorting by date/price, and range inputs.

4. Data Entry Forms

  • Verify that data forms accept valid inputs and write them accurately.
  • Assert that inputs violating field constraints (e.g., maximum length, invalid email formats, non-numeric values) trigger descriptive inline validation errors.
  • Test empty form submissions, verifying that required markers prevent submission.

5. Checkout & Payments

  • Verify that users can add items to a cart, update quantities, and proceed through the checkout flow without errors.
  • Test integration with payment gateways, checking that credit card authorization succeeds or fails cleanly depending on the test card used.
  • Confirm that database entries are committed and confirmation invoices are rendered on success.

6. User Profile Management

  • Test updates to user profile information (names, passwords, avatars).
  • Confirm that profile modifications are immediately reflected across other components.
  • Verify that deactivation/deletion logic removes or hides the user account as expected.

7. Notifications & Alerts

  • Test triggers for system events (e.g., order dispatched, ticket created) and check that push notifications, SMS, or emails are delivered.
  • Verify that alerts behave correctly under concurrent updates.

8. External Integrations

  • Test communication with external APIs or third-party webhooks.
  • Verify that data is correctly synchronized between the main application and external systems.
  • Test connection timeouts and external service outages, checking that the application degrades gracefully instead of crashing.