$30 off During Our Annual Pro Sale. View Details »

Modeling the Ownership of Source Code Topics

Modeling the Ownership of Source Code Topics

Appearing in the 20th IEEE International Conference
on Program Comprehension (http://icpc12.sosy-lab.org/)

Modeling the Ownership of Source Code Topics
Christopher S. Corley, Elizabeth A. Kammer, and Nicholas A. Kraft
(University of Alabama, USA)

Abstract
Exploring linguistic topics in source code is a program comprehension activity that shows promise in helping a developer to become familiar with an unfamiliar software system. Examining ownership in source code can reveal complementary information, such as who to contact with questions regarding a source code entity, but the relationship between linguistic topics and ownership is an unexplored area. In this paper we combine software repository mining and topic modeling to measure the ownership of linguistic topics in source code. We conduct an exploratory study of the relationship between linguistic topics and ownership in source code using 10 open source Java systems. We find that classes that belong to the same linguistic topic tend to have similar ownership characteristics, which suggests that conceptually related classes often share the same owner(s). We also find that similar topics tend to share the same ownership characteristics, which suggests that the same developers own related topics.

Christopher Corley

June 13, 2012
Tweet

More Decks by Christopher Corley

Other Decks in Research

Transcript

  1. C.S. Corley, E. A. Kammer, and N. A. Kraft
    Department of Computer Science, The University of Alabama
    ICPC’12
    Modeling the Ownership
    of Source Code Topics

    View Slide

  2. Modeling the Ownership
    of Source Code Topics

    View Slide

  3. top· ic /ˈtɒpɪk/
    noun
    A matter dealt with in a text,
    discourse, or conversation;
    a subject

    View Slide

  4. Modeling the Ownership
    of Source Code Topics

    View Slide

  5. Feature location
    Aspect mining
    Traceability links
    Topics

    View Slide

  6. Modeling the Ownership
    of Source Code Topics

    View Slide

  7. own· er· ship   /ˈoʊnərˌʃɪp/
    noun
    The act, state, or right of
    possessing something

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. Modeling the Ownership
    of Source Code Topics

    View Slide

  12. Expertise
    Defect prediction
    Ownership

    View Slide

  13. Modeling the Ownership
    of Source Code Topics

    View Slide

  14. Feature location
    Aspect mining
    Traceability links
    Topics

    View Slide

  15. Expertise
    Defect prediction
    Ownership

    View Slide

  16. Expertise of Topics
    Defect prediction of Topics
    Ownership
    of Topics

    View Slide

  17. Do classes that belong to the same
    linguistic topic have similar ownership
    characteristics?

    View Slide

  18. Do similar linguistic topics have similar
    ownership characteristics?

    View Slide

  19. Modeling the Ownership
    of Source Code Topics

    View Slide

  20. Topic Modeling

    View Slide

  21. View Slide

  22. System topic

    View Slide

  23. System topic
    Supertopics

    View Slide

  24. System topic
    Supertopics
    Subtopics

    View Slide

  25. System topic
    Supertopics
    Subtopics
    Document
    Document
    Document
    Document
    Document
    Document
    Documents

    View Slide

  26. Main development
    branch (trunk/)
    Revision: HEAD
    Document Extraction

    View Slide

  27. Document Extraction
    Comments, Identifiers, Literals
    Split, Normalize, Filter

    View Slide

  28. Modeling the Ownership
    of Source Code Topics

    View Slide

  29. Main development
    branch (trunk/)
    Revisions: 1 to HEAD
    Repository Mining

    View Slide

  30. View Slide

  31. Ownership Profiles

    View Slide

  32. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >

    View Slide

  33. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >

    View Slide

  34. Case study

    View Slide

  35. 10 Java systems
    using Subversion

    View Slide

  36. Do classes that belong to the same
    linguistic topic have similar ownership
    characteristics?

    View Slide

  37. Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Documents
    Subtopics
    Supertopics
    System topic

    View Slide

  38. 0.0
    0.5
    1.0

    View Slide

  39. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  40. !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0
    Ant ArgoUML CAROL GWT iText JabRef jEdit JHotDraw Subversive Vuze

    View Slide

  41. Do classes that belong to the same
    linguistic topic have similar ownership
    characteristics?

    View Slide

  42. Do classes that belong to the same
    linguistic topic have similar ownership
    characteristics?

    View Slide

  43. Do similar linguistic topics have similar
    ownership characteristics?

    View Slide

  44. Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Documents
    Subtopics
    Supertopics
    System topic

    View Slide

  45. Do similar linguistic topics have similar
    ownership characteristics?

    View Slide

  46. Do similar linguistic topics have similar
    ownership characteristics?

    View Slide

  47. Threats

    View Slide

  48. No commit
    classification

    View Slide

  49. Invalid Java files,
    PAM parameters

    View Slide

  50. Java systems on SVN

    View Slide

  51. Where to
    explore next?

    View Slide

  52. Classes within a topic have similar ownership
    Similar topics have similar ownership
    Conclusion

    View Slide

  53. Thanks!
    C.S. Corley, E. A. Kammer, and N. A. Kraft
    Department of Computer Science, The University of Alabama
    Images used: http://flic.kr/y/my4BeJ
    Modeling the Ownership
    of Source Code Topics
    History miner: http://github.com/software-eng-ua-edu/ohm

    View Slide

  54. address
    port
    network
    inet
    tcp
    socket
    udp
    proxy
    admin
    nat
    host
    protocol
    bind
    local
    socks
    addresses
    server
    interface
    exception
    http

    View Slide

  55. core.networkmanager.admin.NetworkAdminASN
    core.networkmanager.admin.NetworkAdminNATDevice
    core.networkmanager.admin.NetworkAdminNetworkInterface
    core.networkmanager.admin.NetworkAdminProtocol
    core.networkmanager.admin.NetworkAdminRoutesListener
    core.networkmanager.admin.impl.NetworkAdminProtocolTester
    core.proxy.socks.impl.AESocksProxyAddressImpl
    core.util.NetUtils
    net.natpmp.NatPMPDevice

    View Slide

  56. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >

    View Slide

  57. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >

    View Slide

  58. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956

    View Slide

  59. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956

    View Slide

  60. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956

    View Slide

  61. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.04

    View Slide

  62. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.04

    View Slide

  63. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.04

    View Slide

  64. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.0
    0.04

    View Slide

  65. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.0
    0.04

    View Slide

  66. class Foo: < 4, 32, 9, 0, 0 >
    class Bar: < 0, 2, 0, 0, 0 >
    class Yak: < 1, 0, 0, 2, 2 >
    topic FooBarYak: < 5, 34, 9, 2, 2 >
    0.956
    0.0
    0.04
    0.332

    View Slide

  67. package edu.ua.eng.software.ohm;
    /* This is our Brick class. It will represent bricks
    * we can use to build things with. Bricks are cool.
    */
    class Brick {
    private int width;
    private int height;
    public Brick(int width, int height){
    // Set this brick's dimensions
    this.width = width;
    this.height = height;
    }
    public String toString(){
    return "Brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  68. package edu.ua.eng.software.ohm;
    /* This is our Brick class. It will represent bricks
    * we can use to build things with. Bricks are cool.
    */
    class Brick {
    private int width;
    private int height;
    public Brick(int width, int height){
    // Set this brick's dimensions
    this.width = width;
    this.height = height;
    }
    public String toString(){
    return "Brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  69. package edu.ua.eng.software.ohm;
    /* This is our Brick class. It will represent bricks
    * we can use to build things with. Bricks are cool.
    */
    class Brick {
    private int width;
    private int height;
    public Brick(int width, int height){
    // Set this brick's dimensions
    this.width = width;
    this.height = height;
    }
    public String toString(){
    return "Brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  70. package edu.ua.eng.software.ohm;
    /* This is our Brick class. It will represent bricks
    * we can use to build things with. Bricks are cool.
    */
    class Brick {
    private int width;
    private int height;
    public Brick(int width, int height){
    // Set this brick s dimensions
    this width = width;
    this.height = height;
    }
    public String to String(){
    return "Brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  71. package edu.ua.eng.software.ohm;
    /* this is our brick class. it will represent bricks
    * we can use to build things with. bricks are cool.
    */
    class brick{
    private int width;
    private int height;
    public brick(int width, int height){
    // set this brick s dimensions
    this width = width;
    this height = height;
    }
    public String to string(){
    return "brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  72. package edu.ua.eng.software.ohm;
    /* this is our brick class. it will represent bricks
    * we can use to build things with. bricks are cool.
    */
    class brick{
    private int width;
    private int height;
    public brick(int width, int height){
    // set this brick s dimensions
    this width = width;
    this height = height;
    }
    public String to string(){
    return "brick is " + width + " wide and " +
    height + " tall!";
    }
    }

    View Slide

  73. brick
    represent
    bricks
    use
    build
    things
    cool
    height
    width
    set
    dimensions
    wide
    tall

    View Slide

  74. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  75. !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  76. 0.0
    0.5
    1.0

    View Slide

  77. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  78. ! !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  79. !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  80. !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  81. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  82. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide

  83. !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    0.0
    0.5
    1.0

    View Slide