Monday 9 March 2009

Below is the proposed class diagram for the OjesUnit. Its is not complete but will give you an idea of where I am moving to. Any changes are always welcomed.

Friday 6 March 2009

Long wait for ojes... Still have to wait....

Its a long time that I have posted in this blog. I was really busy with my office work. The working code is still there in the svn, still intact of any changes ;). May this weekend will be a golden opportunity to start restart the development.

Thursday 13 November 2008

Some working Ojes code atlast

You can see some working code in the svn. Currently ojes will only support functional level testing. No mock services is supported currently, But will soon introduce those. I am also planning to introduce a End User Documentation as well as PHPDoc for the project very shortly.

You can also watch this blog for initial desgins also

Saturday 21 June 2008

Release of Trac and SVN

I am glad to give away the trac and svn url for the ojes.

Trac

SVN

Friday 20 June 2008

ojes The Ultimate Unit Test

Welcome to the world of ojes.

ojes is a new variant of unit test which makes a developer's life easy. This project is still in the Labs. You can expect a runnable version by the end of june 2008.

So let us go in deep. The ojes focus on writing the test case in side the function comments. Sound really interesting?? Here is an example of how ojes works



class Maths
{
/**
* Add two numbers
*
* @param integer $a
* @param integer $b
* @return int
*
* @testcase array(
* "a" => 2,
* "b" => 2,
* "return" => 4
* );
* @testcase array(
* "a" => 4
* "b" => 2
* "return" => 6
* );
*
*/
public function add($a, $b) {

return $a + $b;
}

/**
* Multiply two numbers
*
* @param integer $a
* @param integer $b
* @return integer
*
* @testcase array(
* "a" => 3
* "b" => 2,
* "return" => 6
* );
*/
public function multiply($a, $b){

for($i=1;$i<$a;$i++) { $b = $this->add($b, $b);
}

return $b;
}
}


please, the multiply function is just for demonstration :)

You can see I have specified the test cases in the comments itself. So when ever the ojes unit run it will take the test case one by one from the comment and run against the function. So for the function add it is pretty simple.

Now take the case of the Multiply which in turn call the add function. In an ideal situation when testing the function multiply, we don't want to call the function add. And most of the unit test provides as with the option to write mock object or function etc. But that all has to be done by the programmer. So now come the turning point in ojes and the part which i like the most. The part which has driven me to do this. ojes will automatically generate mocks for you...... , Can't believe. Just wipe your eyes and look again. ojes will generate mocks for and test the required function in isolation. The idea behind this is very simple the test case of multiply is 2 and 3, So inside the multiply I go into a loop and call 2 + 2 and then 4 + 2. These values are given as the test case for the add function. So ojes will take these values and make the mock and return back the predefined value given by the user.

Looks good and easy then join hands with me. Let us change the world.

(I have a prototype for this one. But the code is not that good. I am just clearing out the code and creating documentation. By the mean time if any one is interested in this project can mail me for the code.

I am planning for making this project an open source one :) So once we have a nice documented and running code we can go for releases)