A method for representing an application programming interface (API) for
an object-oriented library includes creating a list of public elements in
the library and storing the list. Each public element in the list
includes a sublist of all public related elements for the element.
According to one aspect, the public elements include classes and
interfaces, the public related elements include public superclasses and
public superinterfaces, and the library is a Java.TM. package. According
to one aspect, a method for determining a program hierarchy includes
receiving an API definition file for an object-oriented library and
indicating a first public element is a direct parent of a second public
element when the first public element is represented in the sublist for
the second public element and the first public element is not represented
in the sublist for any other public element listed in the sublist for the
second public element. According to another aspect, a method for
detecting changes to a program hierarchy includes comparing a first
program hierarchy reconstructed from a first API definition file with a
second program hierarchy reconstructed form a second API definition file
and indicating an error when the first program hierarchy is inconsistent
with the second program hierarchy.