nice conversation from all of you guys, just explaining test driven development for those who get into this term recently.
as you guys know whenever you are writing code you expect some way to get it working.
if this application is web based application you try to hit your browser until you feel your fix and verify cycle is finished.
as you know there is no way to get this browser based verify and fix cycle out of your box.
thus test first approach came out. you write whatever behavior you expect from your code and then write your code to make it working. as soon as you get your expectation fixed by the code you have written you stop running your unit test.
as you can guess this unit test process can be executed continuously to look after your source code, whether any of your team members wrote something unfinished which broke the previously written good code by other team members.
so the TDD is the cycle of -
write expectation - > write code -> verify -> again write expectation or fix code -> verify -> again .....
i try to keep coverage for all critical services. our QA team try to keep coverage on UI related functionality through selenium and we keep coverage through unit testing.
gradually we are adopting this approach for every type of projects we have, lately we even started test driven development for one of our PHP based applications.
when you start practicing TDD, you might feel, WHY should i care?
the reason is very simple, this TDD can help you to prove you had clear understanding about the function you have been coding for.
since i had pretty long practice with JUnit, i still prefer JUnit, RUnit and simpletest for php. but i tried RSpec and loved their syntax and even i have experimented RSpec story runner. i would say i loved the story runner concept.
perhaps my next project would start with story runner code.
more interesting i have got to know about easyB which is groovy based RSpect type BDD framework for java.
you will find my blog here
here is one of my open source projects which was developed based on test first approach. though lately i got most the cases are broken since i became lazy to updating the test cases.
thanks for nice initiative,
best wishes,
--
----------------------------------------------------
nhm tanveer hossain khan (hasan)
http://hasan.we4tech.com
----------------------------------------------------
mobile: +880 1713 090 511
aawaj: hasan15422
----------------------------------------------------
"work for fun"
"you think you are silly because you are not in right circle"
"all human beings are entrepreneurs" - m. yunus
On Tue, Dec 2, 2008 at 9:47 PM, Arif <asm....@gmail.com> wrote:
I found several devs are using http://github.com/thoughtbot/shoulda/tree/master
now a days. But don't know if it's better than r-spec.
--
----------------------------------------------------
nhm tanveer hossain khan (hasan)
http://hasan.we4tech.com
----------------------------------------------------
mobile: +880 1713 090 511
aawaj: hasan15422
----------------------------------------------------
"work for fun"
"you think you are silly because you are not in right circle"
"all human beings are entrepreneurs" - m. yunus