-
Notifications
You must be signed in to change notification settings - Fork 2
Automate Test Coverage Checks (updated Practice) #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ntache-81
wants to merge
1
commit into
main
Choose a base branch
from
automate-test-coverage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,62 @@ | ||
| # Automate Test Coverage Checks | ||
|
|
||
| Automating test coverage ensures there is a baseline of test coverage for your software. | ||
| Following this practice won't guarantee the quality or reliability of your tests. As such, it's not a sufficient check by itself. | ||
| Nevertheless, it's usually a low-cost way to spot gaps in your codebase's test coverage. | ||
| Integrating these checks into CI pipelines ensures continuous validation without slowing down development. | ||
| This practice improves software quality and stability by identifying untested code early, which helps prevent bugs and regrsssions. Automating test coverage checks is a low-cost way to spot gaps in the test coverage of your codebase and to ensure there is a baseline of test coverage for your software. Simply automating test checks won't guarantee the quality or reliability of your tests, so it's not a sufficient check by itself. Integrating test coverage checks into CI pipelines ensures continuous validation without slowing down development. | ||
|
|
||
| ## Nuance | ||
| ## When to Experiment | ||
| - You're a ... | ||
| - You're a ... | ||
|
|
||
| ### Coverage Metrics vs. Test Quality | ||
| ## How to Gain Traction | ||
|
|
||
| It's important to prioritize the quality of tests over coverage percentages. | ||
| Teams may focus solely on increasing coverage numbers without ensuring that tests are effective in catching bugs and edge cases. | ||
| ### Start a Book Club | ||
|
|
||
| ### Balancing Speed and Coverage | ||
| #### [Test Coverage](https://martinfowler.com/bliki/TestCoverage.html) | ||
| In his blog post on test coverage, Martin Fowler explores the concept of test coverage as a tool for identifying untested code rather than as a definitive measure of test quality. He argues that while high test coverage percentages can highlight which parts of the code are exercised by tests, they do not necessarily indicate the *effectiveness* of those tests. Fowler emphasizes that test coverage should be used alongside other techniques and metrics to assess the robustness of tests, and that focusing solely on coverage numbers can lead to superficial or inadequate testing. He advocates for a balanced approach that combines test coverage with thoughtful test design and evaluation to achieve meaningful software quality. | ||
|
|
||
| While automating test coverage checks speeds up validation processes, overemphasizing coverage goals can lead to diminishing returns. | ||
| Setting overly ambitious coverage targets may slow down development or lead to superficial tests that don't add substantial value. | ||
| It's important to strike a balance between achieving sufficient coverage and maintaining a productive development pace. | ||
| ### Host a Roundtable Discussion | ||
| You can use the following conversation prompts: | ||
|
|
||
| ### Non-Functional Test Considerations | ||
| #### Tailoring and Adjusting Test Coverage | ||
| * Are our current coverage thresholds realistic and tailored to the specific needs of different modules within our application? | ||
| * How often do we review and adjust our coverage metrics to align with evolving project requirements? | ||
|
|
||
| Automated test coverage often focuses on functional aspects of software, such as correctness and behavior. | ||
| However, neglecting non-functional tests—like performance, security, and usability—can leave important aspects of automated test quality out. | ||
| Integrating non-functional tests into automated pipelines ensures comprehensive software validation. | ||
| For instance, performance tests can identify bottlenecks, security tests can detect vulnerabilities, and usability tests can improve user experience. | ||
| None of those types of tests fit neatly into a traditional "coverage" check. | ||
| #### Effectiveness of Test Coverage | ||
| * Do our tests catch bugs and edge cases, or are they merely boosting our coverage numbers? | ||
| * Is our automated test coverage adequately addressing non-functional testing, such as performance, security, and usability? | ||
|
|
||
| ### Continuous Improvement | ||
| #### Challenges and Lessons in Test Coverage Implementation | ||
| * Are there any cultural or organizational barriers that prevent us from fully implementing this practice? | ||
| * What lessons can we learn from past experiences to enhance our future approach to automated test coverage? | ||
|
|
||
| Automating test coverage checks should not be a one-time setup but an ongoing process of refinement and improvement. | ||
| Teams should regularly review and adjust coverage thresholds based on evolving project requirements, feedback from testing outcomes, and changes in software functionality.### Host A Roundtable Discussion | ||
| ## Lessons From The Field | ||
|
|
||
| ## How to Improve | ||
| - *Think Quality, Not Quantity*. It's important to prioritize the quality of tests over coverage percentages. Teams may focus solely on increasing coverage numbers without ensuring that tests are effective in catching bugs and edge cases. | ||
|
|
||
| ### Start A Book Club | ||
| - *Balance Speed and Coverage*. While automating test coverage checks speeds up validation processes, overemphasizing coverage goals can lead to diminishing returns. Setting overly ambitious coverage targets may slow down development or lead to superficial tests that don't add substantial value. It's important to strike a balance between achieving sufficient coverage and maintaining a productive development pace. | ||
|
|
||
| #### [Test Coverage](https://martinfowler.com/bliki/TestCoverage.html) | ||
| - *Consider Non-Functional Tests*. Automated test coverage often focuses on functional aspects of software, such as correctness and behavior. However, neglecting non-functional tests—-like performance, security, and usability-—can leave out important aspects of automated test quality. Integrating non-functional tests into automated pipelines ensures comprehensive software validation. For instance, performance tests can identify bottlenecks, security tests can detect vulnerabilities, and usability tests can improve user experience. None of those types of tests fit neatly into a traditional "coverage" check. | ||
|
|
||
| In his blog post on test coverage, Martin Fowler explores the concept of test coverage as a tool for identifying untested code rather than as a definitive measure of test quality. | ||
| He argues that while high test coverage percentages can highlight which parts of the code are exercised by tests, they do not necessarily indicate the effectiveness of those tests. | ||
| Fowler emphasizes that test coverage should be used alongside other techniques and metrics to assess the robustness of tests, and that focusing solely on coverage numbers can lead to superficial or inadequate testing. | ||
| He advocates for a balanced approach that combines test coverage with thoughtful test design and evaluation to achieve meaningful software quality. | ||
| - *Continuously Improve*. Automating test coverage checks should not be a one-time setup but an ongoing process of refinement and improvement. Teams should regularly review and adjust coverage thresholds based on evolving project requirements, feedback from testing outcomes, and changes in software functionality. | ||
|
|
||
| ### Host A Roundtable Discussion | ||
| ## Deciding to Pitch or Polish | ||
| 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: | ||
|
|
||
| #### Tailoring and Adjusting Test Coverage | ||
| ### Fast & Intangible | ||
|
|
||
| * Are our current coverage thresholds realistic and tailored to the specific needs of different modules within our application? | ||
| * How often do we review and adjust our coverage metrics to align with evolving project requirements? | ||
| **Title of benefit**. 2-4 sentences about the benefit. | ||
|
|
||
| #### Effectiveness of Test Coverage | ||
| ### Slow & Measurable | ||
|
|
||
| * Do our tests catch bugs and edge cases, or are they merely boosting our coverage numbers? | ||
| * Are we adequately addressing non-functional testing, such as performance, security, and usability, in our automated test coverage? | ||
| **Title of benefit**. 2-4 sentences about the benefit. | ||
|
|
||
| #### Challenges and Lessons in Test Coverage Implementation | ||
|
|
||
| * Are there any cultural or organizational barriers that prevent us from fully implementing this practice? | ||
| * What lessons can we learn from past experiences to enhance our future approach to automated test coverage? | ||
|
|
||
| ## Supporting Capabilities | ||
| ## Supported Capabilities | ||
|
|
||
| ### [Test Automation](/capabilities/test-automation.md) | ||
|
|
||
| Automating test coverage checks supports the Test Automation capability by ensuring continuous and immediate feedback on code changes within the CI pipeline. | ||
| This practice identifies untested code early, helping prevent bugs and regressions, and aligns with a consistent testing strategy. | ||
| Automating test coverage checks supports the Test Automation capability by ensuring continuous and immediate feedback on code changes within the CI pipeline. This practice identifies untested code early, helping prevent bugs and regressions, and aligns with a consistent testing strategy. | ||
| By maintaining realistic coverage thresholds for different modules, it optimizes testing efforts, enhances collaboration between testers and developers, and ultimately improves software quality and stability throughout the delivery lifecycle. | ||
|
|
||
| ### [Continuous Delivery](capabilities/continuous-delivery.md) | ||
|
|
||
| This practice supports the Continuous Delivery capability because it helps teams avoid the time-consuming task of manually verifying system correctness. If a team is attempting to deploy more frequently, it must first automate its test suite. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this Capability, but please review/tweak as needed.