case studies of accessibility excessiveness analysis for java programs n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Case Studies of Accessibility Excessiveness Analysis for Java Programs PowerPoint Presentation
Download Presentation
Case Studies of Accessibility Excessiveness Analysis for Java Programs

Loading in 2 Seconds...

play fullscreen
1 / 17

Case Studies of Accessibility Excessiveness Analysis for Java Programs - PowerPoint PPT Presentation


  • 119 Views
  • Uploaded on

Case Studies of Accessibility Excessiveness Analysis for Java Programs. Dotri Quoc Inoue Laboratory. Research Problem(1 ) Access Modifier in Java. CLASS1. p ublic int [] A ; protected int c ; ….. public void sort() { … } (default) int binarySearch ( int value) { … }

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Case Studies of Accessibility Excessiveness Analysis for Java Programs' - sadie


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
case studies of accessibility excessiveness analysis for java programs

Case Studies of Accessibility Excessiveness Analysis for Java Programs

DotriQuoc

Inoue Laboratory

research problem 1 access modifier in java
Research Problem(1)Access Modifier in Java

CLASS1

publicint[] A ;

  • protectedint c ;

…..

  • public void sort()

{

}

  • (default)intbinarySearch(int value)

{

}

private void process(){

}

field declaration

Access Modifier

method declaration

research problem 2
Research Problem(2)
  • Access Modifier of fields/methods in Java : control the access of other classesto that field/method.
research problem 3
Research Problem(3)
  • In Java, inexperienced/careless developers often set all of the access modifier public or default(no declaration)
  • The fields/methods which should be hidden are not hidden
  • Bugs in latter development/maintenance phase
example of bad access modifier declaration
Example of bad access modifier Declaration

Class X

Public method B

Public method A

Current

program

OK

Initialization

Main job

Invoke

Other objects

Future

modification

Directly invoke B

ae accessibility excessiveness 1 2
AE : Accessibility Excessiveness(1/2)
  • AE : Discrepancy between declared access modifier and actual usage
  • An AE could cause unwilling access to method/field
  • AE could be used as an indicator of immaturity of developer

Declaration

AE

Actual use

ae accessibility excessiveness 2 2
AE : Accessibility Excessiveness(2/2)
  • Acquirement of AE for each field/method
    • AE causes bug in latter development and maintenance phase

AE analysis tool : ModiChecker

approach to ae analysis 1 ae map
Approach to AE Analysis(1)AE MAP

Unused

AE Id

AE Id of Excessive fields/methods

Syntax Error

No Discrepancy

approach to ae analysis 2 static source code analysis
Approach to AE Analysis(2) Static Source Code Analysis
  • Requirement
    • Information of each field/method’s access modifier declaration
    • Actual Usage of each field/method
  • MASU : Platform for Metrics measurement but is useful as a Java program analysis framework

Static source code Analysis is required

Employing MASU

MASU - http://sourceforge.net/projects/masu/

architecture of modichecker
Architecture of ModiChecker

ModiChecker

Input

MASU

Source Code Analyzer

AST Database

Source Code

Extraction of access modifier declaration

Extraction of method/field usage

Required Library(.jar files)

Detection of declaration excessiveness

Report of AE Id for each method/field

overview of experiment 1 2
Overview of Experiment(1/2)
  • Objectives of experiment
    • Validation of our approach
    • Quantitative analysis of AE Id in some software systems
    • Reasons for excessive/unused fields/methods

(found by interviewing developers)

      • Reason 1 : Set for future use
      • Reason 2 : Created by other program(automatic code generators or refactoring tools…) or accessed by other programs(Java bean)
      • Reason 3 : Carelessness and immaturity
  • Target Software
    • Industrial Software(341 Java files/ 64455 LOC)
experiment result
EXPERIMENT RESULT
  • Excessive fields : 1027
  • Excessive methods : 512
  • Unused methods : 1018
  • Unused fields: 40
    • 5 fields named serialVersionUID
    • Intentionally set for future use : 8
    • Actually unused : 28 (5 fields contain potential bug)
discussion
Discussion
  • Validation of ModiChecker output
    • Changed all of the excessive access modifier and deleted some unused fields/methods
    • Modified programs were compiled and executed without any error
  • Developer should look for the detailed result and make decision to change/delete the unused/excessive fields/methods
conclusion and future work
Conclusion AND FUTURE WORK
  • Conclusion
    • Analysis method named AE for each field/method
    • ModiChecker : report AE of each field/method
    • Experiment on some softwaresystems
  • Future work
    • ModiCheckerfor other Java systems and other programming language system(C# , C++…)