Any business visited by customers wants to count footfalls.
This project is about simulating data from a footfall sensor and recording it for reporting.
At a top level, the program runs in two processes - the sender and the receiver.
The Sender is responsible for simulating the footfall sensor. The Receiver stores the data.
The Sender sends data to the Receiver using console redirection. Run them on the command line as follows:
sender-executable | receiver-executable
This would make the console-writes of the sender become the console-reads of the receiver.
The naming of source files within the Sender and within the Receiver give their internal decomposition.
This project follows the practices and tools listed here.
We document the interface between the Sender and the Receiver as test cases.
The Sender and Receiver are testable on their own:
- The Sender is testable without the Receiver - so we can develop for another data-source, test and be confident about integration.
- The Receiver is testable without the Sender - so we can enhance without re-testing against all Receivers again.
To simulate different patterns of footfalls, the Sender reads a CSV file as input.
- Sender validates the footfall entries and removes invalid entries if any
- It prints the valid footfall entries to the console in the format id, hour, minute, second, day, date, month, year
The Receiver writes aggregates into another CSV file, which a spreadsheet app can load for further processing.
Aggregates are in the form of:
- Average footfalls per hour, shown over a day
- Average daily footfalls in a week
- Peak daily footfall in the last month
Add the footfalls for a single day and divide the sum by number of working hours. In this case, assume working hours to be 4. The result has the columns - date, month, year and average footfall count for that day.
Add the footfalls for a week and divide the sum by number of work days in a week. In this case, assume working days to be 7. A week starts on Monday and ends on Sunday. The result has the columns - start date of week, month, year and average footfall count for week.
Calculate the daily footfalls for all days in the last month. The result is dates that have highest footfalls for that month. The result has the columns - date, month, year and peak footfall count.
Footfall sensors can malfunction. The facility keeps a manual log of footfalls as well. Make it possible to reconcile the records with the manual log, without having to simulate the input again.
-Sender reads two CSV files as input. One is data from footfall sensor and the other is manual log.
-Sender validates the sensor data and reconcile with the records in manual log and prints it to console
See here for the evaluation criteria of this exercise.