diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b12e412 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/* +images/* +out/* diff --git a/README.md b/README.md index 2b35a35..08d5b8f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # SQL-Assesser A tool to help in assessing student-submitted SQL. + +![Program Screenshot](images/program_screenshot.png) + +## Instructions for Use +To use this tool to assess and compare SQL, please ensure the following prerequisites are met: + +* A PostgreSQL database server is currently running (which you have full `CREATEDB` permissions to). +* You know the hostname, port, username, and password which are needed to connect to this database. + +The aforementioned information can be entered into the relevant fields in the user interface as shown in the image. Once this is done, you may begin comparing SQL. To do this, do the following: + +1. Load any initialization statements into the box titled `Initialization`. Anything in this box will be executed on both databases to prepare them for the assessment. +2. Load the template statements (the answers, or confirmed correct statements) into the box titled `Template`. These will be executed on only one of the databases. +3. Load the testing statements (things you want to test for correctness) into the box titled `Testing`. These will be executed on the other database. +4. Click `Execute` to begin the assessment process. It is as follows: + 1. Delete and create two new empty testing databases. + 2. Run the `Initialization` code on both databases. + 3. Run the `Template` code on one database. + 4. Run the `Testing` code on the other database. + 5. Output the result of each SQL statement, plus an evaluation of the result of `Testing` when compared with `Template`. This is `true` if the same schema update and data manipulation statements were used, as well as the same result sets from select queries. + +## Notes +There are cases where the assesser will return a false negative (i.e. false even though the SQL works) because of the improbability of validating the order and content of statements other than `SELECT`. + +If you think you can figure out how to account for things such as out-of-order insertions, updates, and deletions, and drawing transaction boundaries around related sets of statements that have common pre- and post-conditions, feel free to create a pull-request with the changes. \ No newline at end of file diff --git a/out/artifacts/SQL_Assesser_jar/SQL-Assesser.jar b/out/artifacts/SQL_Assesser_jar/SQL-Assesser.jar old mode 100644 new mode 100755