Search for Well Architected Advice
< All Topics
Print

Test and validate changes

Testing and Validating Changes for Quality Assurance
Testing and validating changes are crucial for avoiding errors in production and ensuring high-quality deployments. By implementing comprehensive testing throughout the development and deployment process, teams can identify potential issues early, reduce defects, and ensure changes meet quality standards. This involves testing not only application code but also infrastructure, configurations, security controls, and operational procedures.

Comprehensive Testing of All Changes

Ensure that all changes—whether related to application code, infrastructure, configurations, security, or operations—are thoroughly tested. Each change must be validated to avoid introducing errors into production. Comprehensive testing helps ensure the stability and security of your application and workload.

Move Testing “Left” in the Process

Move testing further to the left in the software integration and delivery process, meaning that tests are performed earlier in the development lifecycle. Early testing allows teams to catch defects sooner, making remediation faster and less costly. This “shift-left” approach results in higher-quality artifacts by preventing issues from advancing through the pipeline.

Utilize a Variety of Testing Methods

Use multiple forms of testing to validate changes effectively. This includes:

  • Unit Tests: Test individual units of code to validate that they perform as expected.
  • Integration Tests: Verify that different components of the system interact as expected.
  • Infrastructure Tests: Test infrastructure as code (IaC) to ensure that provisioning and configuration changes are correct.
  • Security Testing: Conduct security assessments, such as Static Application Security Testing (SAST) and Software Component Analysis (SCA), to identify vulnerabilities.
  • Operational Testing: Test operational procedures to ensure they are effective and efficient.

Automate Testing for Continuous Integration

Integrate automated tests into the continuous integration (CI) pipeline to validate changes as soon as they are made. Automation helps ensure that testing is consistent, repeatable, and performed at each stage of the software delivery process. By automating tests, teams can detect issues quickly and maintain a high quality of releases.

Validate Changes Before Production Deployment

Ensure that changes are validated before they reach production through rigorous testing in a staging or pre-production environment. Running tests in environments that closely mirror production helps identify potential issues that could arise after deployment, thereby reducing the risk of downtime or performance problems.

Supporting Questions

  • What types of testing are performed to validate changes before production?
  • How is testing integrated into the software delivery lifecycle to identify issues early?
  • What automated testing methods are used to validate application, infrastructure, and configuration changes?

Roles and Responsibilities

Developer
Responsibilities:

  • Write and execute unit tests for application code changes to validate functionality.
  • Ensure that changes are properly tested before submitting them for integration.

QA Engineer
Responsibilities:

  • Implement and manage a comprehensive suite of tests, including integration, security, and operational tests.
  • Validate changes in staging environments before they reach production, ensuring that all aspects are functioning as intended.

DevOps Engineer
Responsibilities:

  • Integrate automated tests into the CI/CD pipeline, ensuring that all changes are tested as early as possible.
  • Maintain testing scripts and infrastructure to support automated testing across environments.

Artifacts

  • Test Coverage Report: A report outlining the types of tests performed, test coverage percentage, and any identified gaps in coverage.
  • Automated Test Scripts: Scripts used for automated testing, including unit, integration, and infrastructure tests.
  • Change Validation Checklist: A checklist used to ensure that all types of tests have been performed and passed before deployment to production.

Relevant AWS Tools

Testing and Automation Tools

  • AWS CodeBuild: Automates the build and test process, running unit and integration tests to validate changes before they are merged.
  • AWS CodePipeline: Integrates with testing tools to automate the testing of changes throughout the CI/CD process, ensuring that all changes are validated before deployment.

Infrastructure and Security Testing Tools

  • AWS CloudFormation Guard: Validates infrastructure as code (IaC) configurations against policy standards, ensuring infrastructure changes are correct and compliant.
  • Amazon Inspector: Conducts automated security assessments, identifying vulnerabilities in the application and infrastructure.

Operational Testing and Monitoring Tools

  • AWS Systems Manager: Automates operational testing of configurations and operational procedures to validate that changes will not negatively impact production.
  • Amazon CloudWatch: Monitors the application and environment during testing, providing insights into performance and identifying potential issues.
Table of Contents