phpro / grumphp

A PHP code-quality tool
MIT License
4.15k stars 431 forks source link

Add Humbug task #193

Closed veewee closed 6 years ago

veewee commented 8 years ago
Q A
Branch master
Bug? no
New feature? yes
Question? no
Documentation? no
Related tickets

More info https://github.com/padraic/humbug

pamil commented 8 years ago

Does it make sense to use Humbug? Its results should be interpreted by a human as there are no computable metrics to tell whether they are good or bad.

veewee commented 8 years ago

@pamil, I haven't used HumBug myself yet. Somebody suggested a HumBug task long ago. As far as I can tell, the json log file can be used to get the metrics in the summery part. Just as in the clover coverage task, it is possible to add a minimum level for one of the metrics covered_code, combined_score or mutation_coverage.

Example log:

{
    "summary": {
        "total": 416,
        "kills": 24,
        "escapes": 8,
        "errors": 0,
        "timeouts": 0,
        "notests": 384,
        "covered_score": 75,
        "combined_score": 6,
        "mutation_coverage": 8
    },
    "uncovered": []
}

I do agree that the results itself should be interpreted by a human to make sure that it aren't false positives. But the calculated metrics could be used to determine how well the tests are being written.

exussum12 commented 6 years ago

As a note. Humbug is deprecated now. This should be updated to infector

veewee commented 6 years ago

Thanks for reporting @exussum12. Closing this issue since infection is already implemented: https://github.com/phpro/grumphp/blob/master/doc/tasks/infection.md