simon-brooke / youyesyet

Web-app to support canvassers in the forthcoming independence referendum in Scotland
GNU General Public License v2.0
3 stars 0 forks source link

Write Gherkin specification #27

Open simon-brooke opened 7 years ago

simon-brooke commented 7 years ago

We need a top level functional specification which is testable. Harnessing it up to (e.g.) Selenium will not be easy, but even if we don't get an automated test framework working, having a clear unambiguous test script that a human tester can follow will be useful. This is particularly the case if different people are working on different functions.

jamiehollern commented 7 years ago

I think that Gherkin or similar would be good for this and would marry up nicely to the user based specification. I'm quite happy to write and number of scenarios which can be tested manually and automatically.

This may be another issue but as I'm unfamiliar with Lisp/Clojure, do we have continuous integration rigged up yet? If not, I suggest Travis-CI as it's free for open source.

simon-brooke commented 7 years ago

As far as testing back end code, there's tooling for lein to run cucumber tests directly. Documentation here. So testing the JSON API (which I haven't even designed yet, although it will fairly closely wrap the database structure) should be reasonably easily automatable.

However for the front end, in my experience wiring up Selenium to test web pages is a lot of work and the tests can end up being very brittle. A script that a human tester can work to is a good first pass, although Selenium tests (if we could make them reasonably robust) would be better.

jamiehollern commented 7 years ago

For testing the JSON API, I've had a lot of success in professional projects by defining the API in RAML then using functional tests to validate the JSON output against the RAML schema. I'd highly recommend it. http://raml.org

simon-brooke commented 7 years ago

OK, good call.

simon-brooke commented 7 years ago

Would you like to take a task to write a first cut RAML spec? Use the entity-relationship diagram and the database schema (or the migrations) to get yourself started.

jamiehollern commented 7 years ago

Yes I'm happy to give it a bash. In terms of timelines, I realise getting everything done yesterday would be best, but realistically what do you expect?

simon-brooke commented 7 years ago

I've created an issue for this.

simon-brooke commented 7 years ago

I've milestoned it for 14th April pre-alpha release - we don't need the API working for that one, but it would be really useful to have the specification ready because we will need the whole API working for the end May alpha.