By ATS Staff - October 3rd, 2026
FastAPI Next.js Nginx PostgreSQL
A thorough web application testing plan should verify that the application works correctly, is secure, performs well under load, is accessible, and remains stable during updates and deployment.
For a modern web application built with Next.js, FastAPI, PostgreSQL, and Nginx on Ubuntu, testing should cover the frontend, backend APIs, database, infrastructure, security, performance, and end-to-end user workflows.
Overall testing lifecycle
1. Requirements & Test Planning
Define requirements, risks, test cases and acceptance criteria
2. Unit Testing
Test individual functions, components and business logic
3. Integration Testing
Test interactions between frontend, APIs, services and database
4. System & End-to-End Testing
Validate complete workflows as a real user
5. Non-Functional Testing
Security, performance, accessibility, compatibility and reliability
6. Acceptance & Release Testing
User acceptance, regression testing and production readiness
Testing should be performed continuously throughout development, rather than only before deployment.
| Testing type | Purpose | Example |
|---|---|---|
| Unit testing | Validate individual functions | Verify a function calculates tax correctly |
| Component testing | Test isolated UI components | Validate a login form |
| Integration testing | Verify connected components | FastAPI endpoint reads from PostgreSQL |
| API testing | Validate HTTP endpoints | Test POST /api/users |
| End-to-end (E2E) | Test complete user journeys | Register, log in and create a record |
| Functional testing | Verify business requirements | Confirm a subscription is saved correctly |
| Regression testing | Ensure existing features still work | Recheck login after an API update |
| Smoke testing | Verify critical functions after deployment | Check homepage, login and API health |
| Sanity testing | Validate a specific change | Verify a recently fixed search filter |
| Performance testing | Measure response times and throughput | Simulate 1,000 concurrent users |
| Load testing | Test expected usage levels | Simulate normal peak traffic |
| Stress testing | Find system breaking points | Gradually increase requests beyond expected load |
| Spike testing | Test sudden traffic increases | Simulate a sudden 10× traffic surge |
| Endurance testing | Identify long-term stability issues | Run sustained traffic for several hours |
| Security testing | Identify vulnerabilities | Test authorization and SQL injection |
| Accessibility testing | Ensure inclusive usability | Navigate forms using a keyboard |
| Compatibility testing | Verify supported environments | Test Chrome, Firefox, Safari and mobile |
| Recovery testing | Verify recovery from failures | Restart PostgreSQL and verify recovery |
| User acceptance testing | Confirm user requirements | Have business users complete real workflows |
Before testing begins, create a test case repository that maps every functional and non-functional requirement to at least one test.
Each test case should contain:
AUTH-001.| ID | Scenario | Expected result | Priority |
|---|---|---|---|
| AUTH-001 | Log in with valid credentials | User is authenticated and redirected to dashboard | Critical |
| AUTH-002 | Log in with invalid password | Access denied with a generic error | Critical |
| AUTH-003 | Submit empty login form | Validation messages are displayed | High |
| AUTH-004 | Access protected page without login | User is redirected or receives 401/403 | Critical |
| USER-001 | Create a valid user | User is saved correctly in the database | Critical |
| USER-002 | Create duplicate email | Duplicate account is rejected | High |
| API-001 | Submit malformed JSON | API returns a controlled 4xx response | High |
| DB-001 | Insert invalid foreign key | Database rejects invalid relationship | High |
| UI-001 | Open page on mobile | Layout adapts without horizontal overflow | Medium |
Frontend testing should validate visual presentation, user interactions, state management, client-side behavior and communication with the backend.
4.1 User interface and layout
4.2 Forms and validation
4.3 Frontend state and API interactions
4.4 Next.js specific checks
not-found pages and loading states.Suggested tools
The backend testing plan should cover business logic, request handling, API responses, authentication, authorization, error handling and integration with other services.
5.1 API endpoint testing
For every endpoint, test:
5.2 HTTP status code validation
| Status | Test condition |
|---|---|
200 OK | Successful read or operation |
201 Created | New resource successfully created |
204 No Content | Successful operation without a response body |
400 Bad Request | Invalid request or business rule violation |
401 Unauthorized | Missing or invalid authentication |
403 Forbidden | Authenticated user lacks permission |
404 Not Found | Resource does not exist or is not accessible |
409 Conflict | Duplicate or conflicting operation |
422 Unprocessable Content | Request validation failure |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Unexpected server-side failure |
503 Service Unavailable | Service unavailable |
Use the status codes appropriate to the application's API contract; not every endpoint needs to produce every code.
5.3 Business logic testing
5.4 Error and exception handling
Verify that users receive safe, understandable errors, while internal logs retain enough detail for debugging without exposing passwords, tokens or sensitive data.
Suggested tools
Database testing should ensure data integrity, consistency, security and acceptable query performance.
| Area | Test scenarios |
|---|---|
| CRUD operations | Create, read, update and delete records |
| Constraints | Test primary keys, unique constraints, foreign keys and check constraints |
| Relationships | Validate joins and relationships across tables |
| Transactions | Test commit, rollback and atomicity |
| Concurrency | Test simultaneous updates and inserts |
| Data validation | Test nulls, invalid formats and boundary values |
| Query performance | Identify slow queries and missing indexes |
| Connection handling | Test connection limits and reconnection |
| Migrations | Test schema upgrades and rollback procedures |
| Backup and restore | Restore database backups and verify data |
| Access control | Verify database roles and privileges |
| Data isolation | Verify tenant or user data is not exposed across boundaries |
Important database test scenarios:
Use a separate test database with synthetic data. Avoid running destructive tests against production.
Security testing should cover the application, APIs, database, server configuration, dependencies and deployment environment.
High priority
Security tests should be performed before production release and repeated after significant changes.
| Vulnerability | Testing scenarios |
|---|---|
| SQL injection | Submit malicious input in search, login and filters |
| Cross-site scripting (XSS) | Submit scripts into text fields and rich text editors |
| Cross-site request forgery (CSRF) | Test unauthorized state-changing requests |
| Broken access control | Attempt to access resources belonging to other users |
| Server-side request forgery (SSRF) | Test server-side URL fetching restrictions |
| Path traversal | Attempt to access files outside permitted directories |
| Insecure file upload | Upload malicious or disallowed file types |
| Security misconfiguration | Inspect HTTP headers, debug settings and exposed services |
| Sensitive data exposure | Check API responses, logs and browser storage |
| Insecure deserialization | Test untrusted serialized inputs |
| Rate-limit bypass | Attempt excessive requests through alternate paths |
| Dependency vulnerabilities | Scan frontend and backend packages |
Use the OWASP Top 10 as a starting point and include relevant API risks from the OWASP API Security Top 10.
For a Next.js, FastAPI, PostgreSQL and Nginx deployment, verify:
Secure, HttpOnly and SameSite attributes.Suggested security tools
Automated scans should be supplemented by manual testing, particularly for authorization and business logic vulnerabilities.
Performance testing should determine how the application behaves under normal, peak and extreme workloads.
| Test | Purpose | Example |
|---|---|---|
| Baseline | Establish normal performance | Measure response times with light traffic |
| Load | Validate expected traffic | Simulate 500 concurrent users |
| Stress | Find capacity limits | Increase load until errors or degradation |
| Spike | Test sudden increases | Jump from 100 to 1,000 virtual users |
| Endurance | Identify long-term problems | Maintain load for 4–8 hours |
| Scalability | Evaluate capacity changes | Compare performance with additional workers |
| Database performance | Find query bottlenecks | Test expensive joins and reports |
| Frontend performance | Measure page experience | Test rendering, assets and interactions |
The user counts in these examples are illustrative. Actual test loads should be based on expected usage, peak traffic and business requirements.
Example performance targets
Illustrative targets to adapt to your application's requirements, not universal standards.
API response time (p95)
< 500 ms
API error rate under expected load
< 1%
Frontend Largest Contentful Paint
≤ 2.5 s
Frontend Interaction to Next Paint
≤ 200 ms
Frontend Cumulative Layout Shift
≤ 0.1
Frontend thresholds are based on the commonly used Core Web Vitals "good" thresholds; API thresholds are example service-level targets.
Measure:
Suggested tools
The application should be usable by people with different abilities, including those using assistive technologies.
Test against WCAG 2.2, with the applicable conformance level defined by your requirements.
Recommended tools: axe DevTools, WAVE and keyboard-only manual testing.
Automated accessibility tools are useful for finding common problems but cannot establish complete accessibility conformance on their own.
Test the application across the browsers, devices and operating systems used by the intended audience.
| Environment | Testing |
|---|---|
| Chrome desktop | Main user workflows and rendering |
| Firefox desktop | Layout, forms and browser compatibility |
| Safari macOS | Rendering, cookies and interactions |
| Edge desktop | Core functionality and UI behavior |
| Chrome Android | Touch controls and responsive layouts |
| Safari iOS | Responsive behavior, keyboard and viewport |
| Tablet devices | Navigation, tables and forms |
| Small screens | Overflow, readability and touch targets |
Also test:
Use real devices for critical workflows where possible, and supplement them with browser emulation.
End-to-end testing verifies complete workflows from the user's perspective, including frontend interactions, API calls, business logic and database operations.
Example: User management workflow
Diagram options
| Workflow | Expected result |
|---|---|
| User registration | Valid account is created |
| User login | User accesses authorized pages |
| Password reset | Password is reset through a secure workflow |
| Profile management | User can view and update permitted fields |
| Record creation | Data is saved and displayed |
| Record editing | Changes persist after refresh |
| Record deletion | Record is removed or archived as specified |
| Search and filtering | Correct matching records are returned |
| Pagination | Correct records appear on each page |
| Role management | Access reflects assigned permissions |
| File upload | Supported files are uploaded and retrievable |
| Session expiration | Expired sessions cannot access protected content |
| Logout | Session is invalidated |
| Error recovery | User can recover from recoverable failures |
For each major workflow, test both the successful path and meaningful failure paths, including invalid data, insufficient permissions, interrupted network requests and backend failures.
For an Ubuntu-based deployment with Nginx, Next.js, FastAPI and PostgreSQL, infrastructure testing should cover the full request path.
Example application architecture
Browser / Client
Nginx Reverse Proxy
TLS, routing, headers, request limits
Next.js
Frontend / SSR
FastAPI
REST API / business logic
PostgreSQL
Persistent data storage
Infrastructure verification
0 / 16 complete
Verify Nginx configuration and reverse proxy routing
Validate TLS certificate and HTTPS redirection
Verify frontend and API domain routing
Check Nginx request and response size limits
Verify FastAPI process management and automatic restart
Verify PostgreSQL connection pooling and limits
Test firewall rules and exposed ports
Verify application startup after server reboot
Test log rotation and disk space management
Verify static file delivery and caching
Test health checks and service monitoring
Verify database backups are running
Perform a database restore test
Test deployment rollback
Verify secrets and production environment variables
Test behavior when individual services become unavailable
Reset checklist
Verify that the application can recover from failures without compromising data integrity.
Define:
Recovery targets should be agreed upon before conducting recovery testing.
Regression testing ensures that changes to code, configuration, dependencies or database schema do not break previously working functionality.
Run regression tests after:
Regression testing should include automated unit tests, integration tests, API tests and a targeted set of critical E2E workflows.
Suggested regression test groups
Testing should continue after deployment, using logs, metrics, traces and alerts to identify issues that might not appear in pre-release testing.
| Area | What to monitor |
|---|---|
| Nginx | Request rate, response codes, latency, upstream errors |
| Next.js | Server errors, rendering failures, request latency |
| FastAPI | Endpoint latency, exception rates, request volume |
| PostgreSQL | Connections, slow queries, locks, replication lag if applicable |
| Ubuntu | CPU, memory, disk, network and system load |
| Security | Failed logins, suspicious requests, privilege violations |
| Application | Business transaction failures and background job errors |
| Availability | Uptime, health checks and incident alerts |
Consider using:
Test that alerts actually fire when thresholds are crossed, and that sensitive information is excluded from logs and monitoring payloads.
Automated testing should be integrated into the development and deployment pipeline so that defects are identified as early as possible.
Diagram options
| Tool | Purpose |
|---|---|
| GitHub Actions | Automate testing and deployments |
| Pytest | FastAPI tests |
| Vitest | Frontend unit tests |
| Playwright | Browser automation and E2E |
| k6 | Load testing |
| Ruff | Python static checks |
| ESLint | Frontend static analysis |
| Trivy | Vulnerability and configuration scanning |
This example runs frontend and backend tests on each push or pull request. It assumes that your project has separate frontend and backend directories and that test commands are configured in each.
YAML
name: Web Application Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run test -- --run
- run: npm run build
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt
- run: pip install -r requirements.txt
- run: pip install pytest pytest-cov ruff
- run: ruff check .
- run: pytest --cov=. --cov-report=term-missing
Adjust the test commands, package versions and service dependencies to match your project. Integration tests that need PostgreSQL should run against an isolated test database, such as a CI service container.
A reliable testing strategy requires consistent test data and isolated environments.
| Category | Examples |
|---|---|
| Valid data | Correct user details and valid records |
| Invalid data | Malformed email, invalid date and missing fields |
| Boundary data | Minimum and maximum values |
| Duplicate data | Existing usernames, emails or identifiers |
| Large datasets | Thousands or millions of synthetic records |
| Security data | Injection strings, malicious uploads and unauthorized IDs |
| Concurrent data | Records being updated by multiple users |
| Edge-case data | Unicode, long strings, time zone boundaries and null values |
Development
Developer testing, debugging, local databases and mock services.
DEV
Testing / CI
Automated unit, integration, API and security tests using isolated data.
TEST
Staging
Production-like environment for E2E, acceptance, performance and deployment verification.
STAGING
Production
Live application, real user data, monitored releases and controlled smoke tests.
PROD
Each environment should have independent credentials, appropriate network access and separate database instances or schemas. Never use production data in lower environments without appropriate authorization, minimization and anonymization.
UAT validates whether the application supports real business requirements and user workflows.
Involve actual intended users, business stakeholders or designated testers.
UAT should verify:
UAT exit criteria
Every failed test should produce a defect report with enough information to reproduce, investigate and resolve the issue.
Example defect report
| Field | Example |
|---|---|
| Defect ID | BUG-104 |
| Title | Unauthorized user can access another user's record |
| Module | FastAPI authorization |
| Severity | Critical |
| Environment | Staging |
| Steps to reproduce | Log in as User A and request User B's record |
| Expected result | Access denied |
| Actual result | User B's record is returned |
| Evidence | API response and request logs |
| Status | Open |
| Assigned to | Backend developer |
| Severity | Description | Typical handling |
|---|---|---|
| Critical | Data breach, major data loss or complete service outage | Immediate investigation |
| High | Major functionality broken or serious security flaw | Prioritize before release |
| Medium | Important feature affected, with a workaround available | Schedule a fix |
| Low | Minor UI issue or low-impact defect | Fix according to release priorities |
Severity describes the impact of the defect, while priority describes how urgently the team plans to resolve it. These should be tracked separately.
Use this checklist before every production release.
In progress
0 of 28 checks passed
Functional testing
All critical requirements have corresponding passing tests
Core user workflows pass E2E tests
API validation and error handling are verified
CRUD operations and business rules are verified
Authentication and authorization tests pass
Security
Security scans have been reviewed
Authorization and access control have been tested
Secrets and sensitive data are protected
HTTPS and security headers are verified
No unresolved critical security defects remain
Performance and reliability
Expected load tests pass
No unacceptable resource bottlenecks remain
Database query performance has been reviewed
Backup restoration has been tested
Monitoring and incident alerts are working
Compatibility and accessibility
Supported browsers and devices have been tested
Responsive layouts have been verified
Critical accessibility issues have been addressed
Forms and navigation are keyboard accessible
Deployment
Production build completes successfully
Database migrations have been tested
Rollback procedure is documented
Production environment variables are verified
Deployment smoke tests pass
Acceptance
UAT is complete
Known defects are documented
Release notes are prepared
Required stakeholders have approved the release
Reset Copy checklist
The checklist is a tracking aid, not an automatic release approval. Critical failures should block release unless an authorized stakeholder has explicitly accepted the risk.
| Development stage | Testing activities |
|---|---|
| Every code change | Linting, static analysis and unit tests |
| Every pull request | Integration tests, API tests, build verification |
| Nightly | Full regression tests, dependency scans |
| Before staging release | E2E, migration and smoke tests |
| Before production release | Security, load, accessibility and UAT |
| Immediately after deployment | Smoke tests, health checks and monitoring |
| Weekly or monthly | Extended regression, vulnerability review and recovery tests |
| After major infrastructure changes | Performance, security and disaster recovery tests |
The frequency should be adjusted to the application's risk, release pace and operational requirements.
Code coverage can help identify untested code, but coverage alone does not establish software quality.
Illustrative coverage objectives
| Test area | Example objective |
|---|---|
| Backend unit test coverage | ≥ 80% |
| Critical business logic | ≥ 90% |
| Frontend unit and component coverage | ≥ 75% |
| Critical API endpoint coverage | 100% of defined critical cases |
| Critical E2E workflows | 100% of identified workflows |
| Critical security scenarios | 100% of defined test cases |
These are suggested planning targets rather than universal release standards. Teams should prioritize meaningful assertions, branch coverage for complex logic and risk-based test scenarios rather than pursuing coverage percentages without validating behavior.
For a Next.js + FastAPI + PostgreSQL + Nginx application, a practical implementation plan is:
Build testing into the application development lifecycle from the beginning. Automate repetitive checks, manually test areas involving business judgment and user experience, and use risk-based release criteria.
For this technology stack, a combination of Pytest + Vitest or Jest + Playwright + k6 + OWASP ZAP + GitHub Actions provides a practical foundation for comprehensive application testing.