When I have needed to test some java class, I have been made Tester.java like below.
public class Tester
{
public static void main(String[] args)
{
Sample sample = new Sample();
sample.sayHello();
}
}
Is this diffcult? Absolutely no. Isn't it? It is very simple. and enough to test any java programs.
I don't need to use assert series method of junit. To see test result, do I have to use junit framework, junit's assert methods? I can see test result on CLI console. printed by "system.out.println" It is not huge chunk. that is just 7 or 10 line. that' all.
I don't know why many engineer show their enthusiasm with junit?
The code which is nesessary for test program is just like that I described above. just 7 line. Is is hard?
Why do you use junit?
I have searched on internet why? but there is only "how to use". but I want to know "why use"
Anyone please answer me. Thank you.
Aucun commentaire:
Enregistrer un commentaire