Posts

Showing posts from December 15, 2013

More on BDD and TDD with examples, Thanks to codeproject.com

User story-  As a product owner, I would like to get an web based email program by which I can compose email on-line and can send email. TDD-  This program should send email if To address is valid. This program should send email if CC address is valid even if To address is not valid This program should send email if BCC address is valid even if CC and To address is not valid. This program should send email even if the subject line is empty. This program should send email even if the body is empty. Problem in this - T here might be some more test cases if the option stated in 1, 2 and 3 are altered. Even there might be more test cases if he considers the format of the body of the email (like plain text, rich text or HTML). If the body is HTML, then he needs to think about the HTML encoding things. BDD- 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 i...

TDD vs BDD

BDD is usually done in very English-like language helps the Domain experts to understand the implementation rather than exposing the code level tests. Its defined in a GWT format, GIVEN WHEN & THEN. Behavior-driven development combines the general techniques and principles of TDD with ideas from domain-driven design Instead of writing tests you should think of specifying behavior. Behavior is how the user wants the application to behave. When your development is Behavior-driven, you always start with the piece of functionality that’s most important to your user. I consider this phase as taking the developer hat off and putting the user hat on. Once you've specified the user needs, you put the developer hat back on and implement your specification. Test-driven development focuses on the developer’s opinion on how parts of the software should work. Behavior-driven development focuses on the users’ opinion on how they want your application to behave.