re: Clean, DRY, SOLID Spaghetti VIEW POST

re: In one sense, but tests are vastly simpler than production code in most cases, so its easier for us to get into the habit of subconsciously coding ...

Thanks for the explanation.

In my experience, sometimes I do have code design prethoughts while writing unit tests. There's a danger that I purposefully write the tests the way it was because I want to shape it to the design I had in mind. Thus, writing the "trap" for myself.

I agree, though I think this problem will only likely surface on low level tests such as unit tests. That's why we couple Behevior Driven Development (BDD) automated tests with unit tests. To test the implementation of the unit tests and replicate the transactions as if how it will be used in production.

Normally, we'd write the acceptance tests (BDD) first, unit tests, then code.

code of conduct - report abuse