The last two weeks I'm doing a deep dive into development automation process, which should save allot of time.
a big part of a development process is testing, and as of that many methodologies emerged such as TDD(Test driven development) and so.
The main purpose of these test driven methodologies is to produce a better quality code by creating a set of tests and then write a testable code.
What is BDD?
Behavior-driven development (BDD) is an evolution of test-driven development (TDD) and acceptance-test driven design,
and is intended to make these practices more accessible and intuitive to newcomers and experts alike.
It shifts the vocabulary from being test-based to behavior-based, and positions itself as a design philosophy.
let me explain it in a more explicit way:
as a newcomer to the TDD like process, I found myself asking questions like :
How vastly my tests should me?
Where do I start?
How do i integrate the TDD process with the rest of the development process?
How to write a testable code?
What would be the impact of it?
How do I justify it to the stakeholders?
often stakeholders aren't eager for process changes especially if they are unfamiliar with the new techniques,
cons seems to be having a greater impact on a decision process rather than the major advantages, even if they are insignificant comparing to the advantages.
In what way does the BDD elevate the TDD process?
To answer that question, let's put aside the code writing and the testing process and focus on the entire development process.
Often technical person and a business person speak in "different languages", even analysts and developers sometimes suffer from misunderstandings.
Behavior driven development is a technique that designed to eliminate ambiguity and miscommunication between people on different roles.
this technique comes to solve one basic thing : how do i write a process requirement in a way that would be understandable to all the development personnel, and ensure that the implementation covers the requirements.
To answer the question "where do I start?" ask yourself "what is the next most important thing that the system does not do?"
This question should get you started.
Lets define our requirements in the following template :
As a [role]
I want [Feature]
So that [Benefit].
Defining requirment in this way answers a few important questions:
- Who is the stakeholder for the given request (this is the person that should care about the wanted feature)
- What is the needed functionality?
- What would be the benefit from this specific feature?
Note that when these specific questions answered, you can see which features are more important (and which are not relevant at all).
this way interaction with all the development related personnel will be in "the same language".
Developing scenarios that could happen due to given requirement!
i find the word "scenarios" or even "specifications" more pleasant than "Test" for some reason,
no matter how you look at it, success of these "scenarios", which are situations or a set of rules that must be handled in a specific way, are viable to the success of your project/product/feature development.
Ok, this is all great, but how all this relates to TDD ?
glad you asked this question, i see it in a very simple way:
If the system fulfills all the acceptance criteria, it's behaving correctly.
To summarize all this,
i would say that BDD is a way to produce an idea for a requirement into an implemented, tested production ready code.
stay tuned for the second part about writing scenarios, development tools and more.