This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
what is the benefit of testing the assignment by JUnit or any tools while everything is working fine??? :roll: I don't see any benefit of that because (let us say using JUnit) suppose to be at the beginning of the assignment not at the end... I created a small testing class which contains many clients (of course not JUnit, but it was a java class) to test lock and unlock. both methods working fine. Now, shall we test it or not test it, that is the Question? Is it compulsary to using testing tools or what?
what is the benefit of testing the assignment by JUnit or any tools while everything is working fine??? :roll:
How do you know it is working fine if you don't test it? And if you make a change to your class that you believe is working fine, how can you test that it still passes the correct input and gives proper exceptions on bad input?
I don't see any benefit of that because (let us say using JUnit) suppose to be at the beginning of the assignment not at the end...
One of the big problems coders have had in the past (and no doubt still have) is that they wait until the end of the project before doing testing, and then the only do what amounts to "end user" testing - testing that the basic functionality works, and that any error scenarios they can think of for the "application as a whole" are handled. If an error is found, then you have to work through the entire application to determine where the problem is (unless you know the entire application inside out). Even then, you have only tested for the errors you can see the user creating within the confines of the application. Using something like JUnit, you start testing at a much earlier stage, testing each unit as you build it. You actually sit down and try and work out all the scenarios (both successful and failures) that the unit should handle. Then you test them. If you later modify that unit, you can simply re run your tests to make sure it still works according to the criteria you determined.
Now, shall we test it or not test it, that is the Question?
Well, I think everyone does some testing. It is just a question how formally they do their testing. The SCJD assignment is an excellent place to learn a tool like JUnit. You have a nice small application, with no time limits. It would be a nightmare trying to learn how to use a testing tool when you have just inherited a huge project that you dont know and have a deadline for when the next version of it is due to come out. Also, getting into the discipline of using a testing tool early on makes it easier to use one later in life.
Is it compulsary to using testing tools or what?
No, it is not compulsary, but it is a very good idea. Regards, Andrew