skip to main | skip to sidebar

Blog Edan

  • Entries (RSS)
  • Comments (RSS)
  • Home

Selasa, 01 Mei 2012

[html5apps] Learned a lot about BDD today, but?

Diposting oleh Den TOMJERRX di 5/01/2012 12:28:00 AM
 

As you know software without tests is useless therefore I started this morning with a wish to write some tests for my project. I came across a new word which I did not understand: BDD. I knew about TDD but not BDD (. Read these pages:
 
http://en.wikipedia.org/wiki/Behavior_Driven_Development
 
http://inter-sections.net/2007/10/03/the-difference-between-tdd-and-bdd

However, to be honest I still do not completely understand (
 
Anyway I proceeded forward and best tools for BDD are Node.js modules Mocha and Should:
 
http://visionmedia.github.com/mocha/
 
(I read the documentation very carefully).
 
Then moved over to Should:
 
https://github.com/visionmedia/should.js#readme
 
At this point I started playing with Mocha, and was not able to run it. After about 3-4 hours I set the path to F:\myproject\node_modules\.bin and started running, then I created directroy test in my myproject directory i.e. F:\myproject\test

and wrote this in my myfirsttest.js file

 

/**
 * Created with JetBrains WebStorm.
 * User: zia
 * Date: 4/27/12
 * Time: 8:02 PM
 * To change this template use File | Settings | File Templates.
 */
//http://visionmedia.github.com/mocha/

//http://dailyjs.com/2011/12/08/mocha/
//https://github.com/visionmedia/should.js#readme
//http://www.adomokos.com/2012/01/javascript-testing-with-mocha.html
//http://stackoverflow.com/questions/9779700/mocha-requires-make-cant-find-a-make-exe-that-works-on-windows

//http://en.wikipedia.org/wiki/Behavior_Driven_Development
//http://inter-sections.net/2007/10/03/the-difference-between-tdd-and-bdd


var should = require('should');
var panacloud = require('./../panacloud');

describe('Panacloud Registration', function(){
    before(function(done){
        panacloud.cleanDatabaseAsync().then(function(msg){
            done();
        },
        function(errMsg){
            done();
        });
    });

    describe('#isRegistrationAsync()', function(){
        it('should not be registered', function(done){
            panacloud.isRegisteredAsync("11").then(function(data){
                //should.equal(data.isRegistered, false, "Not registered as it should be");
                data.isRegistered.should.be.false;
                // Tell Mocha the test has finished
                done();
            });
        })
    })
}) 
 

And it is working but I still donot understand the theory behind BDD, I understand these tests are very easy to read even for the end user but don't understand the complete theory behind it. Also I am very tired. I think it will come to me in time, or may be you can tell me?

_______________________________________________________________________________
Zia Khan

Become my friend on Facebook: http://www.facebook.com/ziakhan
Mobile: 92-300-826-3374 (Pakistan)
Microsoft's Windows Azure Discussion Group: 3,000+ Members
CFA, CPA, and CMA Exam Preparation Discussion Group: 3,700+ Members
_______________________________________________________________________________

__._,_.___
Reply to sender | Reply to group | Reply via web post | Start a New Topic
Messages in this topic (1)
Recent Activity:
  • New Members 1
Visit Your Group
Yahoo! Groups
Switch to: Text-Only, Daily Digest • Unsubscribe • Terms of Use
.

__,_._,___
Kirimkan Ini lewat Email BlogThis! Bagikan ke X Berbagi ke Facebook

0 komentar:

Posting Komentar

Posting Lebih Baru Posting Lama Beranda
Langganan: Posting Komentar (Atom)

Labels

  • ping script (1)
  • Url Submiter (1)

Blog Archive

Total Tayangan Halaman

Our Partners

All About Tutorial
Free link exchange All Content Let's Cheat The Games Free Backlink Rea Soft Free Domain Name

Archive

Meta Tag Analyser

Translator

blogger widgets

Referrer Link

www.e-referrer.com

 

© 2010 Blog Edan
designed by Wong Edan - All About Tutorial