[Lofi Time Radio App] BDD, TDD, Use Cases, Architecture and Modular Design
After deciding to create a radio app that has the same feature as Pueblo Vista Lofi Radio, I start designing the story to help me have the app overview and easily catch up when I start to implement the main features of the app
Story: Listener requests to see now playing lofi track
Narrative #1
As an online listener,
I want the app to automatically load and play the now-playing track
So I can always enjoy the now-playing track with another online listener
Acceptance Criteria:
Given the listener has connectivity
When the listener requests to load now-playing
Then the app should display the now-playing track And automatically play it
Narrative #2
As an offline listener,
I want the app to show the error
So I can always know the app gets something wrong when loading.
Acceptance Criteria:
Given the listener doesn’t have connectivity
When the listener requests to load now-playing
Then the app should display the error state
Use Cases
Load Now-playing Station Use Case
Primary course (happy path):
1. Execute “Load Now-playing Station” command
2. System retrieves station data
3. System delivers Now-playing, Next-play, and listener data
Invalid data — error course (sad path):
1. System delivers invalid data error
No connectivity — error course (sad path):
1. System delivers connectivity error
Play Now-playing Track Use Case
Data:
- URL
1. Execute “Play track” command with the above data
2. System retrieves data from the URL
3. System plays audio from retrieved data
Show Now-Playing Track Use Case
1. Execute “Show Now-Playing track” command
2. System displays audio information such as name, artist
Show Audio Progress Use Case
1. Execute “Show Audio Progress” command
2. System displays audio’s current time
3. System displays audio’s duration
4. System run loop timer with invoking update current-time
Show Control State Use Case
1. Execute “Show Control State” command
2. System displays state of control button (playing, paused)
Show Total Listeners Use Case
1. Execute “Show Total Listeners” command
2. System displays the total of listeners who are listening the radio
Flowchart:
App Architecture:
The above things are all my plan, everything was clear. My work is following all specs and converting them to code. In the next part, I will write about TDD and start to write unit-test for the first part of my app “Network module”