sebastianbergmann / sebastianbergmann/php-code-coverage
Add branch coverage statistics to XML report output
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 8.9k
- Forks
- 385
- Avg merge
- 12h 25m
- Merged PRs (30d)
- 31
Description
| Q | A |
|---|---|
| php-code-coverage version | 10.1.16 |
| PHP version | 8.3.2 |
| Driver | Xdebug |
| Xdebug version | 3.3.1 |
| Installation Method | Composer |
| Usage Method | PHPUnit |
| PHPUnit version (if used) | 10.5.37 |
I'm the maintainer of a VS Code extension that integrates PHPUnit with the VS Code Test Explorer, and I'd like to update it to support the new feature that allows individual tests to be associated with test coverage lines.
Currently, I'm using the Clover XML report to pick up code coverage statistics, which has been working well. However, it doesn't include the detail of which specific test covered each line. From what I can tell, the Clover XSD schema will not support adding this type of detail.
The PHPUnit XML report does include associations of tests to individual line coverage. However, the XML report does not seem to use branch coverage statistics, even when they are available.
Is there any plan to enhance the XML report to include branch coverage statistics? I am happy to put together a PR if that helps.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the PHPUnit XML report generation and how branch coverage data is represented in the coverage model. Compare the existing line-coverage and test-association output with the available branch statistics. Done means the XML report includes branch coverage statistics without losing individual test-to-line associations, with the report remaining compatible with its schema constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100