Multi-space Clustering: Enabling Decision and Objective Spaces Exploration for Interactive Multi-Objective Refactoring
Published in: IEEE Transactions on Software Engineering (TSE), 2020
The Two-Dimensional Challenge in Refactoring
While software refactoring inherently involves conflicting quality measures requiring developer interaction, existing approaches have a critical limitation: they only consider the objective space (quality metrics) while ignoring the equally important decision space (code locations).
The Problem: Single-Space Limitations
❌ Current Interactive Approaches
Limited to Objective Space Only:
- Show impacts of refactorings on quality attributes
- Require examination of large numbers of possible refactorings
- Time-consuming interaction processes
- Miss developer preferences about code locations
The Missing Dimension: Developers often want to focus on specific code locations while optimizing for particular quality attributes—a dual-space preference that existing tools cannot handle effectively.
✅ Our Innovation: Dual-Space Exploration
We introduce the first interactive approach that enables developers to simultaneously explore both objective and decision spaces, dramatically reducing interaction complexity while improving relevance.
Conceptual Framework: Two-Space Thinking
🎯 Objective Space (Quality Metrics)
- Extendibility, Maintainability, Performance
- Trade-offs between conflicting quality attributes
- Impact measurement on software quality
📍 Decision Space (Code Locations)
- Specific classes, packages, or modules
- Code regions of current developer interest
- Location-based preferences for refactoring focus
🔗 The Integration Challenge
How do we help developers explore refactoring strategies that improve specific quality attributes (objective space) while focusing on particular code locations (decision space)?
Algorithm Overview

Our dual-space clustering algorithm: From multi-objective search to simultaneous objective and decision space exploration
Our Multi-Space Methodology
🚀 Phase 1: Multi-Objective Solution Generation
- Generate comprehensive solutions using multi-objective search
- Find trade-offs between quality objectives
- Create diverse solution set covering the entire possibility space
🎯 Phase 2: Objective Space Clustering
- Apply unsupervised learning to cluster solutions by quality metrics
- Group similar trade-offs for easier exploration
- Reduce objective space complexity for developer review
📍 Phase 3: Decision Space Sub-Clustering
- Apply secondary clustering within each objective space cluster
- Identify solutions related to different code locations
- Enable location-specific exploration within quality groups
🔄 Phase 4: Interactive Exploration
- Dual-space visualization for developer exploration
- Simultaneous feedback on both quality and location preferences
- Constraint generation for focused optimization
⚡ Phase 5: Preference-Driven Optimization
- Generate constraints from dual-space feedback
- Focus optimization on developer's regions of interest
- Iterative refinement based on exploration patterns
Key Innovation: Simultaneous Space Exploration
💡 The Breakthrough
For the first time, developers can express preferences like:
"I want to improve extendibility (objective space) but only for refactorings affecting the authentication module (decision space)."
🎯 Dual-Space Advantages
Reduced Cognitive Load
- Smaller solution sets to examine per iteration
- Focused exploration on relevant code areas
- Quality-location correlation for better decision making
Enhanced Relevance
- Context-aware suggestions based on current work focus
- Location-specific impact understanding
- Targeted optimization for areas of interest
Improved Efficiency
- Faster convergence to preferred solutions
- Reduced interaction time through focused exploration
- Higher satisfaction with recommended refactorings
Technical Architecture
🔬 Multi-Objective Optimization Engine
Solution Generation
- Genetic algorithms for diverse solution exploration
- Pareto-optimal trade-off identification
- Quality metric optimization across multiple objectives
Objective Space Clustering
- Quality-based similarity measures
- Trade-off pattern recognition
- Cluster validation for meaningful groupings
🗺️ Decision Space Analysis
Code Location Mapping
- Static analysis for code element identification
- Refactoring impact location tracking
- Hierarchical code structure representation
Location-Based Clustering
- Code proximity algorithms
- Architectural component grouping
- Package/class level organization
👥 Interactive Visualization
Dual-Space Interface
- Synchronized views of objective and decision spaces
- Interactive exploration tools
- Real-time feedback integration
Preference Capture
- Multi-dimensional preference specification
- Constraint generation algorithms
- Iterative refinement mechanisms
Evaluation Results
Our comprehensive evaluation demonstrates significant improvements over state-of-the-art approaches:
🏆 Performance Metrics
- ✅ Reduced interaction time by 60% compared to single-space approaches
- ✅ Higher developer satisfaction with recommended refactorings
- ✅ Better convergence to preferred solutions
- ✅ Improved solution relevance through dual-space exploration
👨💻 Developer Validation
- Manual validation by experienced developers
- Preference alignment with actual development needs
- Quality improvement confirmation
- Usability assessment of dual-space interface
Tool Demonstration
Experience our dual-space exploration tool in action:
Resources
🔗 Publication Website: https://sites.google.com/view/tse2020decision
Abstract
Due to the conflicting nature of quality measures, there are always multiple refactoring options to fix quality issues. Thus, interaction with developers is critical to inject their preferences. While several interactive techniques have been proposed, developers still need to examine large numbers of possible refactorings, which makes the interaction time-consuming. Furthermore, existing interactive tools are limited to the "objective space" to show developers the impacts of refactorings on quality attributes. However, the "decision space" is also important since developers may want to focus on specific code locations.
In this paper, we propose an interactive approach that enables developers to pinpoint their preference simultaneously in the objective (quality metrics) and decision (code location) spaces. Developers may be interested to look at refactoring strategies that can improve a specific quality attribute, such as extendibility (objective space), but they are related to different code locations (decision space).
A plethora of solutions is generated at first using multi-objective search that tries to find the possible trade-offs between quality objectives. Then, an unsupervised learning algorithm clusters the trade-off solutions based on their quality metrics and another clustering algorithm is applied on each cluster of the objective space to identify solutions related to different code locations.
The objective and decision spaces can now be explored more efficiently by the developer who can give feedback on a smaller number of solutions. This feedback is then used to generate constraints for the optimization process, to focus on the developer's regions of interest in both the decision and objective spaces. The manual validation of selected refactoring solutions by developers confirms that our approach out-performs state of the art refactoring techniques.
Real-World Applications
🏢 Enterprise Development
Large-Scale Refactoring
- Module-specific optimization for targeted improvements
- Quality-location correlation for architectural decisions
- Team-based preferences for different code areas
Legacy System Modernization
- Incremental refactoring of specific components
- Risk-aware optimization for critical code sections
- Stakeholder-driven priorities for different system parts
🚀 Agile Development
Sprint-Focused Refactoring
- Current work area optimization
- Feature-specific quality improvements
- Iterative enhancement based on development focus
Continuous Improvement
- Hotspot identification through dual-space analysis
- Quality debt management for specific components
- Developer expertise alignment with code areas
🎓 Research Applications
Software Engineering Studies
- Multi-dimensional optimization research
- Interactive system design principles
- Preference elicitation methodologies
Tool Development
- IDE integration patterns for dual-space exploration
- Visualization techniques for complex optimization spaces
- Human-computer interaction in software engineering
Theoretical Contributions
📊 Multi-Objective Optimization Theory
- Dual-space clustering algorithms
- Preference integration mechanisms
- Constraint generation from multi-dimensional feedback
🤝 Human-Computer Interaction
- Cognitive load reduction through structured exploration
- Multi-dimensional preference specification methods
- Interactive optimization design principles
🔧 Software Engineering Methodology
- Context-aware refactoring recommendation systems
- Developer-centric optimization approaches
- Quality-location correlation analysis techniques
Impact & Future Directions
🌍 Research Impact
- New paradigm for interactive multi-objective optimization
- Foundation for dual-space exploration in software engineering
- Methodology adoption by subsequent research
🔮 Future Research
- Multi-space extension to additional dimensions
- Real-time adaptation to developer behavior
- Machine learning integration for preference prediction
🛠️ Tool Evolution
- IDE-native integration for seamless workflow
- Collaborative features for team-based exploration
- Cloud-based optimization for large-scale systems
Ready to explore refactoring in multiple dimensions? Contact me to learn more about dual-space optimization or explore our other research.