1 / 17

eLearning Environment for Software Engineering Education (Refactoring Agent)

eLearning Environment for Software Engineering Education (Refactoring Agent). A.Stoyanova-Doycheva University of Plovdiv. Content. Introduction rLE Architecture and Implementation Refactoring Knowledge Base Conclusions. Refactoring Agent.

israel
Download Presentation

eLearning Environment for Software Engineering Education (Refactoring Agent)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. eLearning Environment for Software Engineering Education (Refactoring Agent) 10th Workshop SEERE 5-12.09.2010 A.Stoyanova-Doycheva University of Plovdiv

  2. Content • Introduction • rLE Architecture and Implementation • Refactoring Knowledge Base • Conclusions 10th Workshop SEERE 5-12.09.2010

  3. Refactoring Agent • The Refactoring Agent (RA) is a part from Refactoring Learning Environment, which is intended to analyze and assess programming code, based on refactoring rules. • The Refactoring Agent is responsible for the analysis and assessment of the code, written by students in real time by using a set of refactoring methods. • According to the situation and based on the refactoring method to be applied, the agent could react in different ways. • Its goal is to show the student, as much as possible, the weak places of their programming code and the possible ways to make it better. 10th Workshop SEERE 5-12.09.2010

  4. RA Functionality • Depending on the refactoring method, which should be applied, the agent could react in three different ways: • To apply automatically the method after receiving confirmation from the user; • To display detailed instructions, explaining to the user where and how the particular refactoring method should be applied; • To ask the user additional questions in order to clarify the conditions and define the appropriate refactoring method. 10th Workshop SEERE 5-12.09.2010

  5. Example: Refactoring Proposal(DynamicHTML) 10th Workshop SEERE 5-12.09.2010

  6. Example: Automatic Refactoring 10th Workshop SEERE 5-12.09.2010

  7. Example: Refactoring questionary (Replace Type Code with State/Strategy) 10th Workshop SEERE 5-12.09.2010

  8. Implementation • As a development environment we chose Eclipse • It is open source • It supports a powerful mechanism for interaction with external components in the form of plugins. This could be considered as a significant advantage of this particular environment which simplifies the integration of the Refactoring Agent (RA) in the development environment. • The sensors and effectors of the agent are realized in JADE and they use existing plugins in Eclipse. • The agent itself is implemented by means of the JADE environment . 10th Workshop SEERE 5-12.09.2010

  9. BES (JADE) FES (IDE) Refactoring Agent sensors Local Control effectors RAnalyzer RParser Refactoring Knowledge Base Refactoring classes Rules RA Architecture 10th Workshop SEERE 5-12.09.2010

  10. RA Knowledge Base • The RKB consists of a set of rules together with a set of classes, which build a consistent knowledge base. • The rules are implemented as Java code and are specific for each refactoring method. 10th Workshop SEERE 5-12.09.2010

  11. RA KB Implementation 10th Workshop SEERE 5-12.09.2010

  12. RA KB Pattern Package 10th Workshop SEERE 5-12.09.2010

  13. A Refactoring Method Implementation (Decompose Conditional) 10th Workshop SEERE 5-12.09.2010

  14. Refactoring Methods • As а source – Martin Fowler’s book “Refactoring – Improving the Design of Existing Code” • We discovered а total of 32 methods that can be implemented in the Knowledge Base. • We still have 34 methods to investigate. 10th Workshop SEERE 5-12.09.2010

  15. “Automatic Refactoring” Methods • Add Parameter • Change Bidirectional Association to Unidirectional • Consolidate Duplicate Conditional Fragments • Convert Dynamic to Static Construction • Convert Static to Dynamic Construction • Decompose Conditional • Encapsulate Downcast • Introduce Explaining Variable • Parameterize Method • Preserve Whole Object • Preserve Whole Object • Reduce Scope of Variable • Remove Assignments to Parameters • Remove Control Flag • Replace Assignment with Initialization • Replace Magic Number with Symbolic Constant • Replace Nested Conditional with Guard Clauses • Replace Parameter with Explicit Methods • Replace Static Variable with Parameter • Reverse Conditional • Self Encapsulate Field 10th Workshop SEERE 5-12.09.2010

  16. “Refactoring Proposal” Methods • Introduce Null Object • Introduce Parameter Object • Replace Array with Object • Replace Constructor with Factory Method • Replace Conditional with Polymorphism • Replace Error Code with Exception • Replace Exception with Test • Replace Parameter with Method • Replace Recursion with Iteration 10th Workshop SEERE 5-12.09.2010

  17. “Refactoring Questionary” Methods • Replace Type Code with Class • Replace Type Code with State/Strategy • Replace Type Code with Subclass 10th Workshop SEERE 5-12.09.2010

More Related