A Software Defect Prediction System Using Cohesion Metrics: Click To Edit Master Subtitle Style Under The Guidance of

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

A software defect prediction system using cohesion metrics

Click to edit Master guidance of Under the subtitle style


Mrs. K.L.S. Soujanya, Associate professor

By
B Chandrakanth Reddy K Sharath 4/28/12 P Krishna Kanth

contents
Introduction Objective Problem statement Existing system Proposed system Architecture Requirements Output screens
4/28/12

introduction
Software defect prediction
Software defect prediction is an economically

important activity and so has received a good deal of attention.

Cohesion
High cohesion is a desirable property of

software as it positively impacts understanding, reuse, and maintenance.

4/28/12

introduction
Software cohesion
cohesionis

a measure of how stronglyrelated each piece of functionality expressed by the source code of a softwaremodule is.

Cohesion
Software cohesion can be defined as a

measure of the degree to which elements of a module belong together


Cohesion is usually measured on structural

information extracted solely from the source code.


4/28/12

objective
Existing approaches are largely based on

using the structural information from the source code, such as attribute references, in methods to measure cohesion. classes in OO software systems based on the analysis of the unstructured information embedded in the source code, such as comments and identifiers.

Propose a new measure for the cohesion of

the new measure with an extensive set of

existing metrics and uses them to construct models that predict software faults. 4/28/12

Problem statement
Existing system
Existing approaches are largely based on

using the structural information from the source code, such as attribute references, in methods to measure cohesion. information extracted solely from the source code Logical Relatedness of Methods (LORM) and the Lack of Conceptual Cohesion in Methods (LCOM)
4/28/12

Cohesion is usually measured on structural

existing cohesion metrics for OO software, the

Existing system
Disadvantages
Lacking of high cohesion. Lacking of measurement in cohesion. It fails to check weather the class is concept

oriented or not.

4/28/12

Proposed system
Proposed system
We are proposing a new metric called C3, that

measures the cohesiveness of a source file using the un-structural information from it. is retrieved from the source code like comments and identifiers.

In proposed System unstructural information

Information is retrieved from the source code

using Latent Semantic Indexing.


With the help of C3 and existing metrics ,we

are comparing both the results and use them to construct models that predict4/28/12 defects.

Proposed system
Advantages
Effective measurement of cohesion for a class. Check weather the class is concept oriented or

not.
Calculating the cohesion for object oriented

systems in effective way.

4/28/12

Proposed metric Conceptual Cohesion of Classes the conceptual aspects of (C3) Captures
class cohesion, as it measures how strongly the methods of a class relate to each other conceptually.
The conceptual relation between

methods is based on the principle of textual coherence


C3 is based on the analysis of textual

information in the source code, expressed in comments and 4/28/12 identifiers.

Latent Semantic Indexing (LSI)


We use LSI to extract and analyze the

unstructured information from the source code

LSI is an advanced IR method Reasons for using LSI


concept and feature location traceability link recovery between source code

and documentation
identification of abstract data types in legacy

source code
clone detection
4/28/12

LSI
Measuring Text Coherence with Latent

Semantic Indexing

Compute the similarities between consecutive

sentences in the text


From Textual Coherence to Software

Cohesion

extraction of relevant information from the

source code i.e. all identifiers and comments from the source code 4/28/12

architecture

4/28/12

modules
LOCM measure computation
We measure the cohesive nature of source file

using structural information

C3 measure computation
Using C3 metrics we compute the cohesion

strength of source class using LSI IR technique on un- structural information

LCOM and C3 cohesive comparison

designers module

4/28/12

LCOM computation
Here we compute the cohesion measure of

source file using its structural information like variables, methods etc
Input a preprocessed source file

Steps to compute

Extract structural information from the source Apply the LCOM formula on each method of

source
If the result is 0,then we say that the class is

highly cohesive
4/28/12 If the result is 1,then it is less cohesive

Conceptual Cohesion of Classes(C3) computation


A tool IR-based Conceptual Cohesion Class

Measurement, which supports this methodology and automatically computes C3 for any class in a given software system preprocessed and parsed to produce a text corpus. Comments and identifiers from each method are extracted and processed. A document in the corpus is created for each method in every class.

Corpus creation: The source code is

Corpus indexing: LSI is used to index the

corpus and create an equivalent semantic space. 4/28/12

C3 measure

4/28/12

C3 computation
consider an OO system as a set of classes

C ={ c1; c2 . . . cn }.
The total number of classes in the system C is

n = mod(C).
A class has a set of methods. For each class c E

C, M(c)={m1; . . .;mk} is the set of methods of class c.

Conceptual Similarity between Methods(CSM)

4/28/12 where vmk and vmj are the vectors corresponding to the

mk;mj E M(ci) methods, T denotes the transpose, and

C3 computation
Average Conceptual Similarity of Methods

in a class (ACSM), The ACSM c E C is

(C3). For a class c 2 C, the conceptual

cohesion of c, C3(c) is defined as follows:

4/28/12

conclusion

The combination of structural and

conceptual cohesion metrics defines better models for the prediction of faults in classes than combinations of structural metrics alone.

4/28/12

System Requirements
Hardware Requirements:

Processor:Intel Duel core Hard Disk :60GB Monitor :LCD color RAM :512 MB
Software Requirements:

Operating System

4/28/12

output

4/28/12

Compile all the java files

4/28/12

Browse a source file

4/28/12

LCOM cohesive measure

4/28/12

Browse file for c3 measure

4/28/12

Result of C3 measure

4/28/12

Output in cmd

4/28/12

Thank you
4/28/12

You might also like