D3: Test Plan

Part 1: 

What our test plan would look like if we had enough time:

  • Unit testing
    • We would use Jest, a JavaScript testing framework for our unit testing. The ts-jest module allows us to use Jest with our TypeScript app. This is also the testing framework used by the previous group that worked on this project and will allow us to build off of their set of tests.
    • Test FirebaseAuth
    • Test Firestore CRUD methods
      • Create games
      • Create users
      • Select teams
      • Read games
      • Read specific game
      • Read users
      • Read teams
      • Update games
      • Update users
      • Delete games
      • Delete users
  • Integration/System testing 
    • For these we will ensure the data that is in our Firestore database is being displayed in real time by the front end.
  • Tools used
    • VScode as an IDE
    • Firebase for backend as a service
    • Expo for UI testing and deployment
    • ESLint for linting
    • TypeScript for type checking
    • Jest for unit testing
    • React Native Testing Library
  • Types of users
    • Admin
      • The admin user is a type of user who creates games, selects the time that they will be played and the teams that will make up the game, and then manages the game in real time. Managing the game involves creating and changing questions as well as moving from one question to the next while the game is being played.
    • Player
      • The player user is on the other side of the games. They are presented with a list of available games and then select one from the list to play when the admin user starts the game. When the game is started the players answer questions and compete to win the game as a team formed by other players. At the end of the game, the players are awarded a certain amount of points that are redeemable on the rewards page.
  • Performance/Reliability testing
    • Firebase console’s app metric dashboard along with in-app monitoring that tracks delays in data requests
    • In the future, FanzPlay must be able to run with thousands of users at the same time. We can use tools like Firebase Performance Monitoring to identify and monitor any performance issues we may encounter. Firebase Performance Monitoring would allow us to monitor the network, HTTP/S network requests, start-up and rendering times, and crashes. 
  • Acceptance testing
    • Our client (Taylor Walls, CEO of FanzPlay) will review the app’s functionality and features to assess whether it meets the expected requirements. We have been meeting with her weekly throughout development in order to receive constant feedback and direction on what we have implemented and plan on implementing from week to week.

Part 2:

What our testing will realistically look like given our time constraints:

  • Unit testing
    • We would use Jest, a JavaScript testing framework for our unit testing. The ts-jest module allows us to use Jest with our TypeScript app. This is also the testing framework used by the previous group that worked on this project and will allow us to build off of their set of tests.
    • Test FirebaseAuth
    • Test Firestore CRUD methods
      • Create games
      • Create users
      • Select teams
      • Read games
      • Read specific game
      • Read users
      • Read teams
      • Update games
      • Update users
      • Delete games
      • Delete users
  • Integration/System testing 
    • For these we will ensure the data that is in our Firestore database is being displayed in real time by the front end.
  • Acceptance testing
    • Our client (Taylor Walls, CEO of FanzPlay) will review the app’s functionality and features to assess whether it meets the expected requirements. We have been meeting with her weekly throughout development in order to receive constant feedback and direction on what we have implemented and plan on implementing from week to week.
  • Tools used
    • VScode as an IDE
    • Firebase for backend as a service
    • Expo for UI testing and deployment
    • ESLint for linting
    • TypeScript for type checking
    • Jest for unit testing
    • React Native Testing Library

While part two is not quite as comprehensive as part one, it still ensures all the necessary components of our application are functioning as expected. It also ensures that every piece of the application that has been promised to our client is functionnig as promised and is ready to be presented to investors according to their desires. Unit and acceptance testing are prioritized as they are the most realistic forms of testing available with the given resources and time.

Testing our Code

The testing is done inside the test folder in our GitHub repo.

This app has unit testing for our database operations. To test our Firestore database functionality, we use a Firestore Emulator. This emulator allows us to test without worrying about modifying our live database.

Prerequisites (one time setup):

  1. Ensure you are an editor or owner for the FanzPlay (if you do not have access, request access by emailing wilsonhh@email.unc.edu and sharing the Google account you would like to use).
  2. Ensure your Node.js version is >=18.0.0 || >=20.0.0
  3. Install Firebase CLI: npm install -g firebase-tools
  4. Install all project dependencies (including testing modules): npm install

Initialize the Emulator (one time setup):

  1. In the terminal, login to Firebase: firebase login
  2. Initialize Firebase: firebase init
  3. Select firestore and emulators
  4. Select use an existing project
  5. Choose fanzplay-6229f
  6. Choose Firestore Emulator
  7. Use default port
  8. Select download now

Launch Emulator and Run Tests:

  1. In a terminal, login to Firebase: firebase login
  2. Start emulators: firebase emulators:start
  3. Open a separate terminal and run the tests: npm test
  4. Restart the emulators each time you test