HyperionDocs
ArchitectureSolution Designs001 - Personal Account Module

Test Design - Personal Account Module

Testing strategy for faculty personal account management

Test Design: Personal Account Module

Overview

This test design covers the Personal Account Module including authentication, profile management, department assignments, and public directory features.

Test Strategy

Scope

What will be tested:

  • Authentication flows (login, logout, refresh, password reset)
  • User profile CRUD operations
  • Department assignment management
  • Photo upload and validation
  • Public directory access
  • Role-based access control
  • Input validation and error handling

Out of Scope

What will not be tested:

  • LDAP/SSO integration (not implemented)
  • Email delivery (mocked)
  • Browser-specific UI issues
  • Mobile responsiveness

Test Levels

Unit Tests

Coverage Target: 80%

Focus Areas:

  • Password hashing and verification
  • JWT token generation and validation
  • User service business logic
  • DTO validation
  • Mapper transformations

Tools: JUnit 5, Mockito, AssertJ

Integration Tests

Focus Areas:

  • REST API endpoints
  • Database operations (JPA)
  • Redis token storage
  • File upload handling

Test Scenarios:

  1. Complete authentication cycle (login → access API → refresh → logout)
  2. User creation and assignment to departments
  3. Profile update with photo upload
  4. Public directory search and filtering

Tools: Spring Boot Test, TestContainers (PostgreSQL, Redis), MockMvc

End-to-End Tests

User Flows:

  1. Teacher Login Flow: Login → View profile → Update details → Upload photo → Logout
  2. Admin User Management: Login as admin → Create user → Assign to department → User receives email
  3. Public Directory: Visit directory → Search by name → View public profile

Tools: Cypress, Playwright

Performance Tests

Metrics:

  • Response time: < 200ms for profile operations
  • Throughput: 100 concurrent users
  • Login time: < 500ms including JWT generation

Load Scenarios:

  • Normal: 50 concurrent users
  • Peak: 200 concurrent users (semester start)
  • Stress: 500 concurrent users

Tools: k6, Gatling

Test Cases

Authentication Tests

IDTest CaseExpected ResultPriority
AUTH-001Login with valid credentials200 OK, returns access + refresh tokensCritical
AUTH-002Login with invalid password401 UnauthorizedCritical
AUTH-003Login with inactive user401 UnauthorizedHigh
AUTH-004Refresh token while valid200 OK, new tokensCritical
AUTH-005Refresh with expired token401 UnauthorizedHigh
AUTH-006Logout invalidates refresh tokenSubsequent refresh failsHigh
AUTH-007Access API with expired access token401 UnauthorizedCritical
AUTH-008Password reset sends email200 OK, email queuedHigh
AUTH-009Set password with valid token200 OK, can loginHigh
AUTH-010Set password with expired token400 Bad RequestMedium

Profile Management Tests

IDTest CaseExpected ResultPriority
PROF-001Get own profile200 OK, returns user dataCritical
PROF-002Update own profile (name)200 OK, data persistedHigh
PROF-003Update profile with invalid email400 Bad RequestHigh
PROF-004Upload valid photo (JPEG)200 OK, URL returnedMedium
PROF-005Upload oversized photo (>5MB)400 Bad RequestMedium
PROF-006Upload invalid file type400 Bad RequestMedium
PROF-007Change password200 OK, old password invalidHigh
PROF-008Change password with wrong old password400 Bad RequestHigh

Admin User Management Tests

IDTest CaseExpected ResultPriority
ADMIN-001Create user as admin201 Created, user in DBCritical
ADMIN-002Create user as teacher (non-admin)403 ForbiddenCritical
ADMIN-003Create user with duplicate email409 ConflictHigh
ADMIN-004Assign user to department201 CreatedHigh
ADMIN-005Assign user to same department twice409 ConflictMedium
ADMIN-006Remove user from department204 No ContentHigh
ADMIN-007Deactivate user204 No Content, user.active=falseHigh
ADMIN-008List users with pagination200 OK, paginated responseMedium

Public Directory Tests

IDTest CaseExpected ResultPriority
PUB-001List public users (unauthenticated)200 OK, limited fieldsHigh
PUB-002Search users by name200 OK, filtered resultsHigh
PUB-003Get user by UUID200 OK, public profileHigh
PUB-004Get user by internal ID404 Not FoundMedium
PUB-005Public response excludes sensitive dataNo password, workload, etc.Critical

Edge Cases

IDTest CaseExpected ResultPriority
EDGE-001Concurrent profile updatesOptimistic lock exceptionMedium
EDGE-002Login during password changeOld session invalidatedMedium
EDGE-003Unicode characters in name fieldsStored and displayed correctlyMedium
EDGE-004Empty search queryReturns all (paginated)Low
EDGE-005User with no departmentsValid profile, empty arrayMedium

Security Testing

  • Auth bypass: Cannot access protected endpoints without token
  • Role escalation: Teacher cannot perform admin actions
  • SQL injection: All inputs parameterized
  • XSS prevention: Output encoding in responses
  • Password security: Hashed with BCrypt, not in logs
  • Token security: HTTPOnly cookies, short TTL
  • File upload: Type validation, no path traversal

Acceptance Criteria

  • All critical path tests pass
  • No high-priority bugs
  • 80% unit test coverage
  • < 200ms response time for profile operations
  • Security tests pass
  • API matches OpenAPI specification

References