Tests are executable documentation

A well-written test case tells a clear story, communicating the intent of code. Learn how to write expressive tests and why duplication isn't always a bad thing in your test cases. - phrase from ThoughtBot blog about TDD.

Well written Tests are always a source of truth for a living documentation for that perticular project. Other form of documentation such as git wikis, code comments, code commits, pull request descriptions, google doc, Slack comments can easily get out of the sync with the production code.

Well written Tests guides your example documentantion which can be used by the developers using your library. Developers of your library should never have to read your source code, code comments to figure out how to use your library. If you see yourself reading source code or code comments of other libraries you are using, it is an indication to you that the library does not have a well written test suite or example documentation to go through.

You should be revealing your intents through your tests. Developers using your library should never have to worry about how it is implemented. They should be able to use your library by reading your tests and examples only. We need to seperate the intent from the implementation.

What is this Site?

viralpatel.blog is started by me, Viral Patel, as a place to write posts and blogs about problems that I personally face during my day to day and share new learnings about software development work. Even though there is abundant of information out there via various personal blogs or blogs written by technical companies, day in and day out, We as software developers face different problems. By starting out this blog, I wish to explore different problem solving patterns and software design practices that will make easier to build quality and useful software.