CSC/ECE 517 Spring 2015 E1527 SWAR: Difference between revisions
No edit summary |
|||
Line 28: | Line 28: | ||
== 1. | == 1. Refactor Code== | ||
Problem 1: Efficient Loop constructs. | |||
Description: Many loops over models are implemented using generic “for” loops. | |||
Solution: As specified by Ruby guideline, we plan to use efficient ruby loops, such as “each” and “find_each”. | |||
Problem 2: Very large methods | |||
Description: Several methods have huge amount of code, which makes them difficult to understand and debug. | |||
Solution: In most cases, large methods can be shortened through the use of smaller helper methods. Such methods could be reused across different components. | |||
Problem 3: Ambiguous method names | |||
Description: Many methods have ambiguity between the name used for them and the feature implemented by them. | |||
Solution: We will rename such methods to clearly state the feature implemented by them. | |||
Problem 4: Legacy Code | |||
Description: As the system has been modified for bug fixes and enhancements, unnecessary code has accumulated. | |||
Solution: Isolate and remove all dead code. | |||
Problem 5: Code beautification | |||
Description: Coding style used in gem is not based on Ruby on Rails style, which makes it difficult to read for any Ruby programmer. | |||
Solution: Beautify the code with a consistent standard of documentation, and style. | |||
== 2. | == 2. Upgrade system to use latest dependent ruby gems == | ||
The | The libraries used by gem are very old. We plan to migrate the dependent libraries to their latest versions. | ||
Libraries, we have identified are: | |||
1) Stanford-core-nlp | |||
2) rwordnet | |||
3) rjb | |||
4) bind-it | |||
We will also migrate the project to use Java 8. | |||
== 3. Migrate gem to Web service == | |||
Web service will expose calculate_metareview_metric method over web, which will consume review, submission, an array of rubrics. It will return the autometareview result as JSON. | |||
== 3. | |||
= Pages To Be Modified = | = Pages To Be Modified = |
Revision as of 00:30, 2 April 2015
E1527. Refactor Autometareviews gem and migration to Web-Service
Introduction to Expertiza
The automated metareview tool identifies the quality of a review using natural language processing and machine learning techniques (completely automated). Feedback is provided to reviewers on the following metrics: 1. Review relevance: This metric tells the reviewer how relevant the review is to the content of the author's submission. Numeric feedback in the scale of 0--1 is provided to indicate a review's relevance. 2. Review Content Type: This metric identifies whether the review contains 'summative content' -- positive feedback, problem detection content' -- problems identified by reviewers in the author's work or 'advisory content' -- content indicating suggestions or advice provided by reviewers. A numeric feedback on the scale of 0--1 is provided for each content type to indicate whether the review contains that type of content. 3. Review Coverage: This metric indicates the extent to which a review covers the main points of a submission. Numeric value in the range of 0--1 indicates the coverage of a review. 4. Plagiarism: Indicates the presence of plagiarism in the review text. 5. Tone: The metric indicates whether a review has a positive, negative or neutral tone. 6. Quantity: Indicates the number of unique words used by the reviewer in the review.
Problem Statement
Currently, Autometareviews project is used as a gem in Expertiza project. Purpose of this project is to migrate this gem to a web service and expose its methods on web, which can be consumed by any application as web service. Older gem was dependent old libraries such as Stanford-core-nlp, rwordnet, etc. We will migrate them to new libraries without breaking the existing feature-set. We are also going to refactor the source code of this gem file to promote readability, reduced complexity, and code redundancies. We will fix any bug or bottleneck that we can find to improve the performance of this service. We will not add any new feature to the existing feature set provided by the gem. Before making any modification to the existing features, we will present them before Dr. Gehringer and his Expertiza team.
Scope
The scope of this project includes migration of existing gem application to a web-service, refactoring the existing classes and migrating to newer libraries, wherever possible. The classes that we propose to refactor are tone.rb, degree_of_relevance.rb, wordnet_based_similarity.rb, sentence_state.rb, cluster_generation.rb, plagiarism_check.rb, graph_generator.rb, predict_class.rb, and review_coverage.rb. No new feature will be developed as part of this project. Any major code change due to inclusion of newer libraries will be communicated to Expertiza project team. Existing code will be tested to ensure the functionality does not change.
Standards
All developed code will adhere to the ruby on rails coding guidelines.
List of Tasks
Below are detailed explanations to the tasks listed in the description documentation.
1. Refactor Code
Problem 1: Efficient Loop constructs. Description: Many loops over models are implemented using generic “for” loops. Solution: As specified by Ruby guideline, we plan to use efficient ruby loops, such as “each” and “find_each”. Problem 2: Very large methods Description: Several methods have huge amount of code, which makes them difficult to understand and debug. Solution: In most cases, large methods can be shortened through the use of smaller helper methods. Such methods could be reused across different components. Problem 3: Ambiguous method names Description: Many methods have ambiguity between the name used for them and the feature implemented by them. Solution: We will rename such methods to clearly state the feature implemented by them. Problem 4: Legacy Code Description: As the system has been modified for bug fixes and enhancements, unnecessary code has accumulated. Solution: Isolate and remove all dead code. Problem 5: Code beautification Description: Coding style used in gem is not based on Ruby on Rails style, which makes it difficult to read for any Ruby programmer. Solution: Beautify the code with a consistent standard of documentation, and style.
2. Upgrade system to use latest dependent ruby gems
The libraries used by gem are very old. We plan to migrate the dependent libraries to their latest versions. Libraries, we have identified are: 1) Stanford-core-nlp 2) rwordnet 3) rjb 4) bind-it We will also migrate the project to use Java 8.
3. Migrate gem to Web service
Web service will expose calculate_metareview_metric method over web, which will consume review, submission, an array of rubrics. It will return the autometareview result as JSON.
Pages To Be Modified
For this project, it is difficult to re-design all webpages and make them responsive. After discussing with the contact person, we will be focusing only on these 3 pages:
Login Page
What's wrong with it
1. Now it takes more than 15 seconds to even login to the admin's home page with the sample development database. This is definitely not good enough for a daily used web application.
The cause for the long rendering time is that it will be redirected to 'tree_display/list', which needs to fetch all questionnaires, courses and assignments before page rendering.
2. The webpage looks primitive.
What changes need to be made
1. Actually it is unnecessary to fetch all data at the very beginning; if there is too much data to present, the list will be extremely long and it is quite hard for users to locate a specific course.
So, we will use AngularJS and jQuery to make a asynchronous webpage that delays the database query until all the basic html elements are correctly rendered, or until the user explicitly asks for that part of data.
2. Bootstrap will be applied for better user interfaces.
Manage-Course page
What's wrong with it
As illustrated above, now the displaying list is too long and it takes too long to scroll to the end, which makes locating a specific course quite difficult.
Also, loading time can be reduced.
What changes need to be made
1. Create several buttons for different time intervals, for example, after clicking on the button '2013-2014', only courses for 2013 to 2014 are presenting, and there is no redirection during this process.
2. The database should not be executed before the user clicks on the button. Only parts of databased is fetched when each button is clicked.
3. Bootstrap will be applied for better user interfaces.
Manage-User page
What's wrong with it
1. The list is too long: if there are 20k users in the database, there will be 20k rows in this table in a one page!
2. When clicking on the letter A-Z, redirections happen and the whole page is reloaded.
What changes need to be made
1. Load only a given number of records to the view, such as 100 records, when accessing into this page for the first time.
2. Using AngularJS to eliminate the redirections and page reloading for better UI performance.