aleixmorgadas’s avataraleixmorgadas’s Twitter Archive—№ 1,259

            1. How can you tell if a code has been written using #TDD? I read you and I give opinion in the thread 👇
          1. …in reply to @aleixmorgadas
            I go for obvious hints: - tests structure - git history Yet, when the tests are there and there's no clear hint in the logs, I start looking at different things.
        1. …in reply to @aleixmorgadas
          The complexity of the first two tests tells me how much the dev knew about the solution Usually, with TDD, you start with the most simple scenario and keep iterating over there. If the first test has the same complexities as others, it can be a hint for test last Or a refactor
      1. …in reply to @aleixmorgadas
        Another thing I watch for is the setup complexity depending if it's a model or a service. When I see difficult ways to test a Model, I can tell the test was written last. Or even mocks in the model. I even saw reflection being used because the constructor was private
    1. …in reply to @aleixmorgadas
      TDD also helps in good Dependency Injection, and separation of responsibility. When the test suite does too much things, it's probably that the code was created first and then the test to prove the whole feature to work.
  1. …in reply to @aleixmorgadas
    By this, you find a test pyramid that doesn't look like a pyramid. More like a flat guilding or inverted pyramid