Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Make phpdbg a first class citizen #249

Open
padraic opened this issue May 11, 2017 · 1 comment
Open

Make phpdbg a first class citizen #249

padraic opened this issue May 11, 2017 · 1 comment

Comments

@padraic
Copy link
Collaborator

padraic commented May 11, 2017

At present, Humbug focuses solely on using xdebug, a prerequisite for generating code coverage. It’s essentially a symptom of old age – supporting PHP <5.6, and PHPUnit <5.0.

The requirement for code coverage is essentially a trade-off:

  1. Xdebug will negatively impact performance of unit testing. Sometimes quite spectacularly.
  2. Coverage creates a mapping of unit tests to source code lines, i.e. we can eliminate a lot of tests not applicable to a mutation, which is a significant performance boost.

As it turns out, eliminating significant number of tests is more than worth the cost of having xdebug. However, users would probably prefer not to have xdebug enabled, so it’s a pinch point for usage.

By bringing phpdbg in by default, where feasible, in place of xdebug and without requiring any special decision making by the user (i.e. having them remember to prefix phpdbg -qrr all the time), we can essentially have our cake and eat it too. The primary problem with xdebug (slowing down all unit tests, source code, and Humbug itself, and asking users to enable it) would be eliminated.

There would still remain a tradeoff in terms of coverage, since phpdbg and xdebug are not actually swappable without consequences. The reported coverage will usually differ. However, unless there is a serious shortfall in the data generated, having a few extra tests run on occasion should be a lot cheaper performance wise compared to having xdebug permanently bogging down every single test we execute.

@theofidry
Copy link
Member

theofidry commented May 11, 2017

To give a comparison, on nelmio/alice Xdebug plus the whole test suite was taking about 20-30min in PHP 7.0. With phpdbg and disabling xdebug on PHP 7.1, it takes about 5min.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants