TDD/BDD in the haXe world

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

TDD/BDD in the haXe world

Marcelo de Moraes Serpa
Hey guys,

I'm wondering how many of you use TDD/BDD in your haXe projects, be it web, app or game related. BDD/TDD is a big topic in the Ruby community, but also because Ruby is dynamically typed and not compiled, so testing is very important. However, I think TDD is not only about an additional safety-net, but also a design tool. I don't see a lot of talk about TDD in the mailing list, so I'm wondering what you guys think about it. Unit-testing (after coding) is also a valid topic to discuss, since it's also about having tests. There are many opinions about it, some say it slows you down, some say it actually avoids headaches in the future and allows you to be faster as your code grows in complexity. I personally think that it depends. I'm not obsessed about it but I can see the value of a well tested code, specially if you consider it as "executable documentation". However, I can also see it can take quite a bit of time if you focus on testing many abstraction levels (unit, integration, performance, etc).

This article is interesting and shows Cucumber, a language agnostic BDD tool written in Ruby: http://www.prateekdayal.net/2010/10/11/benefits-of-test-driven-development-for-startups/. Cucumber can be used with any language and is a nice tool to make "executable requirements".

Cheers,

M>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Richard Janicek-2
Jasmine has been very valuable for me in developing web apps. I like it's simplicity and great support for asynchronous tests.


J.describe("Jasmine", function() {
J.it("should wait for", function() {
var jasmineIsCool:Int = 0;

J.runs(function() {
Timer.delay(function() { jasmineIsCool++; }, 250);
});

J.runs(function() {
J.expect(jasmineIsCool).toEqual(0);
});

J.waitsFor(function() {
return jasmineIsCool == 1;
}, "jasmineIsCool to equal 1" );

J.runs(function() {
J.expect(jasmineIsCool).toEqual(1);
} );
} );
} );


§ Richard Janicek
www.Clock2D.com


On Tue, Aug 2, 2011 at 8:29 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Hey guys,

I'm wondering how many of you use TDD/BDD in your haXe projects, be it web, app or game related. BDD/TDD is a big topic in the Ruby community, but also because Ruby is dynamically typed and not compiled, so testing is very important. However, I think TDD is not only about an additional safety-net, but also a design tool. I don't see a lot of talk about TDD in the mailing list, so I'm wondering what you guys think about it. Unit-testing (after coding) is also a valid topic to discuss, since it's also about having tests. There are many opinions about it, some say it slows you down, some say it actually avoids headaches in the future and allows you to be faster as your code grows in complexity. I personally think that it depends. I'm not obsessed about it but I can see the value of a well tested code, specially if you consider it as "executable documentation". However, I can also see it can take quite a bit of time if you focus on testing many abstraction levels (unit, integration, performance, etc).

This article is interesting and shows Cucumber, a language agnostic BDD tool written in Ruby: http://www.prateekdayal.net/2010/10/11/benefits-of-test-driven-development-for-startups/. Cucumber can be used with any language and is a nice tool to make "executable requirements".

Cheers,

M>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Marcelo de Moraes Serpa
Wow, very nice, nice to know haXe is well suited for DSL's like this. 

Cheers!

M>

On Tue, Aug 2, 2011 at 9:28 PM, Richard Janicek <[hidden email]> wrote:
Jasmine has been very valuable for me in developing web apps. I like it's simplicity and great support for asynchronous tests.


J.describe("Jasmine", function() {
J.it("should wait for", function() {
var jasmineIsCool:Int = 0;

J.runs(function() {
Timer.delay(function() { jasmineIsCool++; }, 250);
});

J.runs(function() {
J.expect(jasmineIsCool).toEqual(0);
});

J.waitsFor(function() {
return jasmineIsCool == 1;
}, "jasmineIsCool to equal 1" );

J.runs(function() {
J.expect(jasmineIsCool).toEqual(1);
} );
} );
} );


§ Richard Janicek
www.Clock2D.com


On Tue, Aug 2, 2011 at 8:29 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Hey guys,

I'm wondering how many of you use TDD/BDD in your haXe projects, be it web, app or game related. BDD/TDD is a big topic in the Ruby community, but also because Ruby is dynamically typed and not compiled, so testing is very important. However, I think TDD is not only about an additional safety-net, but also a design tool. I don't see a lot of talk about TDD in the mailing list, so I'm wondering what you guys think about it. Unit-testing (after coding) is also a valid topic to discuss, since it's also about having tests. There are many opinions about it, some say it slows you down, some say it actually avoids headaches in the future and allows you to be faster as your code grows in complexity. I personally think that it depends. I'm not obsessed about it but I can see the value of a well tested code, specially if you consider it as "executable documentation". However, I can also see it can take quite a bit of time if you focus on testing many abstraction levels (unit, integration, performance, etc).

This article is interesting and shows Cucumber, a language agnostic BDD tool written in Ruby: http://www.prateekdayal.net/2010/10/11/benefits-of-test-driven-development-for-startups/. Cucumber can be used with any language and is a nice tool to make "executable requirements".

Cheers,

M>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Marcelo de Moraes Serpa
Quick question: Can it be used to test Neko and or other targets?

M>

On Tue, Aug 2, 2011 at 10:22 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Wow, very nice, nice to know haXe is well suited for DSL's like this. 

Cheers!

M>


On Tue, Aug 2, 2011 at 9:28 PM, Richard Janicek <[hidden email]> wrote:
Jasmine has been very valuable for me in developing web apps. I like it's simplicity and great support for asynchronous tests.


J.describe("Jasmine", function() {
J.it("should wait for", function() {
var jasmineIsCool:Int = 0;

J.runs(function() {
Timer.delay(function() { jasmineIsCool++; }, 250);
});

J.runs(function() {
J.expect(jasmineIsCool).toEqual(0);
});

J.waitsFor(function() {
return jasmineIsCool == 1;
}, "jasmineIsCool to equal 1" );

J.runs(function() {
J.expect(jasmineIsCool).toEqual(1);
} );
} );
} );


§ Richard Janicek
www.Clock2D.com


On Tue, Aug 2, 2011 at 8:29 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Hey guys,

I'm wondering how many of you use TDD/BDD in your haXe projects, be it web, app or game related. BDD/TDD is a big topic in the Ruby community, but also because Ruby is dynamically typed and not compiled, so testing is very important. However, I think TDD is not only about an additional safety-net, but also a design tool. I don't see a lot of talk about TDD in the mailing list, so I'm wondering what you guys think about it. Unit-testing (after coding) is also a valid topic to discuss, since it's also about having tests. There are many opinions about it, some say it slows you down, some say it actually avoids headaches in the future and allows you to be faster as your code grows in complexity. I personally think that it depends. I'm not obsessed about it but I can see the value of a well tested code, specially if you consider it as "executable documentation". However, I can also see it can take quite a bit of time if you focus on testing many abstraction levels (unit, integration, performance, etc).

This article is interesting and shows Cucumber, a language agnostic BDD tool written in Ruby: http://www.prateekdayal.net/2010/10/11/benefits-of-test-driven-development-for-startups/. Cucumber can be used with any language and is a nice tool to make "executable requirements".

Cheers,

M>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Richard Janicek-2
JavaScript targets only since this is a binding for a JavaScript framework.

§ Richard Janicek
www.Clock2D.com


On Tue, Aug 2, 2011 at 11:22 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Quick question: Can it be used to test Neko and or other targets?

M>


On Tue, Aug 2, 2011 at 10:22 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Wow, very nice, nice to know haXe is well suited for DSL's like this. 

Cheers!

M>


On Tue, Aug 2, 2011 at 9:28 PM, Richard Janicek <[hidden email]> wrote:
Jasmine has been very valuable for me in developing web apps. I like it's simplicity and great support for asynchronous tests.


J.describe("Jasmine", function() {
J.it("should wait for", function() {
var jasmineIsCool:Int = 0;

J.runs(function() {
Timer.delay(function() { jasmineIsCool++; }, 250);
});

J.runs(function() {
J.expect(jasmineIsCool).toEqual(0);
});

J.waitsFor(function() {
return jasmineIsCool == 1;
}, "jasmineIsCool to equal 1" );

J.runs(function() {
J.expect(jasmineIsCool).toEqual(1);
} );
} );
} );


§ Richard Janicek
www.Clock2D.com


On Tue, Aug 2, 2011 at 8:29 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Hey guys,

I'm wondering how many of you use TDD/BDD in your haXe projects, be it web, app or game related. BDD/TDD is a big topic in the Ruby community, but also because Ruby is dynamically typed and not compiled, so testing is very important. However, I think TDD is not only about an additional safety-net, but also a design tool. I don't see a lot of talk about TDD in the mailing list, so I'm wondering what you guys think about it. Unit-testing (after coding) is also a valid topic to discuss, since it's also about having tests. There are many opinions about it, some say it slows you down, some say it actually avoids headaches in the future and allows you to be faster as your code grows in complexity. I personally think that it depends. I'm not obsessed about it but I can see the value of a well tested code, specially if you consider it as "executable documentation". However, I can also see it can take quite a bit of time if you focus on testing many abstraction levels (unit, integration, performance, etc).

This article is interesting and shows Cucumber, a language agnostic BDD tool written in Ruby: http://www.prateekdayal.net/2010/10/11/benefits-of-test-driven-development-for-startups/. Cucumber can be used with any language and is a nice tool to make "executable requirements".

Cheers,

M>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Geoffrey Hug
I'd be interested in your experiences on TDD too since I'm considering it but right now I'm just too lazy ( and not familiar at all with it ) to put into practice.

Is the time you put into writing the tests worth it ? because to me it looks like for everything you do, you will have to double the time spent on it so it will be properly tested.

On the other hand I think it must really improve the quality of your code as a well tested code is something you're sure about.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: TDD/BDD in the haXe world

Richard Janicek-2
Testing will increase the quality of your code. If high quality is valuable to your project, testing will pay dividends. If it is important to find errors before your users find them, testing is well worth the time. If you are writing libraries that don't have a UI, TDD is a good easy way to exercise your codes, and you will automatically have examples of how to use the library when you are done. If your code has external dependencies that are changing, your tests will prove that everything still works when you update the dependencies. If you want to refactor and make your codes more beautiful, your tests will be your safety net and will prove your new beautiful code still works.

In my workflow, I do not write tests first. I use tests to constrain and prove the behavior of the system as I am building it. I prioritize my time for testing the most critical codes first. I don't test everything, just the most important things.

§ Richard Janicek
www.Clock2D.com


On Fri, Aug 5, 2011 at 5:17 AM, Geoffrey Hug <[hidden email]> wrote:
I'd be interested in your experiences on TDD too since I'm considering it but right now I'm just too lazy ( and not familiar at all with it ) to put into practice.

Is the time you put into writing the tests worth it ? because to me it looks like for everything you do, you will have to double the time spent on it so it will be properly tested.

On the other hand I think it must really improve the quality of your code as a well tested code is something you're sure about.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org