GSOC C++ Refactoring support

Kaleb Pederson kaleb.pederson at gmail.com
Thu Apr 30 23:31:30 UTC 2009


Hi All,

I've been working on my Master's thesis on refactoring, so I've been following this list for a while so I could pick up anything relevant.  When I originally started my thesis, I was implementing a refactoring tool, but since then it's changed focus (reality is I just didn't have the time for that), although it's still refactoring related.

Despite that, I did collect a fantastic starting point for a test suite entirely by the graciousness of Richard on the refactoring yahoogroup who provided me with a copy of one he wrote.  He took the time to examine many of the different problems that would need to be considered when performing refactorings in C++ and documented them in working C++ source files.  The suite contains a number of files which are named based on the refactoring to be performed.  Within the files are comments containing "#TEST#" that can be used to identify different tests to be performed.

Here's a brief excerpt of Rename.h:
============================
// #TEST#: R24 Rename this macro
#define MACRO_NO_ARGS 3.14159f

// #TEST#: R25 Rename this macro argument
// #TEST#: R26 Rename this macro
#define MACRO_ONE_ARG(x_) (2.0f*x)

class Operations
{
public:
    int Operation1() { return 1; }
    int Operation2() { return 2; }
};

// #TEST#: R1 Rename this class, but class in Rename2.cpp shouldn't be renamed
class Rename1
{
public:
    // #TEST#: R2 Rename this class via its c'tor
    Rename1()
    {
    }

    // #TEST#: R32 Rename this class via its d'tor
    ~Rename1()
    {
    }

    // #TEST#: R33 Rename this class via typedef
    // #TEST#: R34 Rename typedef MyClass
    typedef Rename1 MyClass;

    // #TEST#: R3 Rename this method
    void Operation()
    {
    }
};
...
============================

I hope the test suite is useful to you and helps you accomplish more.

Thank you for your efforts and willingness.

--Kaleb



On Thursday 30 April 2009 03:44:16 pm Ramón Zarazúa wrote:
> >2009/4/27 Ramón Zarazúa <rzarazua at digipen.edu>:
> >> If there is any suggestions/requests I will gladly take them
> 
> Another thing I woult like to put out there is that testing is a huge part
> of this project, I will develop a set of Unit tests to test out the
> framework. If anyone wants to contribute unit tests I will set up a folder
> on the svn.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: suite.tgz
Type: application/x-compressed-tar
Size: 26275 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090430/c1f7fcf5/attachment.tgz>


More information about the KDevelop-devel mailing list