I want to learn JUnit from basic in Java and how to apply in my project. It would be very helpful if anybody can tell from where to start. I have seen some tutorial but i can't understand from it.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can write your test code before or after write your source code. You can read about Test-driven development process.
For learning JUnit testing this can help to you.
You will get more details about JUnit testing in the Book "Pragmatic Unit Testing in Java with JUnit".
回答2:
Also go through Dependency Injection and Inversion of Control They are pretty useful concepts to put into practice when one intends to do test driven development. There is a nice discussion about that also on stackexchange