Gherkin: when and then step definition are more or less the same - bdd

I have the following specification:
Scenario: Retrieve customer license document
Given I have a customer with no license
When I retrieve the license document
Then the license document should not be retrieved
In this scenario the When and Then step definition are more of less the same. What I want to specify with this scenario is that it's not possible to retrieve a license document when the customer has no license.
When I Retrieve the license document implies that the retrieving of the license is possible.
Does anyone have a solution to rewrite this scenario?

In such cases, the when clause is redundent
Scenario: Retrieve customer license document
Given I have a customer with no license
When I retrieve the license document
Then the license document should not be retrieved
Put the then caluse's codebehind implemenyation in try catch. In catch, post a success. In try block, at the end raise an exception.

There is no hard and fast rule on how do you write the scenarios, there isn't any standard format in gherkin either. But, gherkin is specifically, for having and making non-technical like BA's, stackholders, non technical managers understand, what the test is really about. The more precise you use the sentences, the more understandable and meaningful it is.
If you are not going to write the steps in a understandable way, there is no need to implement gherkin at all. You may just code it in ruby or Java and let the BA's etc.. understand the code on their own.
In your scenario, Using When in the third step, makes more sense than then.
When is precisely to describe the key action the user/Program
performs.
The purpose of Then steps is to observe outcomes.
Scenario: Retrieve customer license document
Given I have a customer with no license
`When` I retrieve the license document
Then the license document should not be retrieved

So you have a scenario like this:
Scenario: Retrieve customer license document
Given I have a customer with no license
When I retrieve the license document
Then the license document should not be retrieved
BDD is all about communication between the development team and the business. What would the business describe the behaviours of the system to be?
Would they say something more like this?:
Scenario: Customer has no license
Given Carl the Customer has no license
When Bernadette the Business User attempts to retrieve Carl the Customers licence document
Then Bernadette the Business User should see no license document for this customer

Scenario: Verify that license document should not be retrieve when customer has no license
Given I have a customer with no license -- Given explains what you have
When I retrieve the license document -- When explains what you trying to do
Then verify that the license document should not be retrieved --- it is the final result of scenario

Related

Is there a way to edit the source code of the JIRA Issue Collector?

I am trying to allow users to create issues from a webpage, just like the Issue Collector. The problem is, there are only three templates provided for the collector and none of them are quite right.
What I want is to have three required fields that then combine to become the description. (Similar to how the first template has "what do you like" "what do you not like" which both go in the description)
The problem is there's no obvious way to edit the popup's contents.
Is there any way I can get at the source code of the collector to create my own modified version? Alternatively, if I just copy the html of the popup using inspect element could I create a working clone?
EDIT: Well, I've managed to get at the source code using a java decompiler, but now I haven't got a clue how to put it back together again...
Do you have a paid license for JIRA? If so, Atlassian will give you a copy of the source code.
From their FAQ's
After an order has been placed, how and when can the license key and source be accessed?
Access to your license key(s) and any
applicable source code is provided only after the successful receipt
and processing of your payment. Once payment is received, the Billing
and Technical contact specified on the order can log into their My
Atlassian account, and view all corresponding license keys.
And instructions on how to "put it all back together" :)
Then you are free to customize to your heart's content.
Of course, you'll need to re-customize every time there's an update from Atlassian ...
See also this post on Atlassian's wiki

TFS 2013.2 Licencing Information

I work for a medium size corporation that uses TFS2013.2. We have about 130 people who access TFS. This product is unusual for us as it is run and maintained by the development staff, rather than IT pros. A result of this is that there is a greater fear than normal that we may not be meeting our licencing obligations.
Currently, everyone, except Team Administrators, have their permissions allocated via Windows groups and to get added to one of these groups a licence, CAL or MSDN, is allocated to you. Therefore, I am confident we are meeting our obligation. However proving it is beyond me.
Is there a single place I can go to see who has access to TFS? I have found a dbo.tbl_Identities table in the Configuration database, but that seems to contain people seemingly at random from one or more of our domains and anyway contains people who have left.
How about using tfssecurity.exe to list all the valid TFS Groups and group members. You'd have to clean up the output a bit but domain users should be easy to spot:
tfssecurity.exe /imx "Team Foundation Valid Users" /collection:http://tfs2013:8080/tfs/defaultcollection
Alternatively you could use the api
TeamFoundationIdentity identity = gss.ReadIdentity(IdentitySearchFactor.AccountName, "Team Foundation Valid Users", MembershipQuery.Expanded,ReadIdentityOptions.None);
TeamFoundationIdentity[] identities = gss.ReadIdentities(identity.Members, MembershipQuery.Expanded,ReadIdentityOptions.None);
Iterate through the list of returned users and do something clever with the results.
You manage the license using the page at http://<your-tfs-address>:8080/tfs/_admin/_licenses. There you find Export audit log to check who has access and their license level. In the same page you can assign user to a different licensing level.
Also note that upgrading to Update 4, your get the Stakeholder level which gives a lot to casual users which do not have a TFS CAL.
For more information see MSDN.

getting the balance right between SBEs and other product documentation

Reading online material (e.g. Fowler, Gerard), it seems that Specification By Example stories should not be complete specifications of functionality.
Question 1: How does one starting off with SBE's decide how comprehensive their stories need to be in terms of describing all of the functionality of a system? I.e. when can I stop writing stories because I have captured enough?
Question 2: In an organisation where test teams verify products against the product documentation, if the stores are not a complete specification, am I correct in thinking that 'other' product documentation needs to contain all the cases that are not covered by the SBE's?
Regarding question 1:
The most important part of developing any system is that the development team has a conversation with the product owner. First find out the crux of the feature which they require. I'll answer this question by working through an example; let us say that the product owner may want a facility to login to their new website. This requirement could be written as:
In order to gain access to the website's facilities
As a user
I want to be able to login to the website
(Note that I'm using the Gherkin domain specific language for writing the scenarios and features in this answer)
With the product owner's key requirement specified, you should now discuss with them how you think this feature should be implemeneted from a users perspective (keep it high-level, don't use technical jargon, discuss with the business to find out what they want). So the first "happy path" scenario you might identify could be:
Given a user is on the login screen
When they submit valid login credentials
Then they gain access to the main website
After further discussion with the product owner they tell you that as the website contains extremely sensitive information, and that any failed log-in attempts should be reported to a system administrator. This would result in another scenario:
Given a user is on the login screen
When they submit invalid login credentials
Then the system administrator is informed of the failed log-in attempt
And the user is informed that their login attempt failed
At this point the product owner might say that these are the only scenarios they want for logging into the system. So from the development teams perspective no more investigation would need to be done regarding this feature (so you wouldn't need to write any more user stories). Sure, at a later point in the projects development, the product owner might also tell you that they'd like to inform a user when they last logged into their site before reaching the main website, but you'd only need to worry about this when they ask for it.
Regarding question 2:
The organisation should be verifying the products against "living" documentation e.g. using Cucumber(for example) which generates tests from the scenarios detailed above.
Also as I said in the answer to question 1, you should identify "just enough" of the scenarios/use cases to satisfy the product owner. What the product owner asks for is the complete specification. Don't try and second guess what the product owner might want because this may result in be a classic case of YAGNI.

Access Transactions in Quickbooks Online

I'm using trying to interface with Quickbooks Online for an internal application that will push and pull transactions using qbXML. My problem is that I can't figure out which message I need to send in order to list and add the items listed under the "Banking" > "Registers" page. I've gone through the messages listed in the Onscreen Reference for Intuit Software Development Kits and none of them seem to give me this information.
Also, does anyone know of a list that explains what each message does?
If you're in a bank account register, you're writing checks. There are 3 kinds of checks in QuickBooks:
Expense checks - if you added a check directly in the register window, you would be adding an expense check.
Bill payment checks - these appear in a check register, but you can only add them with a bill payment operation.
Payroll checks - these appear in the check register, but they can only be added using the Intuit Payroll Service or by enabling manual payroll (almost no one does manual payroll in actual practice, but it is good to know about for testing purposes).
The first 2 types of checks have their own message type: the Add/Mod Check and Add/Mod BillPayment messages respectively. Payroll checks can't be added by the SDK. You can query all 3 types using a Transaction query message. I should also mention that it's possible to add an entry in any register using a journal entry, but that's not a good idea unless you are certain you know what you're doing.
I hate to tell you this, but the best reference for QuickBooks messages is the one you're already using. There are also XML files in the <sdk root>\docs directory that describe SDK operations. But there is really no substitute for understanding how QuickBooks operates from a user's perspective.
If you're going to be working with QuickBooks integration, it's a good idea to make friends with one or more QuickBooks Pro Advisors so you can run these kinds of issue by them. The relationship is generally mutually beneficial, since QuickBooks Pro Advisors often find it handy to have access to an SDK programmer.

ECCN number for Commstudio ActiveX

I am in stage of getting the export license for my company product, which needs information of all the components/products involved in the implementation of my company product. Regarding Commstudio ActiveX product, my questions are:
What is the country of origin for this product?
Does this product contain any encryption?
Is the product subject to EAR (export administration regulation) or not, if product is USA based? Please explain.
What is the ECCN/Export License number for the above mentioned product?
The most important among all is the question number 1 and 4. I already searched the web, and also written an email to Commstudio personnel, but no success yet.
This is something you really need to contact the manufacturer about directly to make sure you get an accurate answer. From their website it looks like they are US based: http://www.commstudio.com/about/contact

Resources