Hot answers tagged bdd
10
Ideally, the DoD for each user story should mean all tests for that user story are passing, and all automation is completed, running as part of the overall automation (as opposed to on one person's machine), and running with no errors.
Real world usually means compromises, since there's rarely enough time or resource to cover all the potential implications ...
7
Your testers deliver the tests scenarios that should be implemented by the developers and some of your developers write more tests than required. Give them a raise!
I recommend to review the extra tests and check if they make sense. Encourage all developers to write more tests to put their knowledge into tests. They know implementation details, so they can ...
6
I read two questions: (1) should we document the tester-written unit tests and (2) how should we treat tests that assume implementation details?
It's important to distinguish between scaffolding and unit tests. (Please don't get caught up in my terminology; I'm just trying to make a point about some concepts.) Scaffolding is code a developer writes as ...
5
The elephant in the room: maintenance.
How do we maintain this new feature:
what things need to be configurable?
can we easily roll this out (what's the roll out?)?
what support tools do we need to resolve issues with this in production quickly?
I worry that one day all of humanity will be maintining code of our forefathers...
think of the children!
5
I don't see why it wouldn't scale. It's conceptually simple (which naturally makes it self open to scalability.) I would be weary though - the more complex a test is, the less effective it is. If you have tests you're worried about being too complex "Given, When, Then" (I almost abbreviated that to GWT but realized that would confuse people haha. Ahem...) ...
5
Although I don't have any experience using SpecFlow, I've recently starting using StoryQ for this type of testing. Although I was very leary on it at first, I've found it to be very useful, including in complex scenario's. Not only is the code more organized now, but also, I've found it easier to write more complex scenario's as it forces me to break it up ...
4
In the company I'm currently working on, we tested out some testing frameworks out there, and we finally decided to go with Jasmine. This is what we found:
JsUnit: This is one of the oldest unit testing framework, that was later being maintained by Pivotal Labs. But even they are using Jasmine now :P.
JSpec: This is an RSpec like BDD unit testing ...
3
From a pure technical design viewpoint, a single solution would most likely be better.
This is a case where the real answer depends on what the impact is if you run your "Test" tests in production.
For example, if you are testing Facebook and creating new test account from scratch and then modifying it, then you could probably run all your tests in every ...
3
Whenever possible I try to have the same solution for testing in my test environments as in my production environments. It isn't always possible, but when it is there are many benefits of this approach:
You are sure the tests are the same, so all the time you have put
into updating, maintaining and improving those tests for your test
environment also gets ...
3
My definition of done is generally "we don't have to worry about (e.g. touch, test, do ANYTHING with) that feature again in order to release the code.
One of the better discussions I've seen on this is this presentation last year by Ken Schwaber at a Canadian company called Pyxis, it's up on U-tube in three parts, the first part is here
3
There are several useful heuristics for stopping testing. A few I can think of
'No more time' - i.e. we stop due to a business imposed deadline.
Have you come to understand what you set out to understand about the feature (you do set specific goals for test sessions right?)
Mission critical bug unearthed at which point documenting and fixing the bug ...
3
In the traditional sense of the word a unit test is designed to test the smalled functional unit of software such as s single method or function. Unit tests are intended to provide limited testing of the functional capabilities of a function or method in isolation.
Typically, unit tests are written and maintained by developers because they should be used by ...
3
I agree that your tests will require ongoing maintenance (as does most test automation). There are tactics for organizing your Selenium tests so that maintenance is easier, but they depend upon how the user interface is written, whether the developers help maintain the tests, and the manner in which the user interface changes. In fact, the quicker the user ...
2
I could be off my footing here (and if I am, please let me know!), but from a QA perspective, everything that TDD is for automated tests, BDD is for manual tests. Now some of these 'manual tests' may indeed be automated, but only insofar as they're pretending to be a user. They aren't like unit tests.
Just because you have dedicated people doing the testing ...
2
To make this change for "As an admin" you will need to change the code that is generated in specflow. This would be the best place for this change IMHO.
As Lyndon suggests, the code that I have written for WatiN should work, but it really depends on how the application is developed.
My other answer copied below.
What I found to solve the "run test as user ...
2
Some of your developpers are probably doing a combined BDD/TDD approach as described in MSDN Magazine: BDD Primer - Behavior-Driven Development with SpecFlow and WatiN.
I see unittests as a kind of executable documentation that fail if the documentation (=testcode) or the some productioncode (that is called by the testcode) is wrong. Do you consider ...
2
Another thought to add to the well-written answers: In the question, the author mentions a developer's objection:
adopting the Selenium tests to changes (like a changed button_id or something) would take too long.
Since UI tests are brittle with respect to the underlying structure of the UI, UI automation success depends on successful collaboration ...
2
You certainly can. Both WebClient, or HttpRequest would work well as the 'glue' for this scenario.
Note that I'd probably rephrase your Given/When/Then Statement as something like:
Given the logon page at http://someurl/account/logon
When I post with parameters username='test' and password='123'
Then I am redirected to http://someurl/home
1
The insertion of Thread.Sleep() is typically indicative of a race condition in your test and your test is running out of sync with the thing is it testing.
One suggestion may be to insert a polling loop to wait for the redirect, or an event to indicate the redirect has happened.
See http://www.testingmentor.com/imtesty/2012/06/11/sleepy-automated-tests/ ...
1
Let me take BDD out of the equation for a moment and answer your question about what the recommended scenarios are for Selenium automation. I have found that there are 2 primary areas that UI automation should focus on to have the best ROI:
The first is UI specific functionality, for instance anything that is driven by javascript on the page (including ...
1
I agree with Phil completely when he says that it doesn't sound as though you are using BDD/TDD in your project. This would typically include tests written by the developer, either before or immediately after the code was written.
I can also understand part of the uncertainty on the part of the developers. I've had the argument with many of my developers ...
1
Although I haven't had a chance to try it in this particular circumstance, you could try the answer that I received to a similar question.
If it is just as simple as logging in as the admin, I would first ensure that you can log in as an admin, add that code to your setUp, and then do a verification in the Given
1
In a previous life, we used Kanban and tasks with time estimates per task to define the work to be done and the time left on a user story. For us, the DoD was when all tasks for a particular user story were all moved to the "Verified" column on the KanBan.
The only problem with this is if there is an inaccuracy in determining what tasks need to be done. ...
1
You can use Given/When/Then for scenarios with any complicity level, for instance,
Very specific scenario:
Scenario: Error when the password and confirm password do not match
Given I am on User Registration From
When I fill the Form fields as follow:
| Field | Value |
| Name | myusrname|
| Password| password123|
|Confirm Password | ...
Only top voted, non community-wiki answers of a minimum length are eligible
