On 20.03.2014, at 14:33, Sean P. DeNigris <s...@clipperadams.com> wrote:

> Max Leske wrote
>> rewriting our tests with SUnit, moving away from Phexample (for several
>> reasons)
> 
> I'm curious about those reasons…

I think that Phexample is pretty cool and I enjoyed writing tests with it (yes, 
devs don’t usually say that about writing tests :) ).
As Esteban said, we don’t want to introduce the dependency to Phexample because 
of the integration. But that is only one reason.
Personally I have three issues with Phexample:
1. the more complex a project becomes, the more complex the dependencies 
between tests get (in my case, chain lengths of 8 - 10). Problems this causes:
        1.a there is no visual cue for the dependencies, so you have to try 
your best with protocols and naming but it just gets very confusing
        1.b it becomes more likely to introduce cycles (which often crash your 
image…)
        1.c it becomes more likely to introduce errors *because of* 
dependencies (e.g. because I used the wrong selector) and since you assume the 
dependencies to be fine…
2. #setUp and #tearDown are executed for every test *even if the test is a 
dependency*. But in my case I depend on the state that has been established by 
a test (so maybe I misused Phexample. Unit tests should be self contained. But 
then again, if they were self contained, would there be a need for 
dependencies…?). But that state is destroyed by #setUp and #tearDown. Then 
again, I *do* need to initialize and destroy some stuff sometimes (which I 
could to manually, I know; just saying).
3. Especially if you test things that run longer than a couple of milliseconds, 
the test execution time will grow very fast because of the dependencies. Every 
test will be run by the suite (n) + every test in a dependency chain (0 < m < 
inf). That amounts to roughly ~ O(n^2), which is fine for short tests but not 
if you have longer running tests in there

So my take away message from Phexample is: it’s cool to work with and you 
become pretty fast. Phexample is also cool for TDD because it lets you focus on 
the problem at hand and everything als can just be assumed to be #given:. But: 
I would only recommend it for small projects / projects with low complexity (or 
low number of dependencies). Git has notoriously many dependencies, so I might 
also just be an outlier (or I may not have understood how Phexample is supposed 
to work).

Sean, regarding your proposal, I am *not* happy with SUnit, so I’m very happy 
about any ideas you have :)

Cheers,
Max

> 
> 
> 
> -----
> Cheers,
> Sean
> --
> View this message in context: 
> http://forum.world.st/FileSystem-Git-status-update-2-tp4749696p4749970.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
> 


Reply via email to