WO2012171735A1 - A system and a method for processing an edited part of a piece of code, and a graphical rule editor - Google Patents

A system and a method for processing an edited part of a piece of code, and a graphical rule editor Download PDF

Info

Publication number
WO2012171735A1
WO2012171735A1 PCT/EP2012/058867 EP2012058867W WO2012171735A1 WO 2012171735 A1 WO2012171735 A1 WO 2012171735A1 EP 2012058867 W EP2012058867 W EP 2012058867W WO 2012171735 A1 WO2012171735 A1 WO 2012171735A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
piece
edited
design rules
design
Prior art date
Application number
PCT/EP2012/058867
Other languages
French (fr)
Inventor
Tushar Sharma
Prakriya Venkata Ramana Murthy
Original Assignee
Siemens Aktiengesellschaft
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Siemens Aktiengesellschaft filed Critical Siemens Aktiengesellschaft
Publication of WO2012171735A1 publication Critical patent/WO2012171735A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Definitions

  • the invention relates to processing of an edited part of piece of code. More specifically, the system relates to processing of an edited part of piece of code while the piece of code is being edited.
  • the piece of code is edited regularly in different intervals for adding any new functionality to an application of the piece of code or bug-fixing in the piece of code.
  • the software developer looses sight to track whether an edited part of the piece of code still follows the design intents which results in the piece of code improper with respect to design intents which may be
  • the said object is achieved by providing a system for
  • the system for processing an edited part of a piece of code while the piece of code is being edited to confirm a design intent is being followed by the edited part of the piece of code includes memory module configured to store a design rule and a validator processor for receiving the set of design rules from the memory module and the edited piece of code from an interface, processing the edited piece of code on a basis of the set of design rules and providing an output relating to conformance of the design intent being followed by the edited part of the piece of code.
  • the design rules define the design intent for developing the edited piece of code.
  • the system include a edited part processor for receiving the edited piece of code from the interface and adapted to transfer the edited part of the piece of code to the validator processor in a interval while the piece of code is being edited. This helps to maintain a flow of the edited piece of code in a unit by unit fashion, so that every unit of edited piece of code received by the validator processor should be relevant for conforming the following of the design intents.
  • the system includes a configuration module adapted for configuring the edited part processor for determining the interval on a basis of time metrics, line of code metrics determining size of the piece of code, logical structure according to software design of the piece of code, or combination thereof. This helps to pre ⁇ define criteria according to which the edited part processor should send the piece of code to the validator processor.
  • the edited part processor matches the usage instance information and the edited part of the piece of code and adapted to provide the edited part of the piece of code to the validator processor, if the usage information matches to the edited part of the piece of code.
  • the system includes a graphical rule editor for editing the set of design rules, such that the design rules are transferred to the memory module from the editor by using the validator processor.
  • the graphical rule editor provides an opportunity to edit the design rules or write new design rules as per requirements of the piece of code or an application of the piece of code.
  • the graphical rule editor comprising a suggestion module to provide a part of the set of design rules as suggestion to be included into the set of design rules while writing the set of design rules.
  • the suggestion module is adapted to receive the piece of code and to process the piece of code to provide a part of the set of design rules as suggestion to be included into the set of design rules while writing the set of design rules, so that, the suggestion from the suggestion module is significant and based on the piece of code.
  • the graphical rule editor includes a rule template database having a rule template to be displayed on the graphical rule editor, wherein the rule template is edited on the graphical editor to produce the set of deign rules, such that the design rules are transferred to the memory module from the editor via the interface. This helps in speedy editing of the rules through editor, as only few inputs are required to be placed on template to build the rule.
  • FIG 1 illustrates a schematic diagram of system for
  • FIG 1 shows a schematic diagram of a system 1 for processing an edited part 5 of a piece of code 13 while the piece of code 13 is being edited, wherein a memory module 3 and a validator processor 2 cooperate together to confirm a design intent is being followed by the edited part 5 of the piece of code 13.
  • the memory module 3 stores design rules 4 and sends a set of the design rules 4 to the validator processor 2 for being processed by the validator processor 2.
  • a hard disk of a general purpose computing system is adapted to include the memory module 3.
  • the memory module 3 can be externally provided in a USB Drive, magnetic tape, Compact Disk, or any other memory device adapted to include the memory module 3.
  • the validator processor 2 receives the set of the design rules 4 from the memory module 3 and the edited part 5 the piece of code 13 from an interface 6, processes the edited part 5 of the piece of code 13 on a basis of the set of design rules 4 and provides an output 7 relating to
  • validator processor 2 is included in the computing system which includes the hard disk having the memory module 3.
  • the validator processor 2 can be externally connected to the general purpose computing system including the hard disk having the memory module 3.
  • the memory module 3 can be included in any external memory device like compact disk, USB Drive, etc and can be directly connected to the validator processor 2 for transferring the set of design rules 4 to the validator processor 2.
  • the validator processor 2 the validator processor 2
  • the validator processor 2 receives the set of design rules 4 from the memory module 3, processes the meta model and the set of design rules 4 and provides an output relating to conformance of the design intent being followed by the edited part 5 of the piece of code 13.
  • the meta model is a data structure to maintain design information extracted from the edited part 5 of the piece of code 13, like classes, their interactions and relations.
  • the validator processor 2 processes the edited part 5 of the piece of code 13 to generate an abstract syntax tree for the edited part 5 of the piece of code 13, which is further processed to generate the meta model for the edited part 5 of the piece of code 13.
  • the abstract suntax tree is a tree representation of abstract syntactic structure of the edited piece of code written in particular programming language. Each node of the tree denotes a construct occurring in the edited part 5 the piece of code 13.
  • the design rules 4 are rules defining design intent like does the piece of code really do what the developer want the piece of code to do?, is the developer using a particular interface in the way an architect of the piece of code envisaged?, etc, for developing the edited part 5 of the piece of code 13.
  • the design rules 4 can also point out the design defects which were not intended, like such as
  • the set of design rules 4 are a selection of design rules 4 from the memory module 3 which are relevant for processing the edited part 5 of the piece of code 13.
  • the system 1 further includes an edited part processor 8 which receives receive the edited part 5 of the piece of code 13 from the interface 6 and adapted to transfer the edited part 5 of the piece of code 13 to the validator processor 12 in a interval while the piece of code 13 is being edited.
  • the interval can be determined on a basis of time metrics, line of code metrics determining size of the piece of code, logical structure according to software design of the piece of code, or combination thereof. Alternatively, the interval can be determined randomly by a programmer using the system
  • the edited part processor 8 is not used; rather the edited part 5 of the piece of code 13 is directly received by the validator processor 2 from the interface 6 in real time as the piece of code 13 is being edited.
  • the edited part is not used; rather the edited part 5 of the piece of code 13 is directly received by the validator processor 2 from the interface 6 in real time as the piece of code 13 is being edited.
  • the edited part is not used; rather the edited part 5 of the piece of code 13 is directly received by the validator processor 2 from the interface 6 in real time as the piece of code 13 is being edited.
  • the edited part is not used; rather the edited part 5 of the piece of code 13 is directly received by the validator processor 2 from the interface 6 in real time as the piece of code 13 is being edited.
  • the system 1 includes a configuration module 9 to configure the edited part processor 8 for setting intervals desired by the programmer.
  • the configuration module 9 is not used; rather the system 1 sets the interval to any one particular aspect like time, line of code metric, etc and let the system 1 run over just that aspect.
  • the configuration module 9 is provided with a user control which allows changing the interval while the piece of code 13 is being edited.
  • the validator processor 2 is also adapted to provide a usage instance information 10 regarding the design rules 4 being used by the edited part 5 of the piece of code 13 by
  • the usage instance information 10 indicates in the piece of code 13, where the design rules 4 are applied, or usage instance of design rules occur. Therefore, groups of
  • the validator processor 2 need not process the piece of code 13 and the set of design rules 4 to provide the usage instance information 10; rather the user of the system 1 manually identifies the usage instance information 10 by co-relating the piece of code 13 with the set of design rules 4.
  • the edited part processor 8 matches the usage instance information 10 and the edited part 5 of the piece of code 13 and adapted to provide the edited part 5 of the piece of code 13, if the usage information matches to the edited part 5 of the piece of code 13.
  • the edited part
  • a graphical rule editor 11 is also included into the system 1 to edit the set of design rules 4 such that the design rules 4 are transferred to the memory module 3 from the editor 11 by using the validator processor 2.
  • the rule editor 11 need not be used; rather the design rules 4 are ready-made available in the memory module 3 from a vendor to be used in the system 1.
  • a language is provided for writing the set of design rules 4 which can be understood by the validator processor 2 for processing the edited part 5 of the piece of code 13 and the set of design rules 4. The language provides a set of
  • the specification language provides various constructs to enable designers to specify the design intents for many patterns (such as Abstract Factory, Factory Method,
  • Example of one of the construct x Relation' is as follows:
  • the x Relation' construct specifies relationship constraints on participating entities or classes in the design rule 4.
  • the constraints specify allowed type of relationship, scope, constraint among class entities.
  • the construct can be written in the specification language as follows:
  • Source classes and user classes are participating entities of an instance of design pattern or design rule 4 that follows user-source relation.
  • the user-source relation is as follows: If class X is associated (by any relation such as association, aggregation, composition, create) with class Y and using services provided by class Y or referring to an instance of Y, then class X is a user class and class Y is a source class.
  • Source_class_scope /User_class_scope defines scope for specified source/user classes. It can take one of the following values:
  • Class - A class can (or cannot) have a certain
  • Relationship specifies relationship between source and the user classes. It may take one of the following values: Association', Aggregation', 'composition' and 'create' . 'Association' is the default relation.
  • Constraint specifies constraints on relationship between source classes and user classes.
  • Resource type objects can only be created by ResourcePool .
  • class Resource is used in a context wherein the relationship is "create an object (of type
  • Constraint can take one of the following values :
  • the graphical rule editor 11 further includes a suggestion module 12 to provide a part of the set of design rules 4 as suggestion to be included into the set of design rules 4 while writing the set of design rules 4.
  • a suggestion module 12 to provide a part of the set of design rules 4 as suggestion to be included into the set of design rules 4 while writing the set of design rules 4.
  • the design rule 4 can be suggested by taking user control to a separate screen from an editing panel to review the suggested part of the design rule 4 and accepting the suggested part of the design rule 4.
  • the part of set of design rules 4 can be suggested in any other user friendly way, so that user can fast and efficiently review the part of the design rules 4 and include the suggested part.
  • the suggestion module 12 receives the piece of code 13 and processes the piece of code 13 to provide the part of the set of design rules 4 as suggestion.
  • the suggestion module 12 receives the piece of code 13 and processes the piece of code 13 to provide the part of the set of design rules 4 as suggestion.
  • suggestion module 12 can be plug-in available through a vendor to be plugged into the graphical rule editor 11, such that the suggestion module 12 has its own database of
  • the suggestion module 12 includes a rule template database 14 having a rule template to be displayed on the graphical rule editor 11, wherein the rule template is edited on the
  • rule templates can be developed by the user manually on a basis of general consideration of the requirements of design rules 4 for a particular piece of code 13 or can be automatically generated by the rule editor 11 while editing the set of design rules 4 or can be made available by an independent vendor who may have developed the rule template database 14 on the general consideration of design rules 4 by any piece of code 13 or piece of code 13 with respect to any particular functional application like healthcare, energy, etc. or logical usage counting,
  • the rule editor 11 is configured to check the consistency of edited design rules with the design rules 4 already existing in the memory module 3.
  • the 'ResourcePool ' searches for an available 'Resource' object. If the search is successful, the object is returned to client. If the search was unsuccessful then 'ResourcePool ' tries to create a new 'Resource' object and return it. The action succeeds, if number of already created 'Resource' objects is under a specified limit. If the action fails, then the client has to wait till any one Resource object is available .
  • the intent behind the pattern is to instantiate 'Resource' objects once and use them multiple times.
  • the pool object has the responsibility to instantiate the 'Resource' objects and provides them to the client on demand. Hence it can be inferred that only 'ResourcePool' object has the
  • design rule 4 states that 'Resource' can only be created by 'ResourcePool ' object.
  • a concrete example is considered below for the object pool pattern.
  • the above design rule is shown below for the relation between classes 'Connectionlmpl ' and 'ConnectionPool ' :
  • a single design rule 4 can be specified independent of the client.
  • the design rule 4 is specified that in the context of creating an object of type 'Connectionlmpl' (Resource) , only class 'ConnectionPool' (ResourcePool) can create objects of type 'Connectionlmpl' (Resource) .
  • 'ConnectionPool' (ResourcePool) assumes the role of a user Class and 'Connectionlmpl' (Resource) that of a source Class. The design violation present in the piece of code 13 will be detected by the system 1.

Abstract

A system (1) for processing an edited part (5) of a piece of code (13) while the piece of code (13) is being edited to confirm a design intent is being followed by the edited part (5) of the piece of code (13), the system (1) including a memory module (3) configured to store a design rule (4), wherein the design rule (4) defines the design intent for developing the edited part (5) of the piece of code (13),and a validator processor (2) for receiving the set of design rules (4) from the memory module (3) and the edited part (5) of piece of code (13) from an interface (6), processing the edited part (5) of the piece of code (13) on a basis of the set of design rules (4) and providing an output (7) relating to conformance of the design intent being followed by the edited part (5) of the piece of code (13).

Description

Description
A system and a method for processing an edited part of a piece of code, and a graphical rule editor
The invention relates to processing of an edited part of piece of code. More specifically, the system relates to processing of an edited part of piece of code while the piece of code is being edited.
While developing a piece of code, a developer follows deign intents like does the piece of code really do what the developer want the piece of code to do?, is the developer using a particular interface in the way an architect of the piece of code envisaged?, do the requirements for which the piece of code is being developed captures what the client wants?, have all the customer's use cases are being supported by the piece of code?, can management's desire for
adaptability to serve new business opportunities be satisfied through new piece of code?, has government privacy
regulations is being satisfied by the piece of code?, etc.
But, during a life cycle of the piece of code, the piece of code is edited regularly in different intervals for adding any new functionality to an application of the piece of code or bug-fixing in the piece of code. During the edition of the piece of code, generally the software developer looses sight to track whether an edited part of the piece of code still follows the design intents which results in the piece of code improper with respect to design intents which may be
deterrent to a quality of the piece of code.
One possible way to support the software developers to keep track of the design intents being followed by the piece of code is disclosed by Daquing Hou in "Using SCL to Specify and Check Design Intent in Source Code", IEEE Transactions on Software Engineering, Vol. 32, NO. 6, June 2006, where a Structural Constraint Language (SCL) enables designers to express the design intents for the piece of code and a SCL conformance checking tool for examining the piece of code to confirm that the piece of code honors the design intents. It is an object of the invention to confirm a design intent being followed while a piece of code is being edited.
The said object is achieved by providing a system for
processing an edited part of a piece of code while the piece of code is being edited to confirm a design intent is being followed by the edited part of the piece of code according to claim 1, a rule editor according to claim 10 and a method for processing an edited part of a piece of code while the piece of code is being edited to confirm a design intent is being followed by the edited part of the piece of code according claim 14.
According to an embodiment of the invention, the system for processing an edited part of a piece of code while the piece of code is being edited to confirm a design intent is being followed by the edited part of the piece of code, the system includes memory module configured to store a design rule and a validator processor for receiving the set of design rules from the memory module and the edited piece of code from an interface, processing the edited piece of code on a basis of the set of design rules and providing an output relating to conformance of the design intent being followed by the edited part of the piece of code. The design rules define the design intent for developing the edited piece of code. Such a system enables a software developer to keep a track of the design intents of a designer for the piece of code while editing the piece of code, so that to conform the following of the design intents while editing the piece of code. According to another embodiment, the system include a edited part processor for receiving the edited piece of code from the interface and adapted to transfer the edited part of the piece of code to the validator processor in a interval while the piece of code is being edited. This helps to maintain a flow of the edited piece of code in a unit by unit fashion, so that every unit of edited piece of code received by the validator processor should be relevant for conforming the following of the design intents.
According yet another embodiment, the system includes a configuration module adapted for configuring the edited part processor for determining the interval on a basis of time metrics, line of code metrics determining size of the piece of code, logical structure according to software design of the piece of code, or combination thereof. This helps to pre¬ define criteria according to which the edited part processor should send the piece of code to the validator processor.
According to one embodiment, the validator processor
processes the piece of code and the design rules to ptovide provide a usage instance information regarding the design rules being used by the piece of code. This helps the
software developer only to look for the conformance of following of the design rules as provided by the usage instance information.
According to another embodiment, the edited part processor matches the usage instance information and the edited part of the piece of code and adapted to provide the edited part of the piece of code to the validator processor, if the usage information matches to the edited part of the piece of code.
This helps to improve performance of the system as now the validator processes selectively only the edited part of the piece of code as per the match of the usage information and the edited part of piece of code.
According to yet another embodiment, the system includes a graphical rule editor for editing the set of design rules, such that the design rules are transferred to the memory module from the editor by using the validator processor. The graphical rule editor provides an opportunity to edit the design rules or write new design rules as per requirements of the piece of code or an application of the piece of code.
According to an exemplary embodiment, the graphical rule editor comprising a suggestion module to provide a part of the set of design rules as suggestion to be included into the set of design rules while writing the set of design rules. This supports quick editing of the design rules. According to another embodiment, the suggestion module is adapted to receive the piece of code and to process the piece of code to provide a part of the set of design rules as suggestion to be included into the set of design rules while writing the set of design rules, so that, the suggestion from the suggestion module is significant and based on the piece of code.
According to yet another embodiment, the graphical rule editor includes a rule template database having a rule template to be displayed on the graphical rule editor, wherein the rule template is edited on the graphical editor to produce the set of deign rules, such that the design rules are transferred to the memory module from the editor via the interface. This helps in speedy editing of the rules through editor, as only few inputs are required to be placed on template to build the rule.
The above-mentioned and other features of the invention will now be addressed with reference to the drawing of a preferred embodiment of the present system for processing an edited part. The illustrated embodiment of the hearing aid device is intended to illustrate, but not limit the invention. The drawings contain the following figures, in which like numbers refers to like parts, throughout the description and drawing.
FIG 1 illustrates a schematic diagram of system for
processing an edited part of a piece of code while the piece of code is being edited to confirm a design intent is being followed by the edited part of the piece of code.
FIG 1 shows a schematic diagram of a system 1 for processing an edited part 5 of a piece of code 13 while the piece of code 13 is being edited, wherein a memory module 3 and a validator processor 2 cooperate together to confirm a design intent is being followed by the edited part 5 of the piece of code 13.
The memory module 3 stores design rules 4 and sends a set of the design rules 4 to the validator processor 2 for being processed by the validator processor 2. In the system 1, a hard disk of a general purpose computing system is adapted to include the memory module 3. Alternatively, the memory module 3 can be externally provided in a USB Drive, magnetic tape, Compact Disk, or any other memory device adapted to include the memory module 3. The validator processor 2 receives the set of the design rules 4 from the memory module 3 and the edited part 5 the piece of code 13 from an interface 6, processes the edited part 5 of the piece of code 13 on a basis of the set of design rules 4 and provides an output 7 relating to
conformance of the design intent being followed by the edited part 5 of the piece of code 13. In the system 1, the
validator processor 2 is included in the computing system which includes the hard disk having the memory module 3.
Alternatively, the validator processor 2 can be externally connected to the general purpose computing system including the hard disk having the memory module 3. Yet alternatively, the memory module 3 can be included in any external memory device like compact disk, USB Drive, etc and can be directly connected to the validator processor 2 for transferring the set of design rules 4 to the validator processor 2.
In an alternate embodiment, the validator processor 2
processes the edited part 5 of the piece of code 13 to generate a meta model for the edited part 5 the piece of code 13. The validator processor 2 receives the set of design rules 4 from the memory module 3, processes the meta model and the set of design rules 4 and provides an output relating to conformance of the design intent being followed by the edited part 5 of the piece of code 13. The meta model is a data structure to maintain design information extracted from the edited part 5 of the piece of code 13, like classes, their interactions and relations.
Yet alternatively, the validator processor 2 processes the edited part 5 of the piece of code 13 to generate an abstract syntax tree for the edited part 5 of the piece of code 13, which is further processed to generate the meta model for the edited part 5 of the piece of code 13. The abstract suntax tree is a tree representation of abstract syntactic structure of the edited piece of code written in particular programming language. Each node of the tree denotes a construct occurring in the edited part 5 the piece of code 13.
The design rules 4 are rules defining design intent like does the piece of code really do what the developer want the piece of code to do?, is the developer using a particular interface in the way an architect of the piece of code envisaged?, etc, for developing the edited part 5 of the piece of code 13. Alternatively the design rules 4 can also point out the design defects which were not intended, like such as
xAbstract class not defined' , xDangling class' , xMissing class reference', etc. to point out design defects. The set of design rules 4 are a selection of design rules 4 from the memory module 3 which are relevant for processing the edited part 5 of the piece of code 13.
The system 1 further includes an edited part processor 8 which receives receive the edited part 5 of the piece of code 13 from the interface 6 and adapted to transfer the edited part 5 of the piece of code 13 to the validator processor 12 in a interval while the piece of code 13 is being edited. The interval can be determined on a basis of time metrics, line of code metrics determining size of the piece of code, logical structure according to software design of the piece of code, or combination thereof. Alternatively, the interval can be determined randomly by a programmer using the system
1. In an alternate embodiment, the edited part processor 8 is not used; rather the edited part 5 of the piece of code 13 is directly received by the validator processor 2 from the interface 6 in real time as the piece of code 13 is being edited. In yet alternate embodiment, the edited part
processor 8 is not used; rather the interface 6 is adapted to provide the edited part 5 of the piece of code 13 directly to the validator processor 2 in the desired interval. The system 1 includes a configuration module 9 to configure the edited part processor 8 for setting intervals desired by the programmer. In an alternate embodiment, the configuration module 9 is not used; rather the system 1 sets the interval to any one particular aspect like time, line of code metric, etc and let the system 1 run over just that aspect. In yet alternate embodiment, the configuration module 9 is provided with a user control which allows changing the interval while the piece of code 13 is being edited. The validator processor 2 is also adapted to provide a usage instance information 10 regarding the design rules 4 being used by the edited part 5 of the piece of code 13 by
processing the piece of code 13 and the set of design rules 4. The usage instance information 10 indicates in the piece of code 13, where the design rules 4 are applied, or usage instance of design rules occur. Therefore, groups of
statements in the piece of code 13 using program entities (such as classes) with respect to a specified design rule is the usage instance of that specified design rule 4.
Alternatively, the validator processor 2 need not process the piece of code 13 and the set of design rules 4 to provide the usage instance information 10; rather the user of the system 1 manually identifies the usage instance information 10 by co-relating the piece of code 13 with the set of design rules 4.
The edited part processor 8 matches the usage instance information 10 and the edited part 5 of the piece of code 13 and adapted to provide the edited part 5 of the piece of code 13, if the usage information matches to the edited part 5 of the piece of code 13. Alternatively, the edited part
processor 8 need not match the usage information 10 with the edited part 5 of the piece of code 13; rather every edited part 5 of the piece of code 13 is provided to the validator processor 2 for conformance of the violations of design intents . A graphical rule editor 11 is also included into the system 1 to edit the set of design rules 4 such that the design rules 4 are transferred to the memory module 3 from the editor 11 by using the validator processor 2. Alternatively, the rule editor 11 need not be used; rather the design rules 4 are ready-made available in the memory module 3 from a vendor to be used in the system 1. A language is provided for writing the set of design rules 4 which can be understood by the validator processor 2 for processing the edited part 5 of the piece of code 13 and the set of design rules 4. The language provides a set of
constructs for a designer to specify design rules 4. The notations are as follows:
• [] indicates optional
• { } indicates a list
• <> indicates a set of words to understand the meaning of the placeholder. <> will not appear while describing rules .
• / indicates xor'
• Bold face word represent the name of the construct (for example: relation/count etc.)
The specification language provides various constructs to enable designers to specify the design intents for many patterns (such as Abstract Factory, Factory Method,
Prototype, Observer, Object pool, Singleton, Facade and
Mediator, etc) .
Example of one of the construct xRelation' is as follows: The xRelation' construct specifies relationship constraints on participating entities or classes in the design rule 4. The constraints specify allowed type of relationship, scope, constraint among class entities. The construct can be written in the specification language as follows:
Relation between SourceClassList= { <Source_class_list> } and UserClassList= { <User_class_list> } where
[ SourceClassScope="<Source_class_scope>" ] ,
[UserClassScope="<User_class_scope>" ] ,
[Relationship="<Relationship>" ] , Constraint="<Constraint>" Wherein Source_class_list and User_class_list represent
Source classes and user classes are participating entities of an instance of design pattern or design rule 4 that follows user-source relation. The user-source relation is as follows: If class X is associated (by any relation such as association, aggregation, composition, create) with class Y and using services provided by class Y or referring to an instance of Y, then class X is a user class and class Y is a source class.
Wherein Source_class_scope /User_class_scope defines scope for specified source/user classes. It can take one of the following values:
• Class - A class can (or cannot) have a certain
relation with another specified class.
• Inheritance_Tree - An inheritance tree with a
specified class as the base can (or cannot) have a certain relation with another specified
class/inheritance tree.
• Inheritance_Tree_But_Specified_Class - An inheritance tree with a specified class as the base but not including the base can (or cannot, ) have a certain relation with another specified class/inheritance tree .
Wherein Relationship specifies relationship between source and the user classes. It may take one of the following values: Association', Aggregation', 'composition' and 'create' . 'Association' is the default relation.
Wherein Constraint specifies constraints on relationship between source classes and user classes. Consider as an example that Resource type objects can only be created by ResourcePool . When class Resource is used in a context wherein the relationship is "create an object (of type
Resource)", then the user class can only be ResourcePool and no other class. Constraint can take one of the following values :
• Only: Specified source classes are available to only user classes specified in the rule, in the conext of the specified relationship. • No: Specified source classes are not available to user classes specified in the rule, in the context of the specified relationship. The graphical rule editor 11 further includes a suggestion module 12 to provide a part of the set of design rules 4 as suggestion to be included into the set of design rules 4 while writing the set of design rules 4. When the user of the system 1 is editing the design rules 4, such suggestions of part of design rules 4 fastens the process of editing, as the user can just move ahead by accepting the suggested part of the set of design rule 4 and than edit the remaining part of the set of design rules 4 accordingly. The suggested part of design rules 4 pops up on a screen of the editor 11 when the user is editing the design rules 4 and the user can press
"Enter" key or left click over the suggested part of the set of design rules 4 to include the suggested part in the set of design rules 4. Alternatively, the design rule 4 can be suggested by taking user control to a separate screen from an editing panel to review the suggested part of the design rule 4 and accepting the suggested part of the design rule 4. Yet alternatively, the part of set of design rules 4 can be suggested in any other user friendly way, so that user can fast and efficiently review the part of the design rules 4 and include the suggested part.
The suggestion module 12 receives the piece of code 13 and processes the piece of code 13 to provide the part of the set of design rules 4 as suggestion. Alternatively, the
suggestion module 12 can be plug-in available through a vendor to be plugged into the graphical rule editor 11, such that the suggestion module 12 has its own database of
suggestion which is independent to the piece of code 13, developed on a basis of general requirements for the design rules 4 generally required during development of software or the software with respect to any particular functional application like healthcare, energy, etc. or logical usage counting, reporting, etc. The suggestion module 12 includes a rule template database 14 having a rule template to be displayed on the graphical rule editor 11, wherein the rule template is edited on the
graphical editor 11 to produce the set of deign rules 4, such that the design rules 4 are transferred to the memory module 3 after being edited. These rule templates can be developed by the user manually on a basis of general consideration of the requirements of design rules 4 for a particular piece of code 13 or can be automatically generated by the rule editor 11 while editing the set of design rules 4 or can be made available by an independent vendor who may have developed the rule template database 14 on the general consideration of design rules 4 by any piece of code 13 or piece of code 13 with respect to any particular functional application like healthcare, energy, etc. or logical usage counting,
reporting, etc.
In an alternate embodiment, the rule editor 11 is configured to check the consistency of edited design rules with the design rules 4 already existing in the memory module 3.
An exemplary implementation of the system 1 using Object Pool' design pattern as design rule 4, wherein Object Pool' pattern are used for utilizing resources optimally. It manages the reuse of those objects which are costly to instantiate or only a limited number of such objects can be created. Whenever client asks for a reusable resource; the 'ResourcePool ' searches for an available 'Resource' object. If the search is successful, the object is returned to client. If the search was unsuccessful then 'ResourcePool ' tries to create a new 'Resource' object and return it. The action succeeds, if number of already created 'Resource' objects is under a specified limit. If the action fails, then the client has to wait till any one Resource object is available . The intent behind the pattern is to instantiate 'Resource' objects once and use them multiple times. The pool object has the responsibility to instantiate the 'Resource' objects and provides them to the client on demand. Hence it can be inferred that only 'ResourcePool' object has the
responsibility to instantiate 'Resource' objects. This intent can be expressed in terms of design rule (4), as follows:
Relation between SourceClassList= { <Resource> } and
UserClassList= { <ResourcePool> } where Relationship="create", Constraint="only"
The above given design rule 4 states that 'Resource' can only be created by 'ResourcePool ' object. A concrete example is considered below for the object pool pattern. The above design rule is shown below for the relation between classes 'Connectionlmpl ' and 'ConnectionPool ' :
Relation between SourceClassList= { Connectionlmpl } and
UserClassList= { ConnectionPool } where Relationship="create", Constraint="only"
In this section, the design rule 4 for 'ResourcePool'
(ConnectionPool) pattern is specified. It is possible to specify the design rule 4 that client creates objects of type Resource (Connectionlmpl) only through 'Resourcepool '
(ConnectionPool) . However, the design rule 4 needs to be specified for different clients making use of
'ConnectionPool' (ResourcePool) . A single design rule 4 can be specified independent of the client. Here, the design rule 4 is specified that in the context of creating an object of type 'Connectionlmpl' (Resource) , only class 'ConnectionPool' (ResourcePool) can create objects of type 'Connectionlmpl' (Resource) . Hence, 'ConnectionPool' (ResourcePool) assumes the role of a user Class and 'Connectionlmpl' (Resource) that of a source Class. The design violation present in the piece of code 13 will be detected by the system 1.

Claims

Patent Claims
A system (1) for processing an edited part (5) of a piece of code (13) while the piece of code (13) is being edited to confirm a design intent is being followed by the edited part (5) of the piece of code (13), the system (1) comprising:
a memory module (3) configured to store a design rule
(4) , wherein the design rule (4) defines the design intent for developing the edited part (5) of the piece of code (13) ,
a validator processor (2) for receiving the set of design rules (4) from the memory module (3) and the edited part (5) of piece of code (13) from an interface (6), processing the edited part (5) of the piece of code (13) on a basis of the set of design rules (4) and providing an output (7) relating to conformance of the design intent being followed by the edited part (5) of the piece of code (13) .
The system (1) according to claim 1, comprising:
a edited part processor (8) adapted to receive the edited part (5) of the piece of code (13) from the interface (6) and adapted to transfer the edited part
(5) of the piece of code (13) to the validator processor (2) in a interval while the piece of code (13) is being edited .
The system (1) according to claim 2, comprising:
a configuration module (9) adapted to configure the edited part processor (8) for determining the interval on a basis of time metrics, line of code metrics determining size of the piece of code (13), logical structure according to software design of the piece of code (13), or combination thereof.
4. The system (1) according to claim 1, wherein the
validator processor (2) is adapted to receive the piece of code (13) and the set of design rules (4), to process the piece of code (13) and the set of design rules (4) to provide a usage instance information (10) regarding the design rules (4) being used by the edited part (5) of the piece of code (13), wherein the usage instance information (10) defines usage of the piece of code (13) by the set of design rules (4) .
The system (1) according to claim 2, wherein the edited part processor (8) is further adapted to match the usage instance information (10) and the edited part (5) of the piece of code (13) and adapted to provide the edited part (5) of the piece of code (13), if the usage information (10) matches to the edited part (5) of the piece of code (13) .
A system (1) according to claim 1, further comprising: a graphical rule editor (11) for editing the set of design rules (4), such that the design rules (4) are transferred to the memory module (3) from the editor (11) by the validator processor (2) .
A system (1) according to claim 6, wherein the
graphical rule editor (11) comprising a suggestion module (12) to provide a part of the set of design rules (4) as suggestion to be included into the set of design rules (4) while writing the set of design rules (4) .
A system (1) according to claim 7, wherein the
suggestion module (12) is adapted to receive the piece of code (13) and to process the piece of code (13) to provide the part of the set of design rules (4) as suggestion to be included into the set of design rules (4) while writing the set of design rules (4) .
9. A system according (1) to any of the claims 6 to 8, the graphical rule editor (11) comprising a rule template database (14) having a rule template to be displayed on the graphical rule editor (11), wherein the rule template is edited on the graphical editor (11) to produce the set of deign rules (4), such that the design rules (4) are transferred to the memory module
(3) from the editor (11) .
10. A graphical rule editor (11) for editing a set of
design rules (4) which defines design intents for developing an edited part (5) of a piece of code (13) and for sending the design rules (4) after processing to a memory module (3) , wherein the set of design rules
(4) from the memory module (3) along with the edited part (5) of the piece of code (13) via an interface (6) are adapted to be received by a validator processor (2) while the piece of code (13) is being edited for processing the edited part (5) of the piece of code (13) on a basis of the set of design rules (4) and providing an output (7) to conformance of the design intent being followed by the edited part (5) of the piece of code (13) .
11. The graphical rule editor (11) according to the claim 7 comprising a suggestion module (12) to provide a part of the set of design rules (4) as suggestion to be included into the set of design rules (4) while editing the set of design rules (4) .
12. The graphical rule editor (11) according to the claim 8, wherein the suggestion module (12) is adapted to receive the piece of code (13) and to process the piece of code (13) to provide a part of the set of design rules (4) as suggestion to be included into the set of design rules (4) while writing the set of design rules (4) .
13. The graphical rule editor (11) according to claim 9 comprising a rule template database (14) having a rule template to be displayed on the graphical rule editor (11), wherein the rule template is edited on the graphical editor (11) to produce the set of deign rules (4), such that the design rules (4) are transferred to the memory module (3) after being produced.
14. A method for processing an edited part (5) of a piece of code (13) while the piece of code (13) is being edited to confirm a design intent is being followed by the edited part (5) of the piece of code (13), the method comprising:
- receiving a set of design rules (4) from a memory module (3) and the edited part (5) of the piece of code (13) via an interface (6) by a validator processor (2), wherein the set of design rules (4) are adapted to define design intents for developing the edited part (5) of the piece of code (13),
- processing the edited part (5) of the piece of code (13) on a basis of the set of design rules (4) by the
validator processor (2), and
- providing an output (7) relating to conformance of the design intent being followed by the edited part (5) of the piece of code (13) .
PCT/EP2012/058867 2011-06-16 2012-05-14 A system and a method for processing an edited part of a piece of code, and a graphical rule editor WO2012171735A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
IN821KO2011 2011-06-16
IN821/KOL/2011 2011-06-16

Publications (1)

Publication Number Publication Date
WO2012171735A1 true WO2012171735A1 (en) 2012-12-20

Family

ID=46125429

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2012/058867 WO2012171735A1 (en) 2011-06-16 2012-05-14 A system and a method for processing an edited part of a piece of code, and a graphical rule editor

Country Status (1)

Country Link
WO (1) WO2012171735A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6367068B1 (en) * 1998-11-13 2002-04-02 Microsoft Corporation Dynamic parsing
US20090288073A1 (en) * 2008-05-13 2009-11-19 Gosalia Rishi H Edit Time Analyzer in a Loosely Typed Textual Language
US20110088019A1 (en) * 2009-10-12 2011-04-14 Jedlicka David C Asynchronous Preemptive Edit Time Semantic Analysis of a Graphical Program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6367068B1 (en) * 1998-11-13 2002-04-02 Microsoft Corporation Dynamic parsing
US20090288073A1 (en) * 2008-05-13 2009-11-19 Gosalia Rishi H Edit Time Analyzer in a Loosely Typed Textual Language
US20110088019A1 (en) * 2009-10-12 2011-04-14 Jedlicka David C Asynchronous Preemptive Edit Time Semantic Analysis of a Graphical Program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DAQUING HOU: "Using SCL to Specify and Check Design Intent in Source Code", IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, vol. 32, no. 6, June 2006 (2006-06-01)

Similar Documents

Publication Publication Date Title
US9519884B2 (en) Data driven dynamic workflow
CN102810057B (en) A kind of method of log
DeAntoni et al. Timesquare: Treat your models with logical time
US8387014B2 (en) Synchronization of concurrently modified interdependent semi-derived artifacts
CN109542556B (en) Method and system for interaction between process and form based on Activiti
CN103718155A (en) Runtime system
JP2012221380A (en) Automatic program generation device, method and computer program
US11630647B2 (en) Method and system for configuring processes of software applications using activity fragments
CN102541561B (en) Method for developing configuration type software and device
CN111104103A (en) Visualization method and system for software editing microservice
US20200242559A1 (en) Dynamically controlling case model structure using case fragments
CN111782201A (en) Method and device for realizing linkage of service codes and layout topological graph
CN1619565A (en) Active agenda
CN110941422B (en) Code automatic generation method, code generator and readable storage medium
JP2008225898A (en) Conversion device, conversion program, and conversion method
CN112036142A (en) Real-time report generation method and system based on data configuration
US20160253606A1 (en) Business Process Crowd Sourcing with Dynamic Group Discovery and Social Push Communications
CN110908644A (en) Configuration method and device of state node, computer equipment and storage medium
CN112130849B (en) Code automatic generation method and device
WO2012171735A1 (en) A system and a method for processing an edited part of a piece of code, and a graphical rule editor
JP2023553220A (en) Process mining for multi-instance processes
JP2008287365A (en) Program generation device, program generation method, program, and recording medium
CN109871212B (en) Method, device and equipment for processing special topic page and storage medium
Woods et al. The system context architectural viewpoint
CN117492721B (en) General rapid development method applied to building digital information system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12722115

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12722115

Country of ref document: EP

Kind code of ref document: A1