Documenting Database Usages and Schema Constraints in Database-Centric Applications

This web page is a companion to our ISSTA 2016 paper submission entitled "Documenting Database Usages and Schema Constraints in Database-Centric Applications".


1. What is DBScribe?


We present a novel approach, namely DBScribe, for automatic generation of natural language descriptions at method-level. DBScribe statically analyzes the source code and the database schema to detect database usages, and propagates the usages and schema constraints through the call graph to document local and delegated execution of SQL queries/statements.

The following diagram depicts the DBScribe components:


Click to zoom in



2. User Study - DBScribe


Questions


Q1. Completeness: Only focusing on the content of the description and without considering the way it has been presented, do you think the description is complete?
- A1. The description does not miss any important information.
- A2. The description misses some important information to understand the database-related operations.
- A3. The description misses most important information to understand the database-related operations.

Q2. Conciseness: Only focusing on the content of the description and without considering the way it has been presented, do you think the description is concise?
- A1. The description contains no redundant/useless information.
- A2. The description contains some redundant/useless information.
- A3. The description contains a lot of redundant/useless information.

Q3. Expressiveness: Only focusing on the content of the description and without considering the completeness and conciseness, do you think the description is expressive?
- A1. The description is easy to read.
- A2. The description is somewhat readable and and understandable.
- A3. The description is hard to read and understand.

Q4. Is this type of description useful for understanding the database usages in the system? (Open question)

Q5. What software engineering tasks will you use this type of description for? (Open question)

Results


Completeness (Q1)Conciseness (Q2)Expressiveness (Q3)
A1A2A3A1A2A3A1A2A3
UMAS711815236264242
Riskit612456021961218
Openemm2414438223741
Xinco2520340804260
Fina24153311013750
Total205911622177142416011
Total (in %)65.71%29.17%5.13%70.83%24.68%4.5%77.24%19.23%3.53%

* Complete reports of the user study generated by Qualtrics are available here





3. DBScribe Descriptions and DCAs data

  • Subject applications are available at here. The bundles contain source code, schema scripts for MySQL, schema diagram, and schema model in MySQL Workbench format.
  • The descriptions in HTML version for the systems are in the following links: UMAS, RiskIT, OpenEmm, Xinco, Fina
  • The following figure depicts distribution of size of descriptions in different applications:

  • Click to zoom in



4. Templates


1. Templates for local calls

local_header This method implements the following db-related operations:
local_insert It inserts the #attr attributes into table #table
local_insert_no_columns It inserts values for the first #attr columns into table #table
local_delete It deletes rows from table(s) #table
local_update It updates the #attr attribute(s) in table #table
local_queries It queries the table(s) #table
local_drop It drops the #table
local_create It creates the table(s) #table
local_truncate It deletes all the rows in table(s) #table
local_alter It alters the structure of table(s) #table



2. Templates for delegated calls

delegate_header This method invokes db-related operations via delegation:
delegate_insert It inserts the #attr attributes into table #table via #method
delegate_insert_no_columns It inserts values for the first #attr columns of table #table via #method
delegate_delete It deletes rows from table(s) #table via #method
delegate_update It updates the #attr attribute(s) in table #table via #method
delegate_queries It queries the table(s) #table via #method
delegate_drop It drops the #table via #method
delegate_create It creates the table(s) #table via #method
delegate_truncate It deletes all the rows in table(s) #table via #method
delegate_alter It alters the structure of table(s) #table via #method



3. Templates for constraints

constr_header Some constraints that should be taken into the account are the following:
constr_autonum Insertions in table #table do not require to set the attribute #attr because it is auto-numeric
constr_varchar It Make sure the strings to be stored in #table do not overflow the varchar limits: #limits
constr_unique Make sure the values of attribute #table.#attr are unique because there is a UNIQUENESS constraint
constr_non_null Make sure the values in #table.#attr are not null
constr_ref_integrity When inserting into table #table, make sure the referential integrity imposed by attribute(s) #attr is accomplished. The foreign keys in the table are the following: #foreign-keys
constr_ref_update Updating the attribute #attr in table #table, may affect registers in table(s) #list, because these table(s) declare foreign keys pointing to #table
constr_ref_delete Deleting rows from table #table, may affect registers in table(s) #list, because these table(s) declare foreign keys pointing to #table



#table indicates a database table name
#list indicates a list of table names
#attr indicates an attribute name
#method indicates a method name
#limits indicates a description of limitations
#foreign-keys indicates a list of foreign keys




*Authors

  • Mario Linares-Vásquez - The College of William and Mary, VA, USA.
    E-mail: mlinarev at cs dot wm dot edu
  • Boyang Li - The College of William and Mary, VA, USA.
    E-mail: boyang at cs dot wm dot edu
  • Christopher Vendome - The College of William and Mary, VA, USA.
    E-mail: cvendome at cs dot wm dot edu
  • Denys Poshyvanyk - The College of William and Mary, VA, USA
    E-mail: denys at cs dot wm dot edu