To start my decision process, I first look at what my goal is and what I'm doing. Am I doing a characterization test (or a "Panda Test" -M.Smith) of an existing application? Am I starting a project from scratch with business/user involvement? Is this a "testing" project? Is it a development project? Are there reporting or integration requirements? What is the audience? Who will be the user? Who will be the consumer? Lots of things to think through, but I boil it down to two main categories: documentation or tests/development. I like to keep things as open and transparent as possible. This means that I don't want to use something that those involved won't be able to easily consume or understand. If someone will be using/reviewing/contributing to these, then it needs to be presented in a way that they can easily use. Documentation then needs to be just that, not code. Tests and development can have code, but needs to be easily usable. Cucumber handles the documentation side of things well. Adding the middle layer of step definitions (the tests) gives the middle layer for the testers and developers, and the page object layer gives the developers code that is abstracted from the rest of it. Cucumber is plain English, can be written in any editor/ide, and can be printed, pdfd, or whatever is needed. Steps and pages can be written in many different languages, and can be used for most of the different levels of testing. Rspec handles testing and specifications, and gives a the ability for the specification and test to be in the same place. The formatting is more "code" like than documentation like. I usually use cucumber for anything that I will be working on or sharing with anyone else, and rspec for unit testing work that will be reviewed or used by other developers. There is an interesting project called turnip that combines the documentation style of cucumber (gherkin specifically) and the rspec runner... |
Just to be clear, cucumber is not a testing tool, it is a collaboration and analysis tool. Rspec is a specification runner. With that out of the way, here is how I choose what format to write my "tests" in.
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorHi, my name is Clancey and I am a quality advocate, agile coach, scrum master, automator, and toolsmith. Getting started with ruby automation series
Archives
March 2024
Categories
All
|