Day 19 – Project Transit Notifier

To do: Clear my markers and write unit test & figure out how to test my live data

What I did:  Since today is the last full day of support from Hackbright I decided to change my priority of fixing my markers on my map to getting my testing started.

The first thing I had to do is figure out how to test my functions, when the majority of my function deals with data that is in real time – it is always changes. During scrum-a daily morning meeting where we update out smaller group of what we did yesterday, what our plan is for today and if we are blocked –  my advisor told me to look into faking my data and to look into making an object of Firebase that my data can use instead.

So I started with my docstring test, I only have three functions that I can actually do docstring test because they do not use firebase. That was simple and easy. So now to my unit testing. I looked up making objects and I started to make a FakeFirebase class.

drawing.jpgThen I figured that I’ll need to get fake data to put into my class so I started organizing that. I modeled it after Firebase without all the extra data that I don’t need. I did figure that I’ll need at least 6 vehicles so can have at least one vehicle that doesn’t fulfill a function and make sure my test is not including that vehicle. So now that I have and idea of an outline I started to write it as a diction with several dictionaries inside of it.

firebaseobjectThis took a while since I was making a dictionary inside a dictionary, it got a little confusing. I ran my application so I can get a vehicle that’ll fulfill my celery process of the distance is within the threshold. I did have issues with this guy because it wanted my dictionaries that are keys in dictionaries to be a list – that took about 45 mins to figure out.

Now I have this great data structure and I wasn’t sure how I was going to make it into an object. I was talking to Ally, a fellow hackbrighter, about what I was trying to do- needing to make an object that I can do get request from. She asked me if I can use json. Since my project hasn’t had to use it I didn’t know that I can do get request- I used XML. I think I’ll be able to tackle it as a json since I already have all the data that I’ll need!

My mentor Tim came tonight and he helped me with figuring out how to clear my map marker in my javascript. I talked to him about refactoring my code since I am doing several things within one ajax request and I have two ajax request that are doing similar things. He suggested that its not necessary right now to do so and since its just two items and I’m repeating myself once, its not a “huge thing.” Which was nice to hear, but I think I might play with it over the weekend to break that puppy up

To do Tomorrow: Continue working on mocking my data and figuring out testing

My Thoughts/Process: I knew that testing was going to be interesting for me because of Firebase, but I do wish it was simpler, or at least to have a model to mimic from. But thats okay. I met with my advisor, Katie, and we talked about my experience and figured out that something that I enjoy having to different projects at the same time. I really enjoyed when I have multiple things I can do  and when I got stuck on one, I could jump into something else and come back to it later. But now that I’m towards the end, I find myself taking breaks to talk to others because I don’t have “something to do.” Honestly, there is always something to do, but in my head I have this idea of clumping things into categories and since I’m in the in-between of finishing my project and testing, I’m limiting myself.

My previous places of work, I thrive on having multiple things going on at the same time. I remember working at Blue Sky Wellness Center and being able to manage working with clients, working with my staff, training volunteers, planning long term programming and taking care of today’s goals and always being open for crisis ( client housing issues, emotional issues, clients/employee emotional/mental triggers,  heart attacks, self-harm, substance abuse, seizures, suicide, etc.). I guess my brain just likes to have time to think in the background while I’m working on projects. Interesting….

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s