Difference between revisions of "Refactoring plan"

From Inkscape Wiki
Jump to navigation Jump to search
(dev discussion)
Line 1: Line 1:
== Overview ==
== Overview ==
With Inkscape 0.46 wrapping up, it's time to look forward to our next
With Inkscape 0.46 wrapping up, it's time to look forward to our next

Revision as of 20:08, 4 January 2012

This page is outdated. It is kept for historical reasons, e.g. to document specific decisions in Inkscape development.


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 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 will the codebase cleanup work entail? The work will range 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


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


Now, architectural reworkings can often risk incur massive breakages since fundamental pieces of the code are being changed. In order to minimize this, I'd 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


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
 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 months, with a due date of July 1st to complete it. It uses a very early branch point, where we'll split into a stable branch for doing bug fix and release work, and a development branch for the GSoC students to use and for folks to continue right on with refactoring projects if they wish.