Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
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, 5911👍, 0💬
Popular Posts:
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...
How To Concatenate Two Character Strings? - MySQL FAQs - Introduction to SQL Basics If you want conc...
How To Return Top 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want ...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
How can you write a loop indefinitely? Two examples are listed in the following code: for(;;) { ... ...