TDD vs Natural Selection : Part II

As discussed in previous part, both TDD and natural selection can produce suitable designs. But there are costs.
The design from natural selection is just perfect, but the cost is 99% unsuitable species die out. It is the cost of life.
Same to TDD, except TDD isn’t so cruel. If you try to write a piece of code in TDD and pure factoring way, which means all the designs are in order to eliminate smell. And you might find that to eliminate the smell sometime is not so easy that you can have it done in minutes. You might need several tries to find out the most proper approach, since you might find that you just introduced a new, and maybe more serious smell while you eliminating a smell. Sometimes you might find that the upcoming new smells just drive into a dead road, and you just want revert the changes and retry from a fresh start. In worst case, you might find you can hardly find the right way, and you just got lost in the code.
In some simple project, you might find the situation is just acceptable, but in some complex project, you can hardly do that or you might find at the end of the day you and your pair produced nothing with great effort.

So in my opinion, TDD doesn’t mean no design at all. When you practicing TDD, you must focus on the detailed code. At this time if you can easily got lost without the guide from a clear, more general, high level vision. It just works like the architecture design or general solution to specific type of problem.

Such design can save you tons of time wasted on times of retries.

FluentAssertion is not compatible with xUnit.Extensions

I met a weird problem that I found the Resharper Test Runner hangs when I introduced theory test case in my unit test.
After some spikes, I found the problem seems caused by the incompatibility between Fluent Assertion and xUnit.Extension.
It is wired, and there seems to be no quick fix.
So I replace the Fluent Assertion with Should and Should.Fluent, which is a port of ShouldIt.
After that, everything goes well except the syntax between Fluent Assertion and Should Fluent are not compatible with each other, although they’re really similar.
But Should.Fluent doesn’t support something.Should.Be(), it requires something.Should.Be.Equals(), which is really annoying to me.

According to the Fluent’s introduction, Fluent is a direct fork of xUnit. And I’m not sure what’s the impact caused by this.

TDD vs Natural Selection

After practiced TDD for almost a month, I guess I began to understand why TDD can possibly generate the best suitable design, although there is no one actually did the design work. It is interesting that if something is not intended to be done but actually has been done finally. It means that the design is actually done gradually and silently during the TDD process.
I always wondering what actually happened leads to such a result. Then I guess I have found the answer from Darwin’s theory. Think about the various lives on the planet, there is no one who designed them, but they are just so reasonable and harmony with the environment.
Why? Natural selection!
Natural selection ensures a trend of the life evolution, which makes the life to be more and more suitable to the environment, by serious survival tests. Unsuitable life just died out, the remained are the suitable.
Comparing to natural selection, you can find the similar gene in TDD. They both got tests and the test result eliminates the unsuitable design, which actually drives the design more and more fit to the requirements in a most efficient way.