Test system context:
Pick from the list on the right
Story and Requirements
We need a rater to process customer usage. The rater will allow us to issue bills to customers regularly, with bill value based on ongoing customer use, and the tariff available at the time of use. We need to reconcile input and output, to track costs, and to manage invalid records.
Requirements
- The rater should allocate usage to the correct account.
- The rater should match usage to the applicable tariff, and calculate cost based on logged usage and tariff details.
- The rater will assist billing by totalling cost between dates, and indicating that those records have been billed.
- Where account information is missing, the rater should put the usage information into ‘suspense’.
- Where an account does not have an applicable tariff, the rater should put any records into suspense.
- No usage should be billed twice.
- The rater will keep statistics of records rated, records suspended, amount used, cost to be billed
Examples
Account 1, with a tariff of 12K / unit, uses 10 units a day in June and July. The June bill, for 30 days, is 360K. The July bill is 372K
We receive a record of 10 units with an invalid account ID – the use record is suspended.
Account 2 has a June tariff of 5K/unit, and a July tariff of 8K/unit. They use 100 units in June, and are billed 500K. They use 80 units in July, and are billed 640K.
Changes
Added all-new billing
Improved statistics, adding stats for value as well as count
Fixed a couple of bugs, including one around suspended records
Prior version here
Known Issues
- 001: anecdotal reports of conflicts between tariff dates and applicable dates for tariffs on accounts
- 002: anecdotal reports of records wrongly suspended or wrongly processed when they might be expected to be suspended.
Tests
Jasmine unit tests
Here's a set of testing interfaces for my toy rater, version .
Thoughts...
Swift generation – perhaps increasing as date moves on, perhaps triggering billing
Last 5 things in log, ?reverse order
The idea being that there are a couple of things to play kwith whcih give an immediate feel for what the rater / biller is doing.
Perhaps a "production" browser, with a slider for the date, each date showing records / accounts / bills - and a billing event
Test Log - 5 most recent, reverse order
Rater Log – 5 most recent, reverse order
Choose base data:
Currently using: –
Tariffs
Accounts
something else
Details of an account / tariff
Rater is currently configured to use configuration :
Contains tariffSet and accountSet .
Configuration described as :
Current set of test Tariffs:
name
Current set of test data Accounts:
name
Keep changes
config – new name: , new description:
tarrifSet - new name:
accountSet - new Name:
These will generate records and immediately send them for rating. You can see the details of the most-recent record sent, change it and send it to the rater again.
Vary dates (over the last month)
Vary accounts
Vary amounts
Edit generated records
From to
Move the slider to pick a date. Hit the button to rate all records to that date. Hit the other button to put rated records into a bill.
Vary something
nothing yet
Testing stats
Test has sent records for rating.
Processing stats
Number Amount Value Processed Allocated Billed Suspended
Test Log
Rater Log
Bill Runs
Suspended records