auto-check good API ?
Lubos Lunak
l.lunak at suse.cz
Wed Aug 25 19:47:26 BST 2004
On Wed 25. of August 2004 15:38, Philippe Fremy wrote:
> Hi all,
>
> I just listened to Mathias's akademy presentation (I wish I were there)
> about Qt API. There was a question about whether checking for a good API
> design could be automated. The answer of Mathias was that it is not
> possible but actually, I think it can.
>
> Let's take the QProgressBar of the presentation. In the correct version, we
> see that a lot of methods have a common root in their name, while in the
> bad version, many different names are used and one can not speak of a root.
>
> An automated tool could take a class, and compare each method names to
> eachother. If they match a lot, then the API looks consistent. If the names
> are completely different, then there is probably something wrong with the
> class. There is a metric to be found to report that but one can definitely
> do something.
KGlobal: failed
KIconEffect: failed
KTempDir: failed
KTempFile: failed
KSaveFile: failed
KAbout* : failed
...
>
> The same name comparison could be done with class to class comparisons. If
> lot of classes share the same names and methods, then the whole API is
> consistent. Else, the API is not.
>
> One could also automatically check for methods that use a lot of bool too.
>
> Even if such a tool could not be trusted blindly, it could certainly help
> to find places where the KDE API is not so good, and to measure its
> progress.
Just similar names don't make or not make good API, and you'd have to do so
much manual post-processing that you could do it as well directly without any
tool.
>
> So, who wants to write that to help for KDE 4 ?
I guess that'd have to be you.
--
Lubos Lunak
KDE Developer
More information about the kde-core-devel
mailing list