Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 70 additions & 73 deletions practices/build-consistent-testing-strategy.md
Original file line number Diff line number Diff line change
@@ -1,117 +1,114 @@
# Build a Consistent Testing Strategy

Building a consistent testing strategy involves matching your approach to the specific needs of your project and considering the influence of your technology stack.
Prioritize testing critical and complex code areas, and select appropriate types of tests, such as unit, integration, and end-to-end tests.
Balance the proportion of each test type, favoring more unit tests and fewer high-cost tests like end-to-end tests.
Ensure comprehensive test coverage for new and modified code by including tests in the definition of done and verifying them during code reviews.
Manage expensive tests by regularly reviewing, deleting, and replacing them with more efficient alternatives.
Integrate tests into the continuous integration pipeline and spread knowledge of the testing strategy and best practices among the development team.
Building a consistent testing strategy means providing a structured approach to testing that aligns with project needs. It emphasizes balanced test coverage, integrates tests into CI pipelines for fast feedback, and combines automated and manual testing to ensure comprehensive quality and stability of software.

## Nuance
## When to Experiment
- You're a ...
- You're a ...

### One-Size-Fits-All Testing Strategy
## How to Gain Traction

A common misconception is that a single testing strategy can be applied to all projects.
In reality, each project has unique requirements and constraints, which means that the testing strategy must be customized accordingly.
Factors such as project size, complexity, technology stack, and team expertise influence the choice of testing tools, frameworks, and the balance of different test types.
### Evaluate Current Testing Strategy

### Balancing Test Coverage and Maintenance
- Schedule a team meeting to review your current testing strategy.
- Analyze your existing practices, tools, and processes.
- Document the strengths, weaknesses, and any gaps in your approach.
- Discuss potential improvements and prioritize them based on impact and feasibility.

While comprehensive test coverage is important, it is equally important to balance it with the maintainability of tests.
Over-ambitious coverage goals can lead to a large test suite that is difficult to maintain and slows down the development process.
Focus on covering critical paths and high-risk areas thoroughly, and ensure that tests are easy to update as the codebase evolves.
Regularly refactor tests to keep them relevant and maintainable.
### Develop a Testing Strategy Document

### Excessive End-to-End Testing
- Create a detailed testing strategy document that outlines your project's specific testing needs. Include information on test types, coverage goals, and maintenance practices.
- Share this document with your team and solicit feedback.

End-to-end tests are important for verifying the complete functionality of an application, but they are also resource-intensive and time-consuming.
Relying too heavily on end-to-end tests can slow down the continuous integration pipeline and make the testing process less efficient.
Additionally, end-to-end tests are prone to flakiness due to their reliance on multiple integrated components and external dependencies.
When these tests fail intermittently, it can be challenging to pinpoint the exact cause, leading to wasted time investigating false negatives or non-reproducible issues.
To mitigate these challenges, it's advisable to tests with more targeted unit and integration tests that provide faster feedback on specific code functionalities, reducing the overall dependency on end-to-end testing.
### Balance Your Test Pyramid

### Manual Testing is Not Obsolete
- Analyze your current distribution of unit, integration, and end-to-end tests.
- Compare it to the ideal test pyramid, which favors more unit tests, fewer integration tests, and even fewer high-cost end-to-end tests.
- Adjust your test suite to better align with this model, and observe changes in test execution times and reliability.

With the rise of automation, there is a misconception that manual testing is no longer necessary. However, manual exploratory testing plays a critical role in identifying unexpected issues and usability problems that automated tests might miss. Manual testers bring human intuition and creativity to the testing process, uncovering edge cases and user experience issues that automated scripts cannot replicate.
### Integrate Tests into Continuous Integration (CI) Pipeline

## How to Improve
- If not already done, integrate your tests into the CI pipeline. Prioritize testing critical and complex code areas.
- Ensure that all tests run automatically on each code commit.

### Host A Roundtable Discussion
### Reassess and Conduct Manual Exploratory Testing Sessions

#### Evaluate Current Testing Strategy
- After implementing changes, reassess after a few sprints to measure improvements in bug detection and code quality.
- Manage expensive tests by regularly reviewing, deleting, and replacing them with more efficient alternatives.
- Schedule regular manual exploratory testing sessions where team members test the application without predefined scripts. Focus on uncovering usability issues and edge cases.
- Compare the issues found through these sessions with those found through automated testing to understand the value added by manual exploration.

Schedule a team meeting to review your current testing strategy.
Analyze your existing practices, tools, and processes.
Document the strengths, weaknesses, and any gaps in your approach.
Discuss potential improvements and prioritize them based on impact and feasibility.
After implementing changes, reassess after a few sprints to measure improvements in bug detection and code quality.
### Share and Teach Best Practices for Testing

<!-- workshop -->
- Organize workshops, pair programming sessions, or knowledge-sharing sessions where team members can learn about and discuss testing best practices.
- Encourage the team to share their experiences and tips.
- Track how this knowledge transfer impacts the quality and consistency of your testing efforts.

### Lead a Workshop
### Host a Roundtable Discussion

#### Develop a Testing Strategy Document
You can use the following conversation prompts:

Create a detailed testing strategy document that outlines your project's specific testing needs. Include information on test types, coverage goals, and maintenance practices.
Share this document with your team and solicit feedback.
Implement the strategy and monitor its impact on your testing process and overall code quality.
#### Tailoring Your Testing Strategy

#### Balance Your Test Pyramid
* How well does our current testing strategy align with the specific needs and constraints of the project?
* What unique aspects of our project (e.g., technology stack, team expertise) might require a different testing approach?

Analyze your current distribution of unit, integration, and end-to-end tests.
Compare it to the ideal test pyramid, which suggests having more unit tests, fewer integration tests, and even fewer end-to-end tests.
Adjust your test suite to better align with this model, and observe changes in test execution times and reliability.
#### Balancing Test Coverage and Maintenance

#### Integrate Tests into Continuous Integration (CI) Pipeline
* How often do we refactor our tests to ensure they remain relevant and maintainable as our codebase evolves?
* How do we currently handle resource-intensive and time-consuming tests, such as end-to-end tests?
* Are there opportunities to replace some of these expensive tests with more efficient alternatives?

If not already done, integrate your tests into the CI pipeline.
Ensure that all tests run automatically on each code commit.
#### Integrating Manual Testing

#### Conduct Manual Exploratory Testing Sessions
* Have we considered the role of manual exploratory testing in our overall strategy?
* How can we use the creativity and intuition of manual testers to uncover issues automated tests might miss?

Schedule regular manual exploratory testing sessions where team members test the application without predefined scripts.
Focus on uncovering usability issues and edge cases.
Compare the issues found through these sessions with those found through automated testing to understand the value added by manual exploration.
#### Continuous Integration and Testing

### [Run Pair Programming Sessions](/practices/run-pair-programming-sessions.md)
* How well integrated are our tests into our CI pipeline?
* Are our tests providing timely and reliable feedback during the development process?

### Share and Educate Testing Best Practices
#### Spreading Testing Knowledge

Organize workshops or knowledge-sharing sessions where team members can learn about and discuss testing best practices.
Encourage the team to share their experiences and tips.
Track how this knowledge transfer impacts the quality and consistency of your testing efforts.
* How effectively are we communicating our testing strategy and best practices with the development team?
* What steps can we take to ensure everyone on the team understands and follows the testing strategy?

### Host A Roundtable Discussion
## Lessons From The Field

#### Tailoring Your Testing Strategy
*There Is No One-Size-Fits-All Testing Strategy*. A common misconception is that a single testing strategy can be applied to all projects.
In reality, each project has unique requirements and constraints, which means that the testing strategy must be customized accordingly.
Factors such as project size, complexity, technology stack, and team expertise influence the choice of testing tools, frameworks, and the balance of different test types.

* How well does your current testing strategy align with the specific needs and constraints of your project?
* What unique aspects of your project (e.g., technology stack, team expertise) might require a different testing approach?
*Balance Test Coverage and Test Maintenance*. While comprehensive test coverage is important, it is equally important to balance it with the maintainability of tests. Over-ambitious coverage goals can lead to a large test suite that is difficult to maintain and slows down the development process. Focus on covering critical paths and high-risk areas thoroughly, and ensure that tests are easy to update as the codebase evolves. Regularly refactor tests to keep them relevant and maintainable.

#### Balancing Test Coverage and Maintenance
*Avoid Excessive End-to-End Testing*. End-to-end tests are important for verifying the complete functionality of an application, but they are also resource-intensive and time-consuming. Relying too heavily on end-to-end tests can slow down the CI pipeline and make the testing process less efficient. Additionally, end-to-end tests are prone to flakiness due to their reliance on multiple integrated components and external dependencies.
When these tests fail intermittently, it can be challenging to pinpoint the exact cause, leading to wasted time investigating false negatives or non-reproducible issues. To mitigate these challenges, it's advisable to favor more targeted unit and integration tests that provide faster feedback on specific code functionalities, reducing the overall dependency on end-to-end testing.

* How often do you refactor your tests to ensure they remain relevant and maintainable as your codebase evolves?
* How do you currently handle resource-intensive and time-consuming tests, such as end-to-end tests?
* Are there opportunities to replace some of these expensive tests with more efficient alternatives?
*Manual Testing Is Not Obsolete.* With the rise of automation, there is a misconception that manual testing is no longer necessary. However, manual exploratory testing plays a critical role in identifying unexpected issues and usability problems that automated tests might miss. Manual testers bring human intuition and creativity to the testing process, uncovering edge cases and user experience issues that automated scripts cannot replicate.

#### Integrating Manual Testing
## Deciding to Polish or Pitch

* Have you considered the role of manual exploratory testing in your overall strategy?
* How can you use the creativity and intuition of manual testers to uncover issues automated tests might miss?
After experimenting with this practice for [**timeframe**], bring the team together to determine whether the following metrics and/or signals have changed in a positive direction.

#### Continuous Integration and Testing
### Fast & Intangible

* How well integrated are your tests into your continuous integration pipeline?
* Are your tests providing timely and reliable feedback during the development process?
**Title of benefit.** 2-4 sentences about the benefit.

#### Spreading Testing Knowledge
### Slow & Measurable

* How effectively is your testing strategy and best practices communicated and shared within your development team?
* What steps can you take to ensure everyone on the team understands and follows the testing strategy?
**Title of benefit**. 2-4 sentences about the benefit.

## Supporting Capabilities

### [Test Automation](/capabilities/test-automation.md)

Building a Consistent Testing Strategy supports the Test Automation capability by providing a structured approach to testing that aligns with project needs.
It emphasizes balanced test coverage, integrates tests into CI pipelines for fast feedback, and combines automated and manual testing to ensure comprehensive quality and stability of software delivery.
Building a Consistent Testing Strategy supports the Test Automation capability by providing a structured approach to testing that aligns with project needs. It emphasizes balanced test coverage, integrates tests into CI pipelines for fast feedback, and combines automated and manual testing to ensure comprehensive quality and stability of software delivery.

### [Continuous Delivery](capabilities/continuous-delivery.md)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two additional Capabilities (as this practice is listed on their Capability page). Please review/tweak as needed.


Building a consistent testing strategy means providing a structured approach to testing that aligns with project needs. It emphasizes balanced test coverage, integrates tests into CI pipelines for fast feedback, and combines automated and manual testing to ensure comprehensive quality and stability of software.

### [Trunk-based Development](capabilities/trunk-based-development.md)

A consistent testing strategy that balances unit and integration tests supports trunk-based development by providing fast, reliable feedback. This reduces the risk of breaking the main branch, enabling frequent, smaller merges with confidence and maintaining high development velocity.