/dialog-flow-server

Express server to test dialogflow

Primary LanguageJavaScript

Dialog Flow Server

This is the server of the frontend application dialog flow.

Dialog Flow is an application developed by lauchness. It implements one API change (see details below) that I use as a use-case to evaluate the evolvable-by-design approach that I created.

In this repository, the evolvable-by-design approach is implemented. Other projects are used as use cases, see the evolvable-by-design organization.

Repositories

Here is a list of all the repositories linked to this use-case.

Amount of changes: 1

Type of change: change model of returned data (n°3)

Change 1: change returned model

Description of the change: do an API change (change returned model) while moving the API call to the server, see UI commit (https://github.com/lauchness/dialog-flow/commit/929dd1f84dde381d2e393a5f76a34cf95112054f) and server commit (https://github.com/lauchness/dialog-flow-server/commit/2b8b301d4909a6dbbbbda674ebe20989956118e2)

Description of the work done:

  1. Fork both the client and the server
  2. Remove the model change from the API to create a first version returning a model that is equal to the model previously used on the frontend (see server commit)
  3. Create the API documentation and serve it from the backend on OPTIONS {baseApiUrl}/ (see the three commits: b2dd491, e3cc2ba and c53c7a2)
  4. Modify the frontend to use the first version of the API (see frontend commit)
  5. Create the proper accounts on Google Cloud Console and Google API Console to get the dialog flow API credentials
  6. Implement the evolvable-by-design approach into the frontend, in a single commit
  7. Replay the API evolution (see server commit)
  8. Verify that the client code does not need to be modified in order to continue working -> SUCCESS

Report

  • How many evolutions? ➜ 1
  • Types of evolutions ➜ change type of return value (n°3)
  • One or several commits? ➜ 1
  • How many lines per commit for the original evolution? ➜ 2 (for a 721 lines program)
  • How many lines of code to implement the approach on the frontend? ➜ 43 lines changed
  • One or several developers ➜ 1
  • If tests, broken? ➜ no tests
  • Covered or not covered? Covered

How to test the evolution

  1. Clone this repository
  2. Go back to the commit before the evolution git checkout before-evolution
  3. Start the server npm start
  4. Start the frontend
  5. Play with it
  6. Stop the server ctrl + c in the bash session
  7. Move to the server commit implementing the evolution git checkout after-evaluation
  8. Start the server back npm start
  9. Refresh the frontend and play with it, it is still working while the code has not changed