Wow, seems there's a lot of read-only comments being written out there.
I'm not an "enterprise architect" - but I've been writing code professionally for over 20 years. And I've written a lot of redundant comments that were never read, or that had the code directly next to them changed by the next coder along until the comment was not only wrong, but wildly misleading.
These days, I only write comments in an exceptional case, where the meaning can't be made clear by appropriate code structure, and (most importantly) by the tests. The tests are the documentation (including acceptance tests - see http://cukes.info )
If a comment is wrong, no-one will notice. If a test is wrong, it will break the build, and someone will fix the test, updating the documentation.
The only exception is when you are making a public API - there, you need comments, to document the interface. And you need even more tests!
The single most effective thing was to adopt good testing habits.
Write tests that specify the behavior of the code. Your unit tests should be an executable specification document. Write acceptance tests separately, ideally in a testing tool designed for them, (such as Cucumber for Ruby). Use metrics to identify problematic areas in the code: code coverage, code mutation, cyclomatic complexity, etc. Always ensure you've tested thoroughly before beginning a refactor. Refactor ruthlessly.
I was using lettuce to write some tests today. For a 'natural language' way of writing tests, the .feature files are very useful, as even a non-developer could write tests.
It could do with some more reporting options, although it does mostly appear to be a straight port of cucumber which is a good move.
I'll recommend the RSpec Book. The reason is that it is a fantastic introduction to BDD (which is the biggest reason I love Cucumber). And the real point isn't even BDD, it's a technique that BDD formalizes: Starting with interface, not implementation.
That general idea has dramatically changed how I program, both in terms of being able to complete difficult problems, and in terms of having elegant APIs. I do it all the way down until there is nothing left to abstract. I call methods that don't exist, then when I go to write them, they in turn call methods that don't exist, and so forth, until the implementation is obvious. I found that patterns and APIs emerged without much effort. Of course, I am very familiar with the basics of the language, so I was able to focus very intently on the process without being sidetracked by the syntax or magic.
Anyway, since that's had such a profound impact (the paradigm behind BDD, not the RSpec Book in and of itself -- you don't even need these tools, they just make it easier to apply), I figure it's worth recommending.
Oh and I just thought of one more thing to simplify the album Id take in :
Given a User is on the imgur.com album page When the user clicks share via browser menu Then the workouts for imgur app shows as option
Given the user is on the sharing selection screen When user has selected the imgur app as album Id sharing option Then the app opens And pulls the album thumbnails through And the app allows to import the album from there
For anyone interested, the above format is based of cucumber see http://cukes.info or behavior driven development. A great way to structure test cases and describe a desired feature for developers in the format
Given
When
Then
<and>
Actually, I meant something like Cucumber http://cukes.info
Motivations behind BDD are explained here http://dannorth.net/introducing-bdd/
I hope you like the idea. It changed the way I approach testing and communication with the customer.
IMHO Selenium is too low-level for that. I really like Cucumber and its equivalents for other languages (I've used Lettuce for Python and Behat for PHP), together with a higher-level browser automation library like Splinter, Capybara or Mink.
Okay, you need to understand mavn to get this to work. First create a project with which you want to use JBehave. Then in the pom.xml file add the dependency to the version you want.
<dependency> <groupId>org.jbehave</groupId> <artifactId>jbehave-core</artifactId> <version>3.6-beta-3</version> </dependency>
Here I'm importing the core for jbehave there are other versions you can import for different jvm languages etc.. see the documentation here
Now you'll need to define a jbehave plugin in the maven pom.xml so when you write your tests it knows how to execute them.
http://jbehave.org/reference/stable/maven-goals.html
Have a look here it's quite detailed.
That should be it, you should then be able to execute the tests from the command line using "mvn integration-test" or from eclipse using a plugin.
I have never personally used jbehave, I use cucumber instead.
Seems like this:
Not even the article linkes to this site.
TLDR: Cucumber is a tool that executes plain-text functional descriptions as automated tests. The language that Cucumber understands is called Gherkin.
Seems widespread among the Ruby folks.
Honest answer: it's an interpretive language that can be easy to read. Check out Cucumber. You can write user stories in plain English that both your code and client can use to steer your site in the right direction, i.e. BDD.
Check out Cucumber if you haven't.
I'm working on behaviour driven development on rails with it presently, and it's just awesome how your tests can move from being defined in natural language down to processing with rspec or similar.
While it was designed for ruby / rspec, it runs on Java, .NET, Flex or any language of webapp at all.
Exactly. Doesn't just send them the screens/mockups, explain step by step how the user should interact, and what should happen in each case, including errors (that generally designers forget!).
I've found that attaching a document with that info (preferably, in gherki/cucumber syntax) avoids communication errors and can be used as a loose contract/acceptance test.