• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

National Routeing Guide help

Status
Not open for further replies.

linusnorton

Member
Joined
6 Jan 2017
Messages
20
Hi,

I'm currently working on a project to create some BDD tests for the National Routeing Guide.

While I believe I understand some of the rules in the National Routeing Guide my actual rail & geographic knowledge is terrible and I am struggling to come up with scenarios to test the rules.

The plan is to produce these tests in the Gherkin syntax so that they would be available to anyone trying to understand the rules or data.

A crude example would be:

Code:
  Scenario: The geographically shortest route is always valid
    Given a journey:
      | SEV | alight   | train     |
      | TON | change   | train     |
      | HIB | stopping | train     |
      | TBW | egress   | train     |
    Then the following routes should be:
      | ***** | valid   |

If anyone is willing to contribute it would be a great help. Either posting here or sending a PR direct to https://github.com/open-track/routeing-guide-tests is great.

Many thanks,

Linus
 
Last edited:
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

Paul Kelly

Verified Rep - BR Fares
Joined
16 Apr 2010
Messages
4,224
Location
Reading
Effectively, I think, you're trying to define a way of describing itineraries in a way that contains the minimum information necessary to validate the journey against the routeing guide. So that is: all journey legs and mode of transport used, all calling points and passing points. Is that correct?

I like the minimalism of it and I think you could get quite far with it. Without a date of travel you won't be able to handle date-specific easements, but perhaps that isn't so important. I also think you'll need to have some kind of reverse syntax for the routes as well, i.e. valid on all routes *except* those in this list. This is needed for when an otherwise valid route is made invalid by a negative easement which only applies to fares with specific route codes.

Are you planning on creating all the tests manually, or by running lots of journeys (random or otherwise) through a "known good" implementation of the routeing guide? And have you thought about how you're going to handle changes in the routeing guide? According to the TSA, changes are only spposed to be made at fares change dates (i.e. three times per year) and for consultation to take place with the DfT and Transport Focus, but that seems to almost never happen and there are can often be multiple changes in a week.

It strikes me that, if the scope of the tests was large enough, it would be quite good for catching the consequences of the frequent changes in the routeing guide (although, to be fair, kieron does a pretty good job of that aready with the updates he posts to the [thread=99396]Routeing Guide Update Thread[/thread]).
 

linusnorton

Member
Joined
6 Jan 2017
Messages
20
Your understanding is correct. The other benefit of using the Gherkin syntax is that it is structured and can actually be executed as a test via a tool called cucumber, although that obviously requires integration with the system you are testing.

I think it's not possible, or wise to try to capture everything so it will never be exhaustive but more like a finger in the air to capture the essence of the guide and perhaps some of the odder edge cases. It will always to susceptible to changing data/topology, as you say it might even be useful to highlight the impact of some of the changes in data.

The positive/negative cases could be captured as:

Code:
  Scenario: The geographically shortest route is always valid
    Given a journey:
      | SEV | alight   | train     |
      | TON | change   | train     |
      | HIB | stopping | train     |
      | TBW | egress   | train     |
    Then the following routes should be:
      | 00000 | valid   |
      | 00034 | invalid |
      | 00215 | invalid |

But that's not clear from my original example.

I haven't seen Kieron's post before so I will give it a scan and see if there is anything I can harvest in there to get me started.

Thanks,

Linus
 

linusnorton

Member
Joined
6 Jan 2017
Messages
20
Oh, and I will probably need to add the ticket type and journey cost somewhere.
 

najaB

Veteran Member
Joined
28 Aug 2011
Messages
33,590
Location
Scotland
You're trying to come up with an algorithm to make sense of the Routeing Guide? Good luck, I'll come visit you in the mental institution.

I heard that AlphaGo and Watson tried and gave up.
 
Last edited:
Status
Not open for further replies.

Top