Java quality assurance by detecting code smells

Software inspection is a known technique for improving software quality. It involves carefully examining the code, the design, and the documentation of software and checking these for aspects that are known to be potentially problematic based on past experience. Code smells are a metaphor to describe patterns that are generally associated with bad design and bad programming practices. Originally, code smells are used to find the places in software that could benefit from refactoring. In this paper we investigate how the quality of code can be automatically assessed by checking for the presence of code smells and how this approach can contribute to automatic code inspection. We present an approach for the automatic detection and visualization of code smells and discuss how this approach can be used in the design of a software inspection tool. We illustrate the feasibility of our approach with the development of jCOSMO, a prototype code smell browser that detects and visualizes code smells in JAVA source code. Finally, we show how this tool was applied in a case study.

[1]  Jan A. Bergstra,et al.  The algebraic specification formalism ASF , 1989 .

[2]  Leon Moonen,et al.  Generating robust parsers using island grammars , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[3]  Arie van Deursen,et al.  The ASF+SDF Meta-environment: A Component-Based Language Development Environment , 2001 .

[4]  Richard C. Holt Structural manipulations of software architecture using Tarski relational algebra , 1998, Proceedings Fifth Working Conference on Reverse Engineering (Cat. No.98TB100261).

[5]  Hausi A. Müller,et al.  Analyzing Java software by combining metrics and program visualization , 2000, Proceedings of the Fourth European Conference on Software Maintenance and Reengineering.

[6]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

[7]  Peter J. Middleton,et al.  Software Inspection , 1994, J. Inf. Technol..

[8]  Stéphane Ducasse,et al.  A hybrid reverse engineering approach combining metrics and program visualisation , 1999, Sixth Working Conference on Reverse Engineering (Cat. No.PR00303).

[9]  Han Noot,et al.  CharToon: a system to animate 2D cartoons faces , 1999, Eurographics.

[10]  Hausi A. Müller,et al.  Programmable Reverse Engineering , 1994, Int. J. Softw. Eng. Knowl. Eng..

[11]  Sander Tichelaar,et al.  Modeling Object-Oriented Software for Reverse Engineering and Refactoring , 2001 .

[12]  Harvey P. Siy,et al.  If your ver-sion control system could talk , 1997 .

[13]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[14]  Masaru Tomita,et al.  Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems , 1985 .

[15]  Masaru Tomita,et al.  Efficient parsing for natural language , 1985 .

[16]  Audris Mockus,et al.  Does Code Decay? Assessing the Evidence from Change Management Data , 2001, IEEE Trans. Software Eng..

[17]  Murray Hill,et al.  Lint, a C Program Checker , 1978 .

[18]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[19]  Alfred Tarski,et al.  Relational selves as self-affirmational resources , 2008 .

[20]  Eelco Visser,et al.  Syntax definition for language prototyping , 1997 .

[21]  Armin Biere,et al.  Applying static analysis to large-scale, multi-threaded Java programs , 2001, Proceedings 2001 Australian Software Engineering Conference.

[22]  Glen W. Russell,et al.  Experience with inspection in ultralarge-scale development , 1991, IEEE Software.

[23]  Michael E. Fagan Design and Code Inspections to Reduce Errors in Program Development , 1976, IBM Syst. J..

[24]  Arie van Deursen,et al.  Refactoring test code , 2001 .