A step towards next generation of development methodology??<br />Say Hello to “Behavior Driven Development” <br />“BEHAVIOR” sounds cool!<br />I think I can add another “Buzz Word” in my resume!<br />Mahmudul Haque Azad<br />
A brief history (or story) of almost all developers<br />
What could be the possible test cases.<br />This program should send email if To address is valid.<br />This program should send email if CC address is valid even if To address is not valid<br /> This program should send email if BCC address is valid even if CC and To address is not valid. <br />This program should send email even if the subject line is empty. <br />This program should send email even if the body is empty.<br />
What if<br />Specification /Requirement<br />Behavior of the Module<br />How it will behave in all possible situation?<br />
At first! You must know how the medicine is going to work!<br />Researchers have spent lots of time to figure out a possible format of “requirement specification” that is easy to understand to both technical and non technical person. Experts term this type of language as Ubiquitous Language or Domain Specific Language (DSL). <br />
Lets learn some Buzz Word! <br />Human Computer Interaction<br />Ubiquitious Language<br />Domain Specific Language<br />DDD<br />Domain Driven Design<br />
Why Buzz words in middle of such complex problem?<br />
Good News!<br /><ul><li>What ever your write follow Given-When-Then rule.
Can be written by any person regardless of technical background.
Plain English to C#/Java/Python…</li></li></ul><li>I can be a language with a simple RULE but I have a name!<br />
Here is the same requirement following this rule!<br />Given that a web based email module has been developed <br />And I am accessing it with proper authentication<br />When I shall write sender email address in To field Or write sender email address in CC filed by not keeping empty the To field Or write sender email address in BCC field by not keeping empty either To field<br />And keeping the subject field non empty<br />And write something in body text area which excepts rich text<br />And press or click send button<br />Then my email will be sent <br />And the event will be logged in log file.<br /><ul><li>Isn't it easy to write and read and understand?
Isn't it covers and depicts all possible test cases?
Hey! Isn't it actually writing a documentation of email module to be developed?</li></li></ul><li>A new concept!<br />Such type of requirement actually depicts how the module would behave once developed and developer can concentrate more on behavior rather than writing test cases. <br />Such phenomenon are termed as Behavior Driven Development (BDD) and I am pretty sure you have understood the basic concept of BDD by now.<br />Huh! I know BDD now and I can add it to my resume without hesitation!<br />
Lets See BDD in Action!<br />For Java: Use Jbehavehttp://jbehave.org/reference/stable/getting-started.html<br />For .Net use SpecFlow.<br />
A small requirement!<br />Given that we have a search form that searches over Name, Address and Profession table<br />When the user enters non empty text<br />And the length of the text is more than 3 alphanumeric character long <br />Then the user will get the search result <br />And if the search result is empty he will get an message box asking him to do the search again.<br />