Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
Why Not Just Write a main() Method for Unit Testing?
Why Not Just Write a main() Method for Unit Testing?
✍: Guest
It is possible to write a main() method in each class that need to be tested for unit testing. In the main() method, you could create test object of the class itself, and write some tests to test its methods.
However, this is not a recommended approach because of the following points:
Above are some of the problems, which will be taken care of automatically if you use Junit. Junit provides a standard framework for writing your tests. It separates test code from project code, hence keeps everything clean.
2008-02-06, 5224👍, 0💬
Popular Posts:
What are shared (VB.NET)/Static(C#) variables? Static/Shared classes are used when a class provides ...
What does XmlValidatingReader class do? XmlTextReader class does not validate the contents of an XML...
.NET INTERVIEW QUESTIONS - What is Multi-tasking ? It’s a feature of modern operating systems with w...
How To Use an Array as a Queue? - PHP Script Tips - PHP Built-in Functions for Arrays A queue is a s...
when should the volatile modifier be used? The volatile modifier is a directive to the compiler's op...