Skip to content

Engin-Boot/visit-case-s1b11

Repository files navigation

Recording Visit Counts

Any business visited by customers wants to count footfalls.

This project is about simulating data from a footfall sensor and recording it for reporting.

Decomposition

At a top level, the program runs in two processes - the sender and the receiver.

send-rcv

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.

Decomposition of responsibility within the Sender and Receiver

The naming of source files within the Sender and within the Receiver give their internal decomposition.

The Code

This project follows the practices and tools listed here.

The Interface

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.

Minimum Functionality

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

Average footfalls per hour, shown over a day

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.

Average daily footfalls in a week

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.

Peak daily footfalls in the last month

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.

Extended Functionality

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

Evaluation Criteria

See here for the evaluation criteria of this exercise.

About

visit-case-s1b11 created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages