I have read that for TDD, you should write unit test first before programming the code. In my case, I was just trying to create a unit test project without TDD in mind, so I created the application first before writing the test.
I have been reading on TDD earlier and so I have decided to create a new test project. But I can't call classes and functions in my application that I can compare in the Assert method if I don't write at least the classes and methods in my application.
So, please tell me if I understand TDD right. This may not sound like the complete TDD itself. I just want to know if my simple understanding of how to start it is correct.
Here's how I am planning to start:
- Create application and write basic methods and functions structure without really coding the implementation
- Create test project to call the units of the application to be tested (Without the implementation, test should fail)
- Add correct code implementation to see if tests will succeed
- Add or refactor test methods as needed
Anything to correct or add? Anything I misunderstand?
Feel free to post your suggestions. My idea might be to simple and too basic but I am hoping to learn to write a good unit test using the TDD approach.