User stories for classic ASP unit testing example

This is the second part of a series illustrating a way to unit test classic ASP.

In part one we discussed the beginnings of the requirement and why we want to unit test classic ASP.

Here, we will explore the deliverable at hand and step through the beginnings of the use of our the framework (note, this is a fictional scenario derived from the real one I was working on).

We have an order system that we want upgrade so that between certain times the system will not take orders. Before this "down period" you can raise orders for delivery today, during the "down period" you cannot place orders and after this "down period" you can raise orders for delivery tomorrow. If this is a Friday, as we only deliver orders on weekdays we want to ensure the delivery date is for Monday and at this time we do not want to account for holiday periods.

If we translate this into some simple user acceptance criteria we can work against the following:

As a user, if I access the system before 13:00 I should be able to enter orders and they will be scheduled for delivery the same day.

As a user, after a cut off time of 14:00, I should be able to enter orders and the delivery will be scheduled the following workday. If an order is placed after 14:00 on a Friday it should be scheduled for delivery on a Monday.

As a user if I access the system between 13:00 and 14:00, I cannot place an order and the system will provide an appropriate message.

As an administrator I should be able to modify the cut off time and "next order time" and this should affect other user story times.

With the above user stories we can see that there will be a number of business rules within the code and this is the whole point of this series - ensuring we can support the coding of them with unit tests that can be run regularly.



0 comments: