Facilitating Quality Assurance through a Source Code Metrics Framework
International Conference on Computer Science and Education in Computer Science CSECS’11 Nikolay Grozev Neli Maneva Delyan Lilov
Source Code Metrics Framework Nikolay Grozev Neli Maneva Delyan - - PowerPoint PPT Presentation
International Conference on Computer Science and Education in Computer Science CSECS11 Facilitating Quality Assurance through a Source Code Metrics Framework Nikolay Grozev Neli Maneva Delyan Lilov Overview Introduction Preceding
International Conference on Computer Science and Education in Computer Science CSECS’11 Nikolay Grozev Neli Maneva Delyan Lilov
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria 2
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
3
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– A CCC (Constant/Continuous/Correct) approach – An approach that can facilitate the so-called "umbrella" activities
4
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
5
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– Metric functions – extract the metrics values based on some code artifacts; – Preprocessor functions – prepare the artifacts used by the metric functions; – Evaluation functions – combine metric values into meaningful code quality evaluations.
6
source code evaluation
. . .
preprocessor function preprocessor function preprocessor function metric function metric function evaluation function evaluation function e v a l u a t i
f u n c t i
metric function
source code evaluation source code evaluation source code module
(class, method, package etc.)
metric function parameters
(filtered graphs, hierarchies etc.)
metric function parameters
(filtered graphs, hierarchies etc.)
. . .
metrics values
(cyclomatic complexity, LOC, Halstead volume etc.)
metric function parameters
(filtered graphs, hierarchies etc.)
artifacts
(control flow graphs, inheritance hierarchy etc.)
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
7
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
8
source code evaluation . . . preprocessor function preprocessor function preprocessor function metric function metric function evaluation function evaluation function evaluation function metric function source code evaluation source code evaluation source code module (class, method, package etc.) metric function parameters (filtered graphs, hierarchies etc.) metric function parameters (filtered graphs, hierarchies etc.) . . . metrics values (cyclomatic complexity, LOC, Halstead volume etc.) metric function parameters (filtered graphs, hierarchies etc.) artifacts (control flow graphs, inheritance hierarchy etc.)Core framework
web interface statistical charts visualization
data explanations
interpretations explanations
evaluations IDE integration treemap visualization integration with versioning systems automatic extraction of context information user specified context information views to the framework
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– Should be accessible to both engineering and managerial staff – Web interface – integrated with popular web based project management
– IDE integration - for engineers
– Visualization techniques to spot code modules with poor quality -
– Visualization of historical trends of metrics values and assessments for
– Version control systems can be source of historical information.
9
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– Engineers find it difficult to interpret metrics values. They should be
– Aggregated evaluations should also be explained so to evaluate for
– Core framework represents solely a source code evaluation scheme – Defining the correct functions may be a time consuming task requiring
– A set of both preprocessor and evaluation functions can be predefined
– Automatic context detection based on project structure - binaries, import
10
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– The framework should facilitate the different roles in the software
– A view defines how a user accesses the system and his/her accessible
– Predefined views:
feedback when programming and testing.
view with access to the framework settings.
high-level visualizations etc.
– Custom views can be defined as well.
11
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
12
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– Prototype of the core framework. – Eclipse IDE integration. – Metrics visualizations - statistical charts, treemap visualization etc. – Context settings are done manually. – No explanation engine, historical information and support for views yet.
– The close integration of the visualizations within the IDE allowed for interactive
and understandable code quality feedback.
– Visualizations saved a lot of time when conducting code reviews. – Lack of explanations of the code evaluations. – Absence of easy ways to tune contextually the framework. – Managerial staff could not test due to lack of appropriate interface.
13
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
14
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
– To implement in a prototype all of the proposed in this study core
– To study more source code metrics so as to decide which of them can
15
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
This work has been partially supported by the Bulgarian National Science Research Fund (project ДМУ02/18 / 18.12.2009).
16
Computer Science and Education in Computer Science – CSECS’11, July 7-11 2011, Sofia, Bulgaria
17