You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Yann-Gaël Guéhéneuc <gu...@iro.umontreal.ca> on 2006/02/25 23:09:33 UTC

Detection of design defects

      Dear Xerces developers,

      We are a team of software engineers doing research on design
defects (antipatterns, codesmells...) in the Departement of Informatics
and Operations Research at University of Montreal. We develop a
framework to describe design defects synthetically and to detect these
in program source code automatically. We are currently performing
experiments to assess our detection algorithms.

      We selected Xerces as an obvious case study because it is a
well-known, widely spread, and mature software. Also, we use Xerces for
our own teaching and research projects.

      Would you be interested in helping us assessing our detection
algorithms? We would be very grateful if you could provide us with your
expertise on the development of Xerces to help us in understanding why
certain classes are erroneously highlighted as design defects by our
algorithms. It is important for us to have your comments because we are
by no means experts in the implementation of Xerces and we would be bias
by our own implementation of the detection algorithms. Also, you might
find our detection algorithms useful to improve the design and
implementation of certain classes and, thus, to ease the maintenance and
evolution of Xerces. Of course, we will make our detection algorithms
available to you and your community when they are validated.

      We applied our algorithms on v2.7.0 and generated potential 
candidate classes for the follwing design defects (from the Brown's 
AntiPatterns book):
- Blob, a large class doing all the work, only using small Data Class to
store/to retrieve data.
- Functional Decomposition, a class that does not conform fully to the
OO paradigm, such as not using inheritance and polymorphism.
- Spaghetti Code, a class with long methods and too many "global" variables.
- Swiss Army Knife, a class implementing too many functionnalities
and-or providing too many services.

     We attach to this message some results of our detection algorithms. 
The classes named in these files are *candidate* design defects and we 
already found manually many false positive cases (i.e., class 
highlighted as design defects which are not). We cannot provide you now 
with the complete results as your anti-spam filter rejects .zip files, 
let us know if we can transfer you the results in another way.. Would it 
be possible that you kindly help us in improving our algorithms or point 
us to someone who could help us?

      If you have any questions or comments, please feel free to contact
either myself or Naouel Moha, Ph.D. student working full-time on this
project.

      Best regards,
      Yann-Gaël

--

# Results of the detection in Xerces v2.7.0

############################## Results of the detection of the Blob 
################################
# LargeClass
1.100.LargeClass.1.Name = 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
1.100.LargeClass.1.NAD = 47.0
1.100.LargeClass.1.NMD = 35.0
# DataClass
1.100.DataClass.2.Name = org.apache.xerces.util.XMLSymbols
1.100.DataClass.2.NAD = 17.0
1.100.DataClass.2.NMD = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
2.100.DataClass.1.Name = org.apache.xerces.impl.xs.traversers.OneAttr
2.100.DataClass.1.NAD = 4.0
2.100.DataClass.1.NMD = 1.0
# Low Cohesion
2.100.Low Cohesion.2.Name = 
org.apache.xerces.impl.xs.traversers.SmallContainer
2.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
3.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
3.100.DataClass.1.NAD = 17.0
3.100.DataClass.1.NMD = 2.0
# Low Cohesion
3.100.Low Cohesion.2.Name = org.apache.xerces.impl.dtd.XML11NSDTDValidator
3.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# Low Cohesion
4.100.Low Cohesion.1.Name = org.apache.xerces.impl.xs.identity.KeyRef
4.100.Low Cohesion.1.LCOM5 = 2.0
# DataClass
4.100.DataClass.2.Name = org.apache.xerces.impl.xs.identity.UniqueOrKey
4.100.DataClass.2.NAD = 0.0
4.100.DataClass.2.NMD = 1.0

############################## Results of the detection of the Blob 
################################
# DataClass
5.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
5.100.DataClass.1.NAD = 17.0
5.100.DataClass.1.NMD = 2.0
# LargeClass
5.100.LargeClass.2.Name = org.apache.xerces.parsers.AbstractSAXParser
5.100.LargeClass.2.NAD = 30.0
5.100.LargeClass.2.NMD = 53.0

############################## Results of the detection of the Blob 
################################
# LargeClass
6.100.LargeClass.1.Name = org.apache.xerces.impl.xs.SchemaGrammar
6.100.LargeClass.1.NAD = 41.0
6.100.LargeClass.1.NMD = 51.0
# DataClass
6.100.DataClass.2.Name = org.apache.xerces.impl.xs.SchemaSymbols
6.100.DataClass.2.NAD = 161.0
6.100.DataClass.2.NMD = 2.0
# DataClass
6.100.DataClass.3.Name = org.apache.xerces.parsers.SAXParser
6.100.DataClass.3.NAD = 5.0
6.100.DataClass.3.NMD = 5.0

############################## Results of the detection of the Blob 
################################
# LargeClass
7.100.LargeClass.1.Name = org.apache.xerces.impl.xs.XMLSchemaLoader
7.100.LargeClass.1.NAD = 50.0
7.100.LargeClass.1.NMD = 41.0
# DataClass
7.100.DataClass.2.Name = org.apache.xerces.impl.xs.SchemaSymbols
7.100.DataClass.2.NAD = 161.0
7.100.DataClass.2.NMD = 2.0
# DataClass
7.100.DataClass.3.Name = org.apache.xerces.util.XMLSymbols
7.100.DataClass.3.NAD = 17.0
7.100.DataClass.3.NMD = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
8.100.DataClass.1.Name = org.apache.xerces.impl.xs.traversers.OneAttr
8.100.DataClass.1.NAD = 4.0
8.100.DataClass.1.NMD = 1.0
# Low Cohesion
8.100.Low Cohesion.2.Name = 
org.apache.xerces.impl.xs.traversers.LargeContainer
8.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# LargeClass
9.100.LargeClass.1.Name = org.apache.xerces.dom.RangeImpl
9.100.LargeClass.1.NAD = 15.0
9.100.LargeClass.1.NMD = 55.0
# DataClass
9.100.DataClass.2.Name = org.apache.xerces.dom.RangeExceptionImpl
9.100.DataClass.2.NAD = 1.0
9.100.DataClass.2.NMD = 1.0

############################## Results of the detection of the Blob 
################################
# DataClass
10.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
10.100.DataClass.1.NAD = 17.0
10.100.DataClass.1.NMD = 2.0
# DataClass
10.100.DataClass.2.Name = org.apache.xerces.parsers.SAXParser
10.100.DataClass.2.NAD = 5.0
10.100.DataClass.2.NMD = 5.0
# LargeClass
10.100.LargeClass.3.Name = 
org.apache.xerces.jaxp.validation.ValidatorHandlerImpl
10.100.LargeClass.3.NAD = 26.0
10.100.LargeClass.3.NMD = 54.0

############################## Results of the detection of the Blob 
################################
# DataClass
11.100.DataClass.1.Name = org.apache.xerces.impl.dv.DVFactoryException
11.100.DataClass.1.NAD = 1.0
11.100.DataClass.1.NMD = 2.0
# Low Cohesion
11.100.Low Cohesion.2.Name = org.apache.xerces.impl.dv.DTDDVFactory
11.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
12.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
12.100.DataClass.1.NAD = 17.0
12.100.DataClass.1.NMD = 2.0
# LargeClass
12.100.LargeClass.2.Name = org.apache.xerces.dom.DOMNormalizer
12.100.LargeClass.2.NAD = 24.0
12.100.LargeClass.2.NMD = 33.0

############################## Results of the detection of the Blob 
################################
# DataClass
13.100.DataClass.1.Name = org.apache.xerces.impl.xs.SchemaSymbols
13.100.DataClass.1.NAD = 161.0
13.100.DataClass.1.NMD = 2.0
# DataClass
13.100.DataClass.2.Name = org.apache.xerces.util.XMLSymbols
13.100.DataClass.2.NAD = 17.0
13.100.DataClass.2.NMD = 2.0
# LargeClass
13.100.LargeClass.3.Name = org.apache.xerces.impl.xs.XMLSchemaValidator
13.100.LargeClass.3.NAD = 112.0
13.100.LargeClass.3.NMD = 64.0

############################## Results of the detection of the Blob 
################################
# DataClass
14.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
14.100.DataClass.1.NAD = 17.0
14.100.DataClass.1.NMD = 2.0
# LargeClass
14.100.LargeClass.2.Name = org.apache.xerces.xinclude.XIncludeHandler
14.100.LargeClass.2.NAD = 88.0
14.100.LargeClass.2.NMD = 113.0

############################## Results of the detection of the Blob 
################################
# LargeClass
15.100.LargeClass.1.Name = org.apache.xml.serialize.BaseMarkupSerializer
15.100.LargeClass.1.NAD = 21.0
15.100.LargeClass.1.NMD = 66.0
# DataClass
15.100.DataClass.2.Name = org.apache.xml.serialize.ElementState
15.100.DataClass.2.NAD = 11.0
15.100.DataClass.2.NMD = 1.0
# DataClass
15.100.DataClass.3.Name = org.w3c.dom.ls.LSException
15.100.DataClass.3.NAD = 3.0
15.100.DataClass.3.NMD = 1.0

############################## Results of the detection of the Blob 
################################
# DataClass
16.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
16.100.DataClass.1.NAD = 17.0
16.100.DataClass.1.NMD = 2.0
# Low Cohesion
16.100.Low Cohesion.2.Name = org.apache.xerces.impl.dtd.XMLNSDTDValidator
16.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
17.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
17.100.DataClass.1.NAD = 17.0
17.100.DataClass.1.NMD = 2.0
# LargeClass
17.100.LargeClass.2.Name = org.apache.xerces.impl.dtd.XMLDTDValidator
17.100.LargeClass.2.NAD = 64.0
17.100.LargeClass.2.NMD = 50.0

############################## Results of the detection of the Blob 
################################
# DataClass
18.100.DataClass.1.Name = org.apache.xerces.util.XMLSymbols
18.100.DataClass.1.NAD = 17.0
18.100.DataClass.1.NMD = 2.0
# LargeClass
18.100.LargeClass.2.Name = org.apache.xerces.impl.dtd.XMLDTDProcessor
18.100.LargeClass.2.NAD = 38.0
18.100.LargeClass.2.NMD = 52.0

############################## Results of the detection of the Blob 
################################
# DataClass
19.100.DataClass.1.Name = org.apache.xerces.impl.dv.DVFactoryException
19.100.DataClass.1.NAD = 1.0
19.100.DataClass.1.NMD = 2.0
# Low Cohesion
19.100.Low Cohesion.2.Name = org.apache.xerces.impl.dv.SchemaDVFactory
19.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
20.100.DataClass.1.Name = 
org.apache.xerces.impl.dv.InvalidDatatypeValueException
20.100.DataClass.1.NAD = 1.0
20.100.DataClass.1.NMD = 1.0
# Low Cohesion
20.100.Low Cohesion.2.Name = org.apache.xerces.impl.dv.xs.BooleanDV
20.100.Low Cohesion.2.LCOM5 = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
21.100.DataClass.1.Name = 
org.apache.xerces.impl.xs.traversers.XSAnnotationInfo
21.100.DataClass.1.NAD = 5.0
21.100.DataClass.1.NMD = 2.0
# DataClass
21.100.DataClass.2.Name = org.apache.xerces.impl.xs.SchemaSymbols
21.100.DataClass.2.NAD = 161.0
21.100.DataClass.2.NMD = 2.0
# DataClass
21.100.DataClass.3.Name = org.apache.xerces.util.XMLSymbols
21.100.DataClass.3.NAD = 17.0
21.100.DataClass.3.NMD = 2.0
# LargeClass
21.100.LargeClass.4.Name = org.apache.xerces.impl.xs.traversers.XSDHandler
21.100.LargeClass.4.NAD = 104.0
21.100.LargeClass.4.NMD = 44.0
# DataClass
21.100.DataClass.5.Name = org.apache.xerces.parsers.SAXParser
21.100.DataClass.5.NAD = 5.0
21.100.DataClass.5.NMD = 5.0

############################## Results of the detection of the Blob 
################################
# DataClass
22.100.DataClass.1.Name = org.apache.xerces.impl.xs.SchemaSymbols
22.100.DataClass.1.NAD = 161.0
22.100.DataClass.1.NMD = 2.0
# DataClass
22.100.DataClass.2.Name = org.apache.xerces.util.XMLSymbols
22.100.DataClass.2.NAD = 17.0
22.100.DataClass.2.NMD = 2.0
# LargeClass
22.100.LargeClass.3.Name = 
org.apache.xerces.impl.xs.traversers.XSAttributeChecker
22.100.LargeClass.3.NAD = 103.0
22.100.LargeClass.3.NMD = 12.0
# DataClass
22.100.DataClass.4.Name = org.apache.xerces.impl.xs.traversers.OneAttr
22.100.DataClass.4.NAD = 4.0
22.100.DataClass.4.NMD = 1.0
# DataClass
22.100.DataClass.5.Name = 
org.apache.xerces.impl.dv.InvalidDatatypeValueException
22.100.DataClass.5.NAD = 1.0
22.100.DataClass.5.NMD = 1.0
# DataClass
22.100.DataClass.6.Name = org.apache.xerces.impl.xs.traversers.OneElement
22.100.DataClass.6.NAD = 2.0
22.100.DataClass.6.NMD = 2.0

############################## Results of the detection of the Blob 
################################
# ControllerClass
23.100.ControllerClass.1.Name = org.apache.xerces.impl.dtd.XMLDTDProcessor
# DataClass
23.100.DataClass.2.Name = org.apache.xerces.util.XMLSymbols
23.100.DataClass.2.NAD = 17.0
23.100.DataClass.2.NMD = 2.0

############################## Results of the detection of the Blob 
################################
# DataClass
24.100.DataClass.1.Name = org.apache.xerces.impl.xs.SchemaSymbols
24.100.DataClass.1.NAD = 161.0
24.100.DataClass.1.NMD = 2.0
# LargeClass
24.100.LargeClass.2.Name = org.apache.xerces.impl.xs.XSComplexTypeDecl
24.100.LargeClass.2.NAD = 21.0
24.100.LargeClass.2.NMD = 43.0

############################## Results of the detection of the Blob 
################################
# LargeClass
25.100.LargeClass.1.Name = org.apache.xerces.dom.CoreDocumentImpl
25.100.LargeClass.1.NAD = 24.0
25.100.LargeClass.1.NMD = 126.0
# DataClass
25.100.DataClass.2.Name = org.apache.xerces.dom.NodeListCache
25.100.DataClass.2.NAD = 6.0
25.100.DataClass.2.NMD = 1.0

############################## Results of the detection of the Blob 
################################
# DataClass
26.100.DataClass.1.Name = 
org.apache.xerces.impl.dv.InvalidDatatypeFacetException
26.100.DataClass.1.NAD = 1.0
26.100.DataClass.1.NMD = 1.0
# DataClass
26.100.DataClass.2.Name = org.apache.xerces.impl.xs.SchemaSymbols
26.100.DataClass.2.NAD = 161.0
26.100.DataClass.2.NMD = 2.0
# DataClass
26.100.DataClass.3.Name = 
org.apache.xerces.impl.dv.InvalidDatatypeValueException
26.100.DataClass.3.NAD = 1.0
26.100.DataClass.3.NMD = 1.0
# LargeClass
26.100.LargeClass.4.Name = org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl
26.100.LargeClass.4.NAD = 109.0
26.100.LargeClass.4.NMD = 88.0

-- 
Yann-Gaël Guéhéneuc, Ph.D.
Professeur adjoint / Assistant professor
Ptidej Project Team Leader
GEODES - Group of Open and Distributed Systems,
           Experimental Software Engineering
DIRO, Université de Montréal         1-514-343-6782 (Téléphone / Phone)
C.P. 6128, succursale Centre-Ville   1-514-343-5834 (Télécopie / Fax)
Montréal, QC, H3C 3J7, Canada        www.ptidej.net


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org