Lessons from TDD - Logic in unit tests

TL;DR - Try not to have logic in unit tests. The whole point of a unit test is to make sure some logic works TDD was something new to me about 8 years ago. I worked as a test automation engineer for a large corporation during my internship. My job was to automate integration tests. When I became a full time developer and starting writing production code, I learned about TDD. I realized that it’s one of the best tools that I had ever come across. Since then my mantra has been red-green-refactor. I have met newer engineers who ask the question - why test it if it works? ...

July 20, 2020 · 3 min · 606 words · Karun Ramakrishnan