Creating a Simple Data Collection App: Part 1
Unhappy with the current data collection apps out there? Then create your own!
Ruby Code Review: Data Collection Program
Other parts in this series
Check back later for the other parts of this tutorial
This is Part 2 of a multi-part code sample and review for creating a simple data collection system using Ruby and Gosu. Future parts will be released soon!
Part 1 Overview
In Part 1 of the review, I will be defining the data collection app I am going to create by writing User Stories.
Why Ruby?
For this project, I have elected to program the simple data collection app in Ruby. This is for three reasons.
-
I am currently in a training program that is focusing on Ruby and I would like more practice.
-
There are many tutorials and books for writing some variation of this in Visual Basic so there is no need for that again.
-
I would like to eventually expand this in to a web application using HTML and javascript as an additional side project.
However, Ruby does not come pre-built with a way to show a visual interface to a user. We could write some fancy output in our terminal, but instead let’s use Gosu. Gosu is additional software we can use to present a visual interface to our users.
User Stories
When developing software, it is a good idea to know what you are going to build before you start coding. One way to phrase the requirements is through “User Stories”. User Stories are written from the perspective of a user of our application and they specify what the user wants to do and how they can accomplish it. Let’s look at some User Stories for the Data Collection Software.
Creating a Session
- As a behavior analyst (user)
- I want to create a new session
- So that I can start collecting data
Choosing a Session Duration
- As a behavior analyst
- I want to set the duration for the session
- So that the session will end at the correct time
Defining Behavior
- As a behavior analyst
- I want to add behaviors I am going to measure
- So that I can easily see behaviors during a session
Collecting Data
- As a behavior analyst
- I want to type a key on the keyboard corresponding to a behavior
- So that I can increment the count of that behavior
Summarizing Data
- As a behavior analyst
- I want to click a “Summary” button
- So that I can see the results of the data collection (frequency, rate for each behavior)
Part 1 Conclusion
Now that I have roughly defined the requirements of the application, I can start writing some tests. Tests allow us to quickly discover if our code is working and if we have met our initial requirements.
The next part of this code sample and review will examine the challenges of creating a console-based version of this application.
Ruby Code Review: Data Collection Program
Other parts in this series
Check back later for the other parts of this tutorial