ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Case Studies Instructor Paulo Alencar. Overview. Introduces a new cohesion metric called Conceptual Cohesion of Classes (C3) and uses this metric for fault prediction
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.
Lack of Cohesion in Methods
(pairs of methods with no attributes in common)
P –Q if P>0, and 0 otherwise (0 good, >1 may suggest split)
LCOM2 = 1 – sum(mA)/m*a
NP = maximum number of possible connections = N* (N-1)/2 where N=#methods
NDC # direct connections (#edges in connection graph)
Access the same class variable, or call trees starting at two methods access the same variables
NID # indirect connections (e.g., A-B-C, where A is indirectly connected to C via B)
TCC = NDC / NP (1 good)
LCC = (NDC + NID) / NP (1 good)
Coh = sum(v(A) / m * a
where v(A) = # of methods that reference attribute A
sum(v(A)) = sum over all attributes
- An advanced statistical Information Retrieval method
- Central concept: the information about the concepts in which a particular word appears or does not appear provides a way to determine the similarity of meaning of sets of words to each other
- It uses a matrix (word x context) based on knowledge in the particular domain of interest
- Similarity measure for textual coherence of comments and identifiers extracted from source code
- C3 for a class C measures conceptual cohesion, the degree to which methods of a class belong together conceptually.
- C3 in [0,1] – close to 1 is better
- Close to 1 is better: the class most likely implements a single concept or a very small number of related concepts (related in the context of the software system
- C3 is closet to 0: the methods in the class most likely implement different concepts
- Three open source systems from different domains (developed mostly in C++)
- TortoiseCVS v.1.8.21 – an extension of Microsoft Windows Explorer that uses CVS
- WinMerge v.2.0.2 – tool for visualization and merging for both files and directories
- Mozilla v.1.6 – an open source Web browser
- Question 1: Does C3 capture aspects of class cohesion that are not captured by other structural cohesion metrics?
- Question 2: Does the combination of structural cohesion metrics with C3 provide better results in predicting faults in classes that the combinations of structural metrics?
- PC1 is LCOM1, LCOM2, LCOM3, and ICH – metrics that count the number of shared instance variables
- PC4 is C3; PC2 is TCC and LCC; PC3 is LCOM5, PC5 is LCOM3 and LCOM4; PC6 is Coh
Pairs of cohesion metrics