Test Driven ... Everything

github logo ・1 min read

TDD , or test driven development , is one of the better ways to develop software. It leads to better design.

TDR , or test driven reading , is one of the better ways to understand programming concepts. (specially Design Pattern topics)

The more blogs and tutorials I read, the more I realise that every article starts with the design code and then the execution ( main() ) code .

I then thought, if I read the main/execution code first and then try to go back and see the design code , then everything starts making sense.

Tests / main() code also leads to a better understanding of programming concepts

Thoughts ???

twitter logo DISCUSS (2)
markdown guide

Right. TDD should be considered as good standard. I admit in some cases it's painful thing to do but at the same time it's necessary to avoiding mistakes.


Thanks for the comment . I guess I failed to communicate a particular point here.

If we can do TDD , why not write blogs, tutorials in similar way.

Example: If I had to explain Observer Pattern , I would first start with showing the end result i.e. the client code first . That would give a brief idea to the reader about the intent of the author.

Now the reader , can relate the upcoming implementation much better..

Here client code is the 'Test!!!' and the 'Observer , Subject' classes are the implementation.

Classic DEV Post from Sep 9 '19

What I learned after applying to 100 jobs

Between August 2014 and July 2019 I applied for just over 100 jobs. Like most people, I find job hu...

Swarup Kumar Mahapatra profile image

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❀️