E L EARNING E NVIRONMENT FOR S OFTWARE E NGINEERING E DUCATION (R EFACTORING A GENT ) A.Stoyanova-Doycheva University of Plovdiv 23.11.2015 г. 10th Workshop.

Slides:



Advertisements
Similar presentations
Test Driven Refactoring by Andreas Thies. XP Test Driven Refactoring2 Overview Refactoring Bad Smells Unit Tests Unit Tests and Refactoring Special.
Advertisements

OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Module 7. Simplifying Conditional Expressions Course: Refactoring.
You want me to do what??? Refactoring legacy applications aka : fixing someone else’s “bad” code Niel Zeeman Team Foundation Consulting
Gregor Gisler-Merz BrownBag Session Refactoring.
Interaction and adaptation in SCORM-based SE course Todorka Glushkova, University of Plovdiv, Bulgaria
8th Workshop "Software Engineering Education and Reverse Engineering", Durres RFAgent – an eLearning Supporting Tool Asya Stoyanova-Doycheva University.
Test-Driven Development and Refactoring Project 3 Lecture 1 CPSC 315 – Programming Studio Fall 2009.
Introduction to Refactoring Excerpted from ‘What is Refactoring?’ by William C. Wake and Refactoring: Improving the Design of Existing Code by Martin Fowler.
25-Jun-15 Refactoring III. General philosophy A refactoring is just a way of rearranging code Refactorings are used to solve problems If there’s no problem,
REFACTORING Improving the Design of Existing Code Atakan Şimşek e
1 Type Type system for a programming language = –set of types AND – rules that specify how a typed program is allowed to behave Why? –to generate better.
Introduction To System Analysis and design
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
What is Refactoring? CSE301 University of Sunderland Harry R. Erwin, PhD.
Sadegh Aliakbary Sharif University of Technology Spring 2012.
Refactoring. Mathematics: Factor ● fac·tor – One of two or more quantities that divides a given quantity without a remainder, e.g., 2 and 3 are factors.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
Software Engineering 1 Object-oriented Analysis and Design Chap 21 Test-Driven Development and Refactoring.
Refactoring Improving the structure of existing code Refactoring1.
Small changes to code to improve it. Refactoring Defined A change made to the internal structure of software to make it easier to understand and cheaper.
SWE 316: Software Design and Architecture Objectives Lecture # 20 Improving the existing design: Refactoring SWE 316: Software Design and Architecture.
When and How to Refactor? Refactoring Patterns Alexander Vakrilov Telerik Corporation Senior Developer and Team Leader.
Best Practices. Contents Bad Practices Good Practices.
Refactoring1 Improving the structure of existing code.
The effectiveness of refactoring based on a compatibility testing taxonomy and a dependency graph Steve Counsell and Robert Hierons, Brunel University,
Housekeeping  SVN  Mandatory for project  Will be a spot check in the next couple of weeks to identify whether “software craftmanship” is being practiced.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Object Oriented Software Development
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Refactoring. Refactoring Overview  What is refactoring?  What are four good reasons to refactor?  When should you refactor?  What is a bad smell (relative.
Chapter 21 Test-Driven Development 1CS6359 Fall 2011 John Cole.
Refactoring 101 William C. Wake
Refactoring 2. Admin Blackboard Quiz Acknowledgements Material in this presentation was drawn from Martin Fowler, Refactoring: Improving the Design of.
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
Module 3. Smells Between Classes Course: Refactoring.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Object Oriented Programming
Software Construction and Evolution - CSSE 375 Making Method Calls Simpler Shawn and Steve Below – “Be the character!” The late acting teacher Lee Strasberg.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
ISBN Object-Oriented Programming Chapter Chapter
Refactoring. Mathematics: Factor ● fac·tor – One of two or more quantities that divides a given quantity without a remainder, e.g., 2 and 3 are factors.
CSSE 375 Organizing Data – Part 2 Shawn and Steve Continue the same quiz!
Refactoring1 Improving the structure of existing code.
Refactoring. 2 Process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal.
Asya Stoyanova-Doycheva University of Plovdiv Bulgaria eLSEBuilder and RFAgent – eLearning Supporting Tools in Software Engineering 1.
CSSE 375 Organizing Data – Part 1 Shawn and Steve Q1.
 Static  Example for Static Field  Example for Static Method  Math class methods  Casting  Scope of Declaration  Method Overloading  Constructor.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Module 9. Dealing with Generalization Course: Refactoring.
CSC 243 – Java Programming, Spring, 2014 Week 4, Interfaces, Derived Classes, and Abstract Classes.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Software, IEE Proceedings, Vol.152, Num.3, June 2005,Page(s): Prasanthi.S March, Java-based component framework for dynamic reconfiguration.
CSC 243 – Java Programming, Fall, 2008 Tuesday, September 30, end of week 5, Interfaces, Derived Classes, and Abstract Classes.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Principles and examples
External Scope CECS 277 Mimi Opkins.
Software Testing.
Module Road Map Refactoring Why Refactoring? Examples
Object-Oriented Analysis and Design
Refactoring Methods: Kevin Murphy.
11.1 The Concept of Abstraction
Section 11.1 Class Variables and Methods
Overview of Eclipse Lectures
Refactoring III 27-Nov-18.
Unit 1: Introduction Lesson 1: PArts of a java program
Improving the structure of existing code
Refactoring III 25-Dec-18.
Refactoring.
Presentation transcript:

E L EARNING E NVIRONMENT FOR S OFTWARE E NGINEERING E DUCATION (R EFACTORING A GENT ) A.Stoyanova-Doycheva University of Plovdiv г. 10th Workshop SEERE

C ONTENT Introduction rLE Architecture and Implementation Refactoring Knowledge Base Conclusions г. 10th Workshop SEERE

R EFACTORING A GENT 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

RA F UNCTIONALITY 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

Example: Refactoring Proposal (Dynamic HTML) г. 10th Workshop SEERE

Example: Automatic Refactoring г. 10th Workshop SEERE

Example: Refactoring questionary (Replace Type Code with State/Strategy) г. 10th Workshop SEERE

I MPLEMENTATION 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

RA A RCHITECTURE Refactoring Knowledge Base Refactoring Agent sensors effectors Local Control RAnalyzerRParser Refactoring classes BES (JADE)FES (IDE) Rules г. 10th Workshop SEERE

RA K NOWLEDGE B ASE 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

RA KB I MPLEMENTATION г. 10th Workshop SEERE

RA KB P ATTERN P ACKAGE г. 10th Workshop SEERE

A R EFACTORING M ETHOD I MPLEMENTATION (D ECOMPOSE C ONDITIONAL ) г. 10th Workshop SEERE

R EFACTORING M ETHODS 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

“A UTOMATIC R EFACTORING ” M ETHODS 1. Add Parameter 2. Change Bidirectional Association to Unidirectional 3. Consolidate Duplicate Conditional Fragments 4. Convert Dynamic to Static Construction 5. Convert Static to Dynamic Construction 6. Decompose Conditional 7. Encapsulate Downcast 8. Introduce Explaining Variable 9. Parameterize Method 10. Preserve Whole Object 11.Reduce Scope of Variable 12.Remove Assignments to Parameters 13.Remove Control Flag 14.Replace Assignment with Initialization 15.Replace Magic Number with Symbolic Constant 16.Replace Nested Conditional with Guard Clauses 17.Replace Parameter with Explicit Methods 18.Replace Static Variable with Parameter 19.Reverse Conditional 20.Self Encapsulate Field г. 10th Workshop SEERE

“R EFACTORING P ROPOSAL ” M ETHODS 1. Introduce Null Object 2. Introduce Parameter Object 3. Replace Array with Object 4. Replace Constructor with Factory Method 5. Replace Conditional with Polymorphism 6. Replace Error Code with Exception 7. Replace Exception with Test 8. Replace Parameter with Method 9. Replace Recursion with Iteration г. 10th Workshop SEERE

“R EFACTORING Q UESTIONARY ” M ETHODS 1. Replace Type Code with Class 2. Replace Type Code with State/Strategy 3. Replace Type Code with Subclass г. 10th Workshop SEERE