Difference between revisions of "IS480 Team wiki:2017T1 Ravenous Mid Term Wiki"
Line 595: | Line 595: | ||
|} | |} | ||
− | === Technical Complexity === | + | === Technical Complexity === |
+ | ==== Asynchronous Nature of NodeJS ==== | ||
+ | ===== SetTimeout ===== | ||
+ | To stop the asynchronous calls initially, setTimeout was used. This was used via trial and error basis to see how long a previous request call would take, and run the next block of codes after the elapsed time.<br><br> | ||
+ | This is easy to implement however, this comes with many disadvantages. For one, this is a highly unreliable method. Although a request call to Graph/Messenger API would usually take less than second, there could be instances where FB’s server slow down and exceed a second. This would cause our app to crash since there would still be many variables not instantiated yet. This method is essentially hardcoding.<br><br> | ||
+ | Secondly, it causes the code to be very hard to read for other developers. With each setTimeout, the next block of codes has to be indented in. With the nature of our code, we will be affected by asynchronous calls many times, causing our codes to be unnecessarily heavily indented to the right. <br><br> | ||
+ | [[File: Ravenous - tc1.png|720px|center]]<br> | ||
+ | [[File: Ravenous - tc2.png|720px|center]]<br> | ||
+ | |||
+ | ===== Callbacks ===== | ||
+ | Callback was a better method than hardcoding timeouts. This guarantees a request call is completed before proceeding to the next block of codes for most cases. Callbacks can solve most problems but not all. For example, getting multiple values from request calls first, before proceeding and making multiple request calls in order.<br><br> | ||
+ | Another drawback to using callbacks, is that the indentation problem is not solved. With every callback function, the next block of code is indented, making it difficult for other developers to read.<br><br> | ||
+ | |||
+ | [[File: Ravenous - tc3.png|720px|center]]<br> | ||
+ | [[File: Ravenous - tc4.png|720px|center]]<br> | ||
+ | [[File: Ravenous - tc5.png|720px|center]]<br> | ||
+ | |||
+ | ===== Recursion ===== | ||
+ | To make multiple calls in order, Promises was also explored but it did not work. This could also be due to the lack of understanding the Promise concept at that period. Since timeouts, callbacks and promises weren’t working, we explored the use of Recursion to send messages in guaranteed order to users.<br><br> | ||
+ | |||
+ | [[File: Ravenous - tc6.png|720px|center]]<br> | ||
+ | |||
+ | ===== Promises ===== | ||
+ | Promises required some reading up and researching before actual implementation as this is a new asynchronous concept with little examples online as compared to callbacks and setTimeout. Promises solves all of our problems. It guarantees the request is done before moving on, it can make multiple request calls and storing the values synchronously and lastly, do all these while maintaining clean code.<br><br> | ||
+ | |||
+ | [[File: Ravenous - tc7.png|720px|center]]<br> | ||
+ | |||
+ | This is a really clean way of sending multiple messages and performing other calls within the function. Imagine using callbacks or timeouts, after each sendMessage and delay function, all subsequent codes has to be indented. For the example, the code would have had to be indented more than 10 times!<br><br> | ||
+ | |||
+ | [[File: Ravenous - tc8.png|720px|center]]<br> | ||
+ | |||
+ | We used Promise.all to collect all contents of the resolved body from the promise methods. In the above example, a request is made to Graph API to retrieve the Event Image URL for a list of Events. Thereafter, we use a Promise.all to retrieve all the URLs obtained previously. This is done synchronously. <br><br> | ||
+ | |||
+ | [[File: Ravenous - tc9.png|720px|center]]<br> | ||
+ | |||
+ | Async/Await – Node Version >= 7.6.0<br> | ||
+ | Async/await has recently been shipped with official support in Node 7.6 (released in early 2017). It is built on top of promises and needs to be used in conjunction with them. While Promises keeps code cleaner in comparison to using callbacks, async/await is even more concise.<br><br> | ||
+ | |||
+ | [[File: Ravenous - tc10.png|720px|center]]<br> | ||
+ | |||
+ | In this example, we used the await keyword before calling asynchronous functions (that must return promises). If this were written with standard promises, there would need to be a chain of then blocks and return statements. Async/await makes code look synchronous and improves readability significantly.<br><br> | ||
== Quality of Product == | == Quality of Product == |
Revision as of 21:14, 4 October 2017
Contents
Project Progress Summary
To access EvBot & FaBot, login to Workplace@Facebook instance by clicking here
To access Dashy, click here
Project Highlights & Snapshots
Project Management
Project Status
Scope: Core
Module | Task | New Feature? | Status | Confidence level | Comments |
Event ChatBot (Organiser) | Register an event | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | Remove event | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | Close event | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | Add & Remove questions | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | Send Survey Questions | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | Send Survey Reminder to participants | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | View Survey Questions | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | View Event Snapshot | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Organiser) | About EvBot | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Participants) | Check-in Event Attendance | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Participants) | View Surveys | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Event ChatBot (Participants) | About EvBot | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Facility Booking ChatBot & FMS Module I | Search available facilities | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Facility Booking ChatBot & FMS Module I | Book available facilities | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Facility Booking ChatBot & FMS Module I | View booked facilities | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Facility Booking ChatBot & FMS Module I | Cancel booked facilities | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module I | View claim rate vs active rate for all agencies and specific agency chart | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module I | View aggregated engagement scores of groups within an agency | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module I | View breakdown of engagement scores of groups within an agency | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module I | View Pc vs Mobile Graph | No | Fully deployed and 100% Tested; On production server | 1.0 | In Progress |
Analytics Dashboard Module II | View group privacy setting across specific group charts | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module II | View group activity charts | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module II | View interaction analysis of specific agency | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module III | View number of active users charts | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module III | View content on workplace chart | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module III | View word cloud chart | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Analytics Dashboard Module III | View post-time & comment-time chart | No | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Authentication & Security Module | Register account on Dashy OTP Bot | Yes | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Authentication & Security Module | OTP Bot | Yes | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Authentication & Security Module | Login/Logout on Dashy | Yes | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Authentication & Security Module | Forget password | Yes | Fully deployed and 100% Tested; On production server | 1.0 | Completed |
Authentication & Security Module | Secure all API Calls with JWT Token | Yes | In Progress | 1.0 | In Progress |
Scope: Secondary
Module | Task | New Feature? | Status | Confidence level | Comments |
Analytics Dashboard Module IV | Export dashboard to CSV File | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
Analytics Dashboard Module IV | List of activated and deactivated accounts of each agency in past 7 days | No | In Progress | 1.0 | In Progress |
Analytics Dashboard Module IV | Filtering options based on user activity/profile | No | In Progress | 1.0 | In Progress |
Analytics Dashboard Module IV | Dashy additional metrics: Overview | Yes | In Progress | 1.0 | In Progress |
Analytics Dashboard Module IV | Dashy additional metrics: Group | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
FMS Module II | Release a booking that has begun | Yes | In Progress | 1.0 | In Progress |
FMS Module II | Extend a booking that has begun | Yes | In Progress | 1.0 | In Progress |
FMS Module II | Modify make, delete, view and search facilities to replicate GovTech's System | Yes | In Progress | 1.0 | In Progress |
Facility Booking ChatBot Module II | Advanced NLP | Yes | Completed | 1.0 | Completed |
Facility Booking ChatBot Module II | View room host details on workplace and have the ability to contact host | No | Completed | 1.0 | Completed |
Facility Booking ChatBot Module II | Re-prompt user with other room to book in case of clash in booking | Yes | Completed | 1.0 | Completed |
Analytics Dashboard and Bots Integration Module | Expose EvBot Event report | Yes | Completed | 1.0 | Completed |
Analytics Dashboard and Bots Integration Module | Dashy displays event statistics for event organisers | Yes | Completed | 1.0 | Completed |
Analytics Dashboard and Bots Integration Module | Expose FaBot usage metrics | Yes | In Progress | 1.0 | In Progress |
Analytics Dashboard and Bots Integration Module | Expose EvBot usage metrics | Yes | Completed | 1.0 | Completed |
Analytics Dashboard and Bots Integration Module | View FaBot usage metrics for workplace managers | Yes | In Progress | 1.0 | In Progress |
Analytics Dashboard and Bots Integration Module | View EvBot usage metrics for workplace managers | Yes | Completed | 1.0 | Completed |
Event ChatBot (Organisers) II | Display attendee that didn't turn up | No | Completed | 1.0 | Completed |
Event ChatBot (Organisers) II | Organisers message broadcast | No | Completed | 1.0 | Completed |
Event ChatBot (Organisers) II | Organisers trigger prompt for participants to check in | Yes | Completed | 1.0 | Completed |
Event ChatBot (Organisers) II | Display attendees yet to complete survey | Yes | Completed | 1.0 | Completed |
Analytics Dashboard Mobile Responsiveness | Optimize web pages | Yes | Completed | 1.0 | Completed |
Scope: Good to have
Module | Task | New Feature? | Status | Confidence level | Comments |
Database Optimization Module | Optimize syncing of new data from Workplace@FB with Crunchy's database | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
Database Optimization Module | Separate Database into transactional and analytical for all applications | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
Event ChatBot (Organisers) III | Word cloud on survey results | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
Event ChatBot (Organisers) III | Export Event Report as CSV | Yes | To be completed in iteration 8 | 1.0 | To be completed in iteration 8 |
Project Schedule
Planned
Actual
Project Metrics
Project Risks
From the period of Acceptance (18/8/2016) to Mid-Term presentation, we would like to highlight these two risks as area of concerns.
S/N | Risk Type | Risk Description | Likelihood | Impact Level | Risk Grade | Strategy Adopted | Action |
8 | Technical Risk | Workplace@FB is extremely new, therefore there is little documentation and support online for it | High | High | A | Mitigation | Our team is part of the Multi-Company Group with PSD, MOE and Facebook. We are in touch with Rohan who we can approach if we have any problem with the Workplace instance |
9 | IT policies and Cost Risks | In order to connect to WOG instance, our applications are required to pass penetration testing by external vendor. Sponsor mentioned it costs at least SGD10,000 per application. | High | High | A | Mitigation | Our team intend to use some of the penetration testing tools recommended by sponsor. We have also made arrangement with other event organisers to use our application for their event on our own instance. We manged to get sponsor to deploy our app on their instance for a short while to test. |
From the period of Acceptance (18/8/2016) to Mid-Term presentation, we have a total of 29 change requests. Out of the 29 change requests, 13 changes proposed by the team based on results from UT2 and majority of them are UX/UI changes. We would like to list 3 interesting/impactful change requests.
S/N | Application, Requested by | Change description | Impact on Schedule | Technical Complexity | Business Value/Reason for Request | Score | Action Taken | Status of Request |
11 | Dashy, Sponsor | Mobile Responsiveness | 2 | 2 | High, Allow people to use it on the go | 4, High | Accept change request and team discuss the most appropriate iteration to implement the change request | Closed |
26 | EvBot, Team Ravenous | Change keyword to ‘link’ instead of ‘register’ Team will be exploring other concepts, for example “Event webhook”. | 2 | 1 | High, This will reduce confusion for users when linking event with EvBot | 3, High | Accept change request and team discuss the most appropriate iteration to implement the change request | Closed |
36 | EvBot, Team Ravenous | EvBot will automatically prompt user to link event the moment it detected user has created an event | 2 | 2 | High, It will guide the users in using EvBot to link events | 4, High | Accept change request and team discuss the most appropriate iteration to implement the change request | Closed |
Technical Complexity
Asynchronous Nature of NodeJS
SetTimeout
To stop the asynchronous calls initially, setTimeout was used. This was used via trial and error basis to see how long a previous request call would take, and run the next block of codes after the elapsed time.
This is easy to implement however, this comes with many disadvantages. For one, this is a highly unreliable method. Although a request call to Graph/Messenger API would usually take less than second, there could be instances where FB’s server slow down and exceed a second. This would cause our app to crash since there would still be many variables not instantiated yet. This method is essentially hardcoding.
Secondly, it causes the code to be very hard to read for other developers. With each setTimeout, the next block of codes has to be indented in. With the nature of our code, we will be affected by asynchronous calls many times, causing our codes to be unnecessarily heavily indented to the right.
Callbacks
Callback was a better method than hardcoding timeouts. This guarantees a request call is completed before proceeding to the next block of codes for most cases. Callbacks can solve most problems but not all. For example, getting multiple values from request calls first, before proceeding and making multiple request calls in order.
Another drawback to using callbacks, is that the indentation problem is not solved. With every callback function, the next block of code is indented, making it difficult for other developers to read.
Recursion
To make multiple calls in order, Promises was also explored but it did not work. This could also be due to the lack of understanding the Promise concept at that period. Since timeouts, callbacks and promises weren’t working, we explored the use of Recursion to send messages in guaranteed order to users.
Promises
Promises required some reading up and researching before actual implementation as this is a new asynchronous concept with little examples online as compared to callbacks and setTimeout. Promises solves all of our problems. It guarantees the request is done before moving on, it can make multiple request calls and storing the values synchronously and lastly, do all these while maintaining clean code.
This is a really clean way of sending multiple messages and performing other calls within the function. Imagine using callbacks or timeouts, after each sendMessage and delay function, all subsequent codes has to be indented. For the example, the code would have had to be indented more than 10 times!
We used Promise.all to collect all contents of the resolved body from the promise methods. In the above example, a request is made to Graph API to retrieve the Event Image URL for a list of Events. Thereafter, we use a Promise.all to retrieve all the URLs obtained previously. This is done synchronously.
Async/Await – Node Version >= 7.6.0
Async/await has recently been shipped with official support in Node 7.6 (released in early 2017). It is built on top of promises and needs to be used in conjunction with them. While Promises keeps code cleaner in comparison to using callbacks, async/await is even more concise.
In this example, we used the await keyword before calling asynchronous functions (that must return promises). If this were written with standard promises, there would need to be a chain of then blocks and return statements. Async/await makes code look synchronous and improves readability significantly.
Quality of Product
Intermediate Deliverables
Topic of Interest | Link |
---|---|
Project Management | Schedule & Functionalities |
Minutes | |
Risk Management | |
Change Management | |
Minutes | |
Project Documentation | Technical Diagrams |
Prototype | |
Persona & Scenario | |
Testing | Bug Log |
Minutes |
Deployment
The deployment links are as follows:
We have 2 versions of Dashy for different purposes. Staging refers to application in the development phase and production refers to applications are that production ready. Only these two applications have a user interface.
These are the backend servers that support our applications on Workplace@FB. They do not have a user interface.
- Crunchy (Data crunching for Dashy)
- EvBot (Event ChatBot, Available on our workplace@FB instance)
- EvBot (Facility ChatBot, Available on our workplace@FB instance)
- OttoBot (OTP ChatBot, Available on our workplace@FB instance)
- FMS (Facility Management System)
Our Workplace@FB instance can be found here: https://psd-test.facebook.com/
You may login using the credentials below.
Email login id: wiki_user@test.sis.smu.edu.sg
Password: wiki_user123
Testing
Team Ravenous has conducted a total of 2 User Testings.
The first user testing placed emphasize on whether users know how to use our applications, whether they understand the flow of tasks and observe how they interact with our ChatBots.
The second user test is about the usability improvement that we have made since user testing 1.
The results of UT1 can be found here
The results of UT2 can be found here