say hello 2 bdd

21
A step towards next generation of development methodology?? Say Hello to “Behavior Driven Development” “BEHAVIOR” sounds cool! I think I can add another “Buzz Word” in my resume!

Upload: mhazad

Post on 12-Jul-2015

260 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Say Hello 2 Bdd

A step towards next generation of development methodology??

Say Hello to “Behavior Driven Development”

“BEHAVIOR” sounds cool!

I think I can add another

“Buzz Word” in my

resume!

Page 2: Say Hello 2 Bdd

A brief history (or story) of almost all developers

Page 3: Say Hello 2 Bdd

What is TDD and why it is needed??

Page 4: Say Hello 2 Bdd

But…I have been in

development for years with lots of successful

projects

Page 5: Say Hello 2 Bdd

Questions that raises in mind

WHY the developers feel

uncomfortable to write test

code, even after completion of

development?

Is there any way to over come

this?

Page 6: Say Hello 2 Bdd

Lets dig a practical example!

Page 7: Say Hello 2 Bdd

What could be the possible test cases.

1. This program should send email if To address is valid.

2. This program should send email if CC address is valid even if To address is not valid

3. This program should send email if BCC address is valid even if CC and To address is not valid.

4. This program should send email even if the subject line is empty.

5. This program should send email even if the body is empty.

Page 8: Say Hello 2 Bdd

And Then…

Page 9: Say Hello 2 Bdd

Lets find a cure!

Page 10: Say Hello 2 Bdd

What ifSpecification /Requirement

Behavior of the Module

How it will behave in all

possible situation?

Page 11: Say Hello 2 Bdd

At first! You must know how the medicine is going to work!

• 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).

Page 12: Say Hello 2 Bdd

Lets learn some Buzz Word!

Human Computer Interaction

Ubiquitious Language Domain Specific Language

DDDDomain Driven Design

Page 13: Say Hello 2 Bdd

Why Buzz words in middle of such complex problem?

Page 14: Say Hello 2 Bdd

Good News!• What ever your

write follow

Given-When-

Then rule.

• Can be written

by any person

regardless of

technical

background.

• This plain

English can be

compliable!

• Plain English to

C#/Java/Python

Page 15: Say Hello 2 Bdd

I can be a language with a simple RULE but I have a name!

Page 16: Say Hello 2 Bdd

Here is the same requirement following this rule!

Given that a web based email module has been developed

And I am accessing it with proper authentication

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

And keeping the subject field non empty

And write something in body text area which excepts rich text

And press or click send button

Then my email will be sent

And the event will be logged in log file.

•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?

Page 17: Say Hello 2 Bdd

A new concept!

• 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.

• Such phenomenon are termed as Behavior Driven Development (BDD) and I am pretty sure you have understood the basic concept of BDD by now.

Huh! I know BDD now and I can add it to my resume without

hesitation!

Page 18: Say Hello 2 Bdd

Lets See BDD in Action!

• For Java: Use Jbehavehttp://jbehave.org/reference/stable/getting-started.html

• For .Net use SpecFlow.

Page 19: Say Hello 2 Bdd

A small requirement!

Given that we have a search form that searches over Name, Address and Profession table

When the user enters non empty text

And the length of the text is more than 3 alphanumeric character long

Then the user will get the search result

And if the search result is empty he will get an message box asking him to do the search again.

Page 21: Say Hello 2 Bdd

Thank you!

• Any Questions? Query?!