Difference between revisions of "Refactoring plan"

From Inkscape Wiki
Jump to navigation Jump to search
m (Added headings, minor text tweaks.)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
= 0.47 Refactoring Plan =
{{DevDiscussion}}


<div style="width:75em">
== Overview ==
== Overview ==
With Inkscape 0.46 wrapping up, it's time to look forward to our next
release, 0.47, and our plans for its development.


When we started Inkscape, we began with a codebase with lots of
When we started Inkscape, we began with a codebase with lots of
Line 16: Line 15:
accidental code duplication, unfinished code, obsoleted code, etc.
accidental code duplication, unfinished code, obsoleted code, etc.


What will the codebase cleanup work entail?  The work will range from
What does codebase cleanup work entail?  The work ranges from
straightforward “grunt” work like making some simple code changes to all
straightforward “grunt” work like making some simple code changes to all
files in the codebase, to meatier work like abstracting widely used code
files in the codebase, to meatier work like abstracting widely used code
Line 25: Line 24:


=== Objectives ===
=== Objectives ===
To boil this down into five high level objectives:
To boil this down into five high level objectives:


Line 34: Line 34:


=== Principles ===
=== Principles ===
Now, architectural reworkings can often risk incur massive breakages
Now, architectural reworkings can often risk incur massive breakages
since fundamental pieces of the code are being changed.  In order to
since fundamental pieces of the code are being changed.  In order to
minimize this, I'd like to suggest the following principles:
minimize this, we would like to suggest the following principles:
 
*  Always keep the tree buildable
*  Always keep unit tests passing (and add new unit tests)
*  Do major refactorings in small steps
*  Hold code review parties with 2–3 others to brainstorm
*  Drop copied-in codebases in favor of external dependencies
*  Make sure every function you touch has some doxygen comments
 
 
== Schedule ==
This kind of work can go on indefinitely without a clear
stopping point, so I think for this release we should use a schedule
with a date-based stopping point.  This will help everyone know how they
should time their work.
 
  Mar 10  Release 0.46.  0.47 Refactoring / Cleanup work begins
  Apr
  May
  Jun
  Jul 1  Completion of refactoring.  Focus on Bug Fixing begins.
          Open 0.48 development tree early, for GSoC work.
  Aug    Put out 0.47-pre releases.
  Sep    Release 0.47.
 
For reference, here are some key GSoC dates:
 
  May 26  GSoC work begins
  Jul 14  GSoC midterm;  first delivery of GSoC code
  Aug 18  GSoC work ends


This schedule permits us to focus exclusively on refactoring for several
#  Always keep the tree buildable
months, with a due date of July 1<sup>st</sup> to complete it. It uses a very
# Always keep unit tests passing (and add new unit tests)
early branch point, where we'll split into a stable branch for doing bug
#  Do major refactorings in small steps
fix and release work, and a development branch for the GSoC students to
#  Hold code review parties with 2–3 others to brainstorm
use and for folks to continue right on with refactoring projects if they
#  Drop copied-in codebases in favor of external dependencies
wish.
#  Make sure every function you touch has some doxygen comments
</div>

Latest revision as of 08:26, 10 February 2018


Overview

When we started Inkscape, we began with a codebase with lots of potential but with some architectural limitations that we've never quite resolved. Inkscape has grown rapidly, especially thanks to Google's Summer of Code program. Unfortunately, while we've gained a lot of new features, it hasn't addressed the underlying issues—and in some cases has exposed new problems.

Inkscape's also been extremely successful at gaining a lot of contributors, yet this comes with a price: Stylistic differences, accidental code duplication, unfinished code, obsoleted code, etc.

What does codebase cleanup work entail? The work ranges from straightforward “grunt” work like making some simple code changes to all files in the codebase, to meatier work like abstracting widely used code into a more concise and powerful algorithm, to advanced work such as extracting distinct code into independent code packages.

Objectives and Principles

Objectives

To boil this down into five high level objectives:

  1. Complete some of the big architectural refactoring efforts
  2. Reduce source code line count
  3. Break useful code out into stand-alone libraries
  4. Increase code stylistic consistency
  5. Make the codebase more convenient to code in

Principles

Now, architectural reworkings can often risk incur massive breakages since fundamental pieces of the code are being changed. In order to minimize this, we would like to suggest the following principles:

  1. Always keep the tree buildable
  2. Always keep unit tests passing (and add new unit tests)
  3. Do major refactorings in small steps
  4. Hold code review parties with 2–3 others to brainstorm
  5. Drop copied-in codebases in favor of external dependencies
  6. Make sure every function you touch has some doxygen comments