lschallenges/data-engineering — pull request #105 by npearson72 (2012-10-08 08:14:06+00:00)
Title: LivingSocial Dev Challange

Total time: 8 hours

I tried to respected a 3 hours time block, but was unable to complete the challenge in time. This was the first time I worked with uploading and manipulating CSV file, so it took me some time to work through the kinks.

A couple things worth calling out:

1. I probably spent more time on the domain model than I care to admit. As I analyzed the data, I noticed that there were no unique identifiers for any of the data, which introduced some concern about data integrity and validation.

In short, I chose to use a Transaction model that represented each record in the data set. I then used an Upload model to contain each of the transactions.

This gave me a bit of leeway with basic validations. If any transaction turned out to invalid (i.e. missing data, etc.) the entire upload would be valid.

While I chose to save some data I considered safe (ex: merchants, items, etc.), the qty and price information would be rolled back in case of an invalid upload.

2. Since was my first time dealing with these type of requirements, I was unsure of how to approach testing. I chose (probably to my determine) to approach the challenge as a spike, work through it, and then rewrite or refactor using TDD. Unfortunately the initial approach took substantially longer than I expected, so I chose to conclude it without writing specs.

In the real development scenario, I would be far less likely to release code without TDD.