aspose file tools*
The moose likes Java in General and the fly likes Unit test framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unit test framework" Watch "Unit test framework" New topic
Author

Unit test framework

Purna Koganti
Greenhorn

Joined: Nov 25, 2011
Posts: 2
Hi,

I am in the process of creating framework for unit testing in java.
Can any one suggegt the best way to do this.

The framework should be user friendly. Developers should be able to add new unit test cases to the framework and use it when ever there is a need.
Ex:
if the test case is adding 2 numbers and multiplying 2 numbers, then by simply typing "add.twoNumbers=10,10" and multiply.twoNumbers=10,10 in a file should invoke the appropriate test cases and should be executed and generate results.


Pl help.

Thanks
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Hello Purna Koganti.

Welcome to JavaRanch.

In this book http://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530/ref=sr_1_1?ie=UTF8&qid=1322217162&sr=8-1 Kent Beck shows how to create a TDD tool.

Hope it helps you.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8216
    
  23

Purna Koganti wrote:...if the test case is adding 2 numbers and multiplying 2 numbers, then by simply typing "add.twoNumbers=10,10" and multiply.twoNumbers=10,10 in a file should invoke the appropriate test cases and should be executed and generate results...

I hate to say, but I suspect you're adding a layer of complexity that isn't really necessary in the form of a "testing language" by this requirement. This language will need a syntax, and no matter how simple you make it (and, as Einstein said, things should be as simple as possible but no simpler), you will still have to allow for the fact that people make mistakes.

Since I assume your audience (developers) are likely to be reasonably well-versed in Java, it makes more sense to me to base the framework on Java, not Strings or commands.

But that just my opinion. Feel free to throw it in File 13 if you wish.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Purna Koganti
Greenhorn

Joined: Nov 25, 2011
Posts: 2
Thanks Herbert, for the reference book



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unit test framework