Complexity metrics for data schemas

Information

  • Patent Application
  • 20070220486
  • Publication Number
    20070220486
  • Date Filed
    March 16, 2006
    18 years ago
  • Date Published
    September 20, 2007
    17 years ago
Abstract
A schema code complexity analysis architecture that computes complexity data for output to a code designer. The complexity data can be in the form of a number and/or complexity level. A schema component is provided for processing schema code, and a metrics component, for outputting a complexity value based on complexity of the schema code. In one implementation, the schema code is based on an XML schema, and the metrics component employs a newly-defined variation of a McCabe cyclomatic complexity metric to determine the complexity value. The decisions employed for computing schema complexity can include choices, occurrence constraints, element references to substitution groups, type references to types that are extended or restricted, a multiplicity of root element declarations, and nillable elements.
Description

BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 illustrates a system that facilitates schema code analysis for a complexity metric value in accordance with an innovative aspect.



FIG. 2 illustrates a methodology of generating a complexity metric for the schema code.



FIG. 3 illustrates a methodology of analyzing decision nodes as part of complexity processing in accordance with another aspect.



FIG. 4 illustrates a block of complexity definitions which are executed as part of the complexity metric processing in accordance with another aspect of the innovation.



FIG. 5 illustrates a system that employs a reporting component for reporting complexity number.



FIG. 6 illustrates a flow diagram of a methodology reporting the complexity value as part of schema code processing.



FIG. 7 illustrates an alternative methodology of logging and outputting more detailed complexity information and suggestion message according to an aspect.



FIG. 8 illustrates a development tool that facilitates schema complexity processing and suggestions in accordance with an aspect.



FIG. 9 illustrates a complexity analysis and processing system that employs interim complexity analysis in accordance with an innovative aspect.



FIG. 10 illustrates a flow diagram of a methodology of interim code complexity analysis according to an aspect.



FIG. 11 illustrates a development tool system that can employ section and decision selection processing in accordance with another alternative aspect.



FIG. 12 illustrates a methodology of selective decision processing in accordance with an aspect.



FIG. 13 illustrates a flow diagram that represents a methodology of selecting a set of decision nodes that will be examined for the all of the schema code.



FIG. 14 illustrates a methodology of dynamically reporting information to the designer during code development.



FIG. 15 illustrates a block diagram of a computer operable to execute the disclosed complexity analysis and processing architecture.



FIG. 16 illustrates a schematic block diagram of an exemplary computing environment.


Claims
  • 1. A computer-implemented system for indicating code complexity, comprising: a schema component for processing schema code; anda metrics component for outputting a complexity value based on complexity of the schema code.
  • 2. The system of claim 1, wherein the schema code is based on an XML schema.
  • 3. The system of claim 1, wherein the metrics component employs a variation of a McCabe cyclomatic complexity metric to determine the complexity value.
  • 4. The system of claim 1, wherein the metrics component determines a psychological complexity of the schema code.
  • 5. The system of claim 1, wherein the metrics component employs an algorithm that counts coded decision nodes to arrive at the complexity value.
  • 6. The system of claim 5, wherein the decision nodes include at least one of choices and occurrence constraints.
  • 7. The system of claim 5, wherein the decision nodes include at least one of element references to substitution groups and type references to types that are extended or restricted.
  • 8. The system of claim 5, wherein the decision nodes include at least one of a multiplicity of root element declarations and nillable elements.
  • 9. The system of claim 1, wherein the complexity value is a number of decision nodes in the schema code.
  • 10. The system of claim 1, wherein the complexity value is associated with a complexity level that defines a range of complexity values.
  • 11. The system of claim 1, wherein the metrics component generates the complexity value during an interim schema code design process.
  • 12. The system of claim 1, wherein the metrics component generates the complexity value during at an end of a schema code design process.
  • 13. The system of claim 1, further comprising a reporting component that outputs a suggestion for reducing complexity of the schema code.
  • 14. A computer-implemented method of computing code complexity of a schema code, comprising: receiving schema code;analyzing the schema code for decision information;processing the decision information to generate complexity data; andreporting the complexity data.
  • 15. The method of claim 14, further comprising an act of processing the decision information for an interim phase of development of the schema code, which is an XML-based schema code.
  • 16. The method of claim 14, further comprising an act of dynamically presenting a suggestion that reduces complexity of the schema code.
  • 17. The method of claim 14, wherein the act of analyzing further comprises at least one of the acts of: processing the schema code for choice nodes;processing the schema code for occurrence constraints;processing the schema code for element references to substitution groups;processing the schema code for type references to types that are at least one of extended and restricted;processing the schema code for root element declarations;processing the schema code for nillable elements.
  • 18. The method of claim 14, further comprising an act of outputting a complexity value of the complexity data, the complexity value derived according to at least one of the acts of: adding n to the complexity value based on a choice model group having n branches;adding a value of one to the complexity value for each true nillable element found;adding a value of one to the complexity value for each root element declaration found;adding a value of v to the complexity value for each type reference to t contributes v, where t is a name of a user-defined type with v>1 non-abstract subtypes;adding a value of j to the complexity value for each element reference to h, where h is a name of a head of a substitution group with j>1 non-abstract participants; andadding a value of one to the complexity value for each occurrence constraint of minOccurs being not equal to maxOccurs.
  • 19. The method of claim 14, further comprising an act of defining the decision information for processing against the schema code and biasing one of the decision information more than another.
  • 20. A computer-executable system for computing complexity information of schema code, comprising: computer-implemented means for receiving schema code;computer-implemented means for analyzing the schema code for decision information;computer-implemented means for processing the decision information to generate level of complexity;computer-implemented means for reporting the complexity data; andcomputer-implemented means for presenting a suggestion for changing the level of complexity.