Page Speed Insights API Apps Script is an application developed by IronistM. It implements two API changes (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.
Info: this code does not have a frontend. Yet, the evolvable-by-design approach is applicable here because the two types of changes are the base URL and the type of the returned value. Indeed, only a change of the input parameters require a user interface to let the user input the parameters manually.
- Original repository: pagespeed_api_apps_script ➜ one evolution, v1 to v2: URL + returned model
- Fork with the evolvable-by-design implementation
Amount of changes: 2
Types of changes:
- Change model of returned data (n°3)
- Rename method (n°5)
Commit with the changes: cb536a
Description of the work done:
- Fork the project here
- Create an evolvable-by-design branch from the commit before the one introducing the two evolutions
- Adapt the application to run locally, because it is initially a Google App Script app (commit)
- Create a mock server for both version of the API along with the v1 documentation, because it is not online anymore (commit)
- Implements the evolvable-by-design approach in a single commit
- Replay the API evolutions (already done in the mock server commit)
- Adapt the server to easily change the version 3dceefd
- Verify that the client code does not need to be modified in order to continue working -> SUCCESS
- How many evolutions? ➜ 2 (from v1 to v2)
- Types of evolutions ➜ change type of return value (n°3) + rename method (n°5)
- One or several commits? ➜ 1
- How many lines per commit for the original evolution? ➜ 2 (for a 63 lines program)
- How many lines of code to implement the approach on the frontend? ➜ 15
- One or several developers ➜ 1
- If tests, broken? ➜ no tests
- Covered or not covered? Covered
- Clone the repository.
- Open
server/index.js
and setconst VERSION = 1
in the beginning of the file. - Start the server
node server/index.js
. - Starts the scripts
node run.js
-> it should display80
at then end. - Stop the server with
ctrl+c
in the window where you launched it. - In the
server/index.js
setconst VERSION = 2
in the beginning of the file - Start the server
node server/index.js
. - Starts the scripts
node run.js
-> it should display70
at then end. - Stop the server with
ctrl+c
in the window where you launched it.
Example Google Sheet : https://docs.google.com/a/pamediakopes.gr/spreadsheets/d/1snTlcMwaOqk5Km0MeZ8DIbii-NZvWSoFb_Cuhxd3IEU/edit#gid=0