Writing Testable Code. Main Rules
▻https://hackernoon.com/writing-testable-code-main-rules-43188dee2cb3?source=rss----3a8144eabfe3
Every developer knows that the testable code can make life easier. There are a lot of books and articles written about unit-testing. Particular attention is paid to Test-driven development (TDD) as the best process for the development of hi-tech products. In my working routine, I face tons of problems with untestable code. It may happen even in those projects for which 100 percent test coverage is the main acceptance criteria.I would like to admit that a “Good code” and “Unit-testable code” are not always equivalent terms. Your code can be understandable, self-documented, but untestable at the same time. There is one universal tip for writing a unit-testable code. You should just use the principles DRY, KISS, and SOLID, as I do in Dashdevs.Unfortunately, developers may ignore them to (...)
#style-guides #tdd #testable-code #code-style-guide #clean-code