- Podcasts
- Programmers
- 🫢 Python Behave BDD
About this episodePython Behave testing
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
🫢 Python Behave BDD
Bdd is a software development methodology that emphasizes collaboration between developers QA teams. Us and stakeholders with behave. We can write tests in claim in English, which makes them easy to understand and maintain even for non-technical stakeholders but what are the disadvantages you ask. Yes there are disadvantages.
There is another cone to using this Library. The con is that once we start writing tests in the behave bdd methodology, it's different. It's not looking like a normal programming language, it's good to write tests. I think it, it makes sense to itse the behave, but once we use it, Then we have to kind of test those that are written in the bdd methodology and those that are written in the let's say, python do you notice? They didn't test library or the pythons Library. So we need to maintain if multiple things. It's, especially useful when we want to provide non-technical people with the ability to Y test because it's written, as we said, in human language.
Of course, the computer would not understand this. Normal language, we would need to provide another file, another couple of files. The environment fight, and then there is that dot steps files, which would translate. But it's pretty easy, it's not that hard. If I made it and you will make it so you add and couple of more files to assist. So when you quite so basically you have one file which is the file dot feature, then you add multiple files that exist in order to test application.
Then you have a global environment file, then you have the step, slide step size and the environment. Five are supporting the dot feature files and how is it looked like, how does the bdd look like the bill DDE? Let's take the feature fight. Looks like this feature checkout process as the customer, I want to be able to check out and pay for my atoms so that I can save my order scenario.
Successful, check out given I have added an item to my cart and I have navigated to the checkout page when I entered shipping and payment, you Mission and they click place order button, then I should see a confirmation message. So, you see, it's pretty like, normal human language and straightforward, but things are not as those easy as it seems because we can, we still need of course to implement everything behind this. So, once we have the feature file written, we use the behave library, to generate the step definitions, which are the code that actually executes this test at the test. And we would need to fill fill in the steps. And once we run the tests using behave in the command line, it will read our feature files, match the steps to the appropriate, step definition, and execute the steps. If a test fails behave with provide us with the whole message, of course, So, so, what's the difference? You ask the main difference in
behavior is that it allows us to fight testing plan English, but as we said, of course, we would need to support it. So it's good. If you will need to give the ability to high test, to someone who's not a software developer, which makes it easy to, to, to White test, we tell them what are the abilities, the capabilities, what did the software developer writing, the steps files That day.
Well, I'm not software developers would be able to write such a filter feature files. And let's talk about again about the downsides and limitations of using the behavioral, the behave Library. So, one potential downside, is that writing a feature, files can be time-consuming, especially for complex application because it's not a programming language.
So the recommendation is to start a service to start small and gradually, see if it fits us and walk away to more complex tests to. So impose the ton to collaborate with multiple people, with the clients would need to use. Use this library and stakeholders and see that everything matches the expectations.
