0
0
Testing Fundamentalstesting~8 mins

Why different testing levels catch different bugs in Testing Fundamentals - Framework Benefits

Choose your learning style9 modes available
Framework Mode - Why different testing levels catch different bugs
Folder Structure of a Typical Test Project
  project-root/
  ├── unit_tests/
  │   ├── test_module1.py
  │   └── test_module2.py
  ├── integration_tests/
  │   ├── test_integration_featureA.py
  │   └── test_integration_featureB.py
  ├── system_tests/
  │   ├── test_system_end_to_end.py
  │   └── test_system_performance.py
  ├── acceptance_tests/
  │   └── test_acceptance_criteria.py
  ├── fixtures/
  │   └── common_fixtures.py
  ├── utils/
  │   └── helpers.py
  ├── config/
  │   └── test_config.yaml
  └── README.md
  
Test Framework Layers
  • Unit Tests Layer: Tests small pieces of code like functions or classes. Catches bugs in logic or calculations early.
  • Integration Tests Layer: Tests how different parts work together. Finds bugs in data flow or interface mismatches.
  • System Tests Layer: Tests the whole application as a user would. Catches bugs in workflows, performance, and environment issues.
  • Acceptance Tests Layer: Validates the app meets business needs and user requirements. Finds missing features or incorrect behavior.
  • Utilities Layer: Helper functions and common code used by tests.
  • Configuration Layer: Settings for environments, browsers, credentials, and test data.
Configuration Patterns

Use separate config files or environment variables to manage:

  • Environments: dev, test, staging, production URLs and settings.
  • Browsers/Platforms: Specify which browsers or devices to run tests on.
  • Credentials: Store test user names and passwords securely.
  • Test Data: Use fixtures or data files to provide input data for tests.

Example: test_config.yaml with environment URLs and credentials.

Test Reporting and CI/CD Integration
  • Generate clear test reports showing passed and failed tests with details.
  • Integrate with CI/CD pipelines to run tests automatically on code changes.
  • Use tools like Jenkins, GitHub Actions, or GitLab CI to trigger tests and collect results.
  • Send notifications on test failures to developers and testers.
Framework Design Principles
  1. Layered Testing: Organize tests by levels to catch bugs early and in context.
  2. Clear Separation: Keep unit, integration, system, and acceptance tests in separate folders.
  3. Reusable Fixtures: Use common setup code to avoid duplication and keep tests clean.
  4. Configurable Environments: Allow easy switching between test environments without code changes.
  5. Automated Reporting: Provide fast feedback with detailed reports integrated into development workflow.
Self Check Question

Where in this folder structure would you add a new test that checks if two modules work correctly together?

Key Result
Organize tests in layers to catch different bugs early and clearly.