AUTOMATED MERGING IN A SOFTWARE DEVELOPMENT ENVIRONMENT
A system and method for selectively operating on changed elements, for example merging, in a software development environment are provided. A software project comprising one or more version-controlled software development objects, or elements, is associated with one or more defects recording changed elements in the software development environment. The system and method provide for automated merging of changed elements associated with defects tagged for forward merging into the software project, and association or tracking actions for changed elements associated with defects that are tagged as not to be merged. The process of automated merging is carried out using a master work list listing work items representing changed elements ordered chronologically.
Latest IBM Patents:
This invention relates generally to managing changed elements in a software development environment, and in particular to automated systems for merging changed elements in a project within a software development environment.
DESCRIPTION OF THE RELATED ARTSoftware configuration management (SCM) systems allow users to manage multiple variants of the various objects or elements of software systems, and in particular may be configured to allow development teams to work in parallel in writing, modifying, porting, and upgrading software system elements while providing management or auditing tools for monitoring the changes made to the elements, and building software products from a plurality of elements. For example, the SCM may provide a check-out-edit-check-in model, in which an individual programmer may “check out” an element from a data repository, creating a local editable copy of the element, edit the element, then “check in” the element again in order to integrate the changes made with the data repository. The newly-changed element is stored as a new version of the element, and auditing features of the SCM may record information regarding the changes made. The SCM system may provide for the merging of a changed software element with other versions of the same base element to produce a new version of the element, sometimes referred to as “forward fitting”, as well as means to record information about the merge for future reference. The foregoing features may be provided in a single SCM product, or alternatively may be provided by software products that separately provide for configuration management and tracking defects and changes made to the elements stored in the data repository.
Each time a change to an element is made, it may be individually and manually merged into a new version of the element by the programmer who made the change. However, the scope of software development may encompass a number of programmers, hundreds or thousands of software elements, and hundreds or thousands of changes to elements; it is therefore undesirable to require that each and every change be manually merged. While the SCM system may provide for automated merging of all outstanding changes made to an element, a single element may be used in a number of different concurrent software projects; changes made to one version of an element for a first software project may not be required for a second software project.
It is therefore desirable to provide a system and method in which changes to an element may be selectively merged forward. It is further desirable to provide a system and method in which the merging of source code element changes is automated. It is also desirable to provide these features in a SCM system or other software development environment for managing multiple software projects sharing elements.
SUMMARY OF THE INVENTIONIn accordance with a preferred embodiment, a method for selectively operating on changed elements in a software development environment is provided, the software development environment comprising a set of at least one defect associated with a software project, the software project comprising a plurality of version-controlled software development objects, each defect being associated with at least one changed element, each changed element comprising a modified version-controlled software development object, wherein the method comprises generating, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation; generating a master work list comprising the said work items chronologically ordered; and for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, executing all work items associated with the unique element in chronological order.
A further embodiment provides a computer program product comprising a computer usable medium embodying a computer readable program, wherein the computer readable program when executed on a computer providing a software development environment comprising a set of at least one defect associated with a software project wherein the software project comprises a plurality of version-controlled software development objects, each defect being associated with at least one changed element, and each changed element comprising a modified version-controlled software development object, causes the computer to generate, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation; generate a master work list comprising the said work items chronologically ordered; and for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, execute all work items associated with the unique element in chronological order.
Still a further embodiment provides a system for selectively operating on changed elements, comprising a data repository for storing version-controlled software development objects associated with a software project, and for storing at least one changed element comprising a modified version-controlled software development object; and a software development environment interoperable with the data repository for recording defects associated with a software project, for tracking changed elements, and for merging changed elements with a corresponding version-controlled software development object, wherein the software development environment is configured to generate, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation; generate a master work list comprising the said work items chronologically ordered; and for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, execute all work items associated with the unique element in chronological order, wherein the operation for each of the changed elements is selected from merging the changed element at the target and associating the changed element with the target, the target comprising a target version-controlled software development object.
In drawings which illustrate by way of example only a preferred embodiment of the invention,
The following embodiments are described in the context of a software development environment (SDE), which may be provided in, or as part of, a software configuration management system (SCM), or in conjunction with other software management tools for tracking, managing, or auditing projects created and edited in the SDE. In a first embodiment, a data repository is provided. The data repository may be secure or permanent, and may by globally accessed at a central repository. The data repository may alternatively be provided in a distributed environment. The implementation of such a data repository will be understood by those skilled in the art.
The SDE may operate as a configuration management product, providing for version control of various files and projects stored in the data repository. A single software project may comprise a plurality of software development objects of different types, such as text files, graphics, directories, hyperlinks, and the like. These objects, hereinafter referred to as elements, are stored in the data repository. Changes to the elements may be stored as separate files (i.e., complete copies of the changed elements), or as deltas or weaves, which in a single stored instance of the element records the differences or changes for each version of the element, and the SDE may track changes made to various versions of a given element; thus, the data repository may store a plurality of version-controlled software development objects or elements. Elements may also be stored in compressed file formats. Techniques for the recording of element changes and file compression will be known to those of ordinary skill in the art. The project may further comprise derived objects, such as executable program files compiled from source code material. These derived objects in turn may also be versioned, for example generated for each corresponding version of the element from which the derived object was generated.
Referring to
The example of
In the exemplary SDE, provision is made for automatically managing changes made to the various elements by merging changes to the elements forward into a new version, by combining the contents of two or more elements into a single new element. Changed elements may be merged from one subbranch to another subbranch, from one subbranch to the main branch, or from a main branch to a subbranch of the element history. In the example of
The act of merging may be accomplished automatically by the SDE, for example by means of a script or other function built into the SDE. The merge function may be invoked by a command line interface, through a graphical user interface, or other means, and may also be accomplished manually by the user, if desired. If the SDE provides a graphical user interface to illustrate the relationship among the changes to the elements, such as the graphical representation of
However, in some circumstances it may not be desirable to merge forward all outstanding changes to an element. Turning to
If the SDE provides for automatic merging of all outstanding changed elements into new versions of the elements, as mentioned above, executing the automated merge function will result in a merging of all changed elements that were not previously annotated as having been merged. This is inconvenient, as the user will then have to manually reverse any merges that were not intended to be executed, thus increasing development time. Alternatively, if a changed element was intended to be merged into a new release of a first project, but not into a new release of a second project in which the element is used, the automated merging of the changed element into the second project may be avoided by creating an independently stored copy of this element; however, this will increase record-keeping overhead in the SDE overall, as the additional elements are created. Further, by creating independent copies of elements for use in other projects, the history of changes to the original element may be lost in the creation of the independent copies, thus requiring the programmer to keep track of multiple stored versions of the same element.
Accordingly, in this embodiment, a method is provided to allow for the automated merging of only selected changed elements. With reference to
Examples of partial records of defects are shown in
Returning to
When selected changed elements are to be merged, the method illustrated in
Next, the SDE generates a list of defects that need to be merged at 210, and a list of defects not to be merged at 205, based on the outcome of queries of the defect database. These lists may comprise a list of defect indicia. In the example of
From each of the foregoing lists, the SDE then creates a list of element versions that are to be merged at block 220 of
For each changed element to be merged, the SDE then obtains any accompanying comments provided by the programmer and stored in association with the changed element at block 230 of
After the work items are created, the SDE then combines the work items from blocks 225 and 235 of
Turning to
At block 260 of
If the SDE determines at block 250 that the revised master sorted work list 400a still contains work items, then blocks 255, 260, and 265 are repeated for the next unique element in the revised master sorted work list 400a. In the revised master sorted work list 400a, there remain three unique element entries (elements5, 2, and 3); thus, the second sorted work list 410b, as depicted in
It will be appreciated by those skilled in the art that the precise methodology of generating the n work lists may not require the explicit creation of revised master work lists. For example, a process may be executed by which each of the n work lists 410a, 410b, 410c, etc. is generated by scanning the contents of the master sorted work list 400, and selecting or pointing to elements from the master sorted work list 400, without generating or storing revised versions of the master sorted work list 400 itself. In that case, the flowchart branch 255-260-265 may terminate when the SDE determines that the end of the master sorted work list 400 has been reached.
After the SDE determines that no further work items are to be placed in one of the n work lists at 250, the process continues at block 270 of
Next, the counter m is incremented at block 285, and the SDE determines at block 290 whether there are any further work lists to be executed. If there are further work lists, then the process of blocks 275-280-285-290 is repeated until the SDE determines that there are no further work lists at block 290, at which point the process terminates. The incremented counter m is provided so that the work lists 410a, 410b, etc. are executed in chronological order; other means for repeating blocks 275, 280 and 290 may be implemented in this process such that the work lists are executed in chronological order. In this manner, the SDE attempts the merge or tracking of a first version of each element in the sorted work list, before moving on to attempt the merge or tracking of a subsequent version of the same element in a subsequent sorted work list. By implementing the individual sorted work lists described above, a form of “batch” processing of merge and track item tasks is accomplished, and the risk of conflict arising between two instructions within a single sorted work list is minimized since each instruction within the sorted work list relates to a unique element.
The defects that were handled during the processes of
The data stored in association with the various changed elements—the merge data or other documentation, comments, identity of the programmer or team responsible for the changed element or defect, and so forth—may be stored as metadata associated with the changed element. The SDE may comprise elements to provide all functionality described above in a single, integrated product, or alternatively aspects of the SDE described above may be provided in a plurality of software development, defect tracking, and management tools. Referring to
The systems and methods disclosed herein are presented only by way of example and are not meant to limit the scope of the invention. Other variations and modifications of the systems and methods described above will be apparent to those skilled in the art and as such are considered to be within the scope of the invention, which includes all such variations and modifications as fall within the scope of the appended claims. For example, it should be understood that acts and the order of the acts in the processing described herein may be altered, modified and/or augmented, or that said acts may be carried out by software and/or hardware modules designed for such purpose, and still achieve the desired outcome.
The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc. Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The systems' and methods' data may be stored in one or more media. The media can be comprised in many different types of storage devices and programming constructs, such as RAM, ROM, Flash memory, programming data structures, programming variables, etc. It is noted that data structures describe formats for use in organizing and storing data in databases, programs, memory, or other computer-readable media for use by a computer program. Media can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disc-read only memory (CDROM), compact disc-read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution. In a data processing system, the components, software modules, functions and data structures described herein may be connected directly or indirectly to each other in order to allow the flow of data needed for their operations. It is also noted that a module or processor includes but is not limited to a unit of code that performs a software operation, and can be implemented for example as a subroutine unit of code, or as a software function unit of code, or as an object (as in an object-oriented paradigm), or as an applet, or in a computer script language, or as another type of computer code.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
Various embodiments of the present invention having been thus described in detail by way of example, it will be apparent to those skilled in the art that variations and modifications may be made without departing from the invention. The invention includes all such variations and modifications as fall within the scope of the appended claims.
Claims
1. A method for selectively operating on changed elements in a software development environment, the software development environment comprising a set of at least one defect associated with a software project, the software project comprising a plurality of version-controlled software development objects, each defect being associated with at least one changed element, each changed element comprising a modified version-controlled software development object, the method comprising:
- generating, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation;
- generating a master work list comprising the said work items chronologically ordered; and
- for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, executing all work items associated with the unique element in chronological order.
2. The method of claim 1, wherein the operation for each of the changed elements is selected from merging the changed element at the target and associating the changed element with the target, the target comprising a target version-controlled software development object.
3. The method of claim 2, wherein merging the changed element at the target comprises incorporating modifications to the version-controlled software development object comprised in the changed element with another version of the version-controlled software development object at the target.
4. The method of claim 3, wherein merging further comprises storing metadata indicating a merge relationship between the changed element and the target.
5. The method of claim 2, wherein associating the changed element with the target comprises storing metadata associating the changed element with the target.
6. The method of claim 2, wherein executing all work items associated with the unique element in chronological order for each unique version-controlled software development object comprises:
- generating, from the master work list, a sorted work list comprising work items associated with the unique version-controlled software development object, wherein the work items in the first sorted work list are chronologically ordered, and
- generating a revised master work list comprising the differences between the master work list and the sorted work list, such that the generating of a sorted work list and the generating of a revised master work list is repeated for each unique version-controlled software development object, until the revised master work list does not contain any further work items; and
- executing each sorted work list in chronological order by executing each work item comprised in the sorted work list, until all sorted work lists have been executed.
7. The method of claim 1, wherein the at least one changed element is of a type selected from a file and a directory.
8. The method of claim 1, wherein the master work list is ordered by type and ordered chronologically.
9. The method of claim 2, wherein generating a work item for each of the changed elements in the software project comprises:
- generating a list of defects to be incorporated into the software project from the set of at least one defect;
- generating, from said list of defects to be incorporated, a list of changed elements to be merged with a target in the software project;
- generating a list of defects not to be incorporated into the software project from the set of at least one defect;
- generating, from said list of defects comprising changed elements not to be incorporated, a list of changed elements not to be merged;
- generating, from the list of changed elements to be merged into a target, a work item for each of the said listed changed elements to be merged comprising an identifier for the changed element, a merging operation identifier, and a target identifier; and
- generating, from the list of defects not to be merged, a work item for each of the said listed changed elements not to be merged comprising an identifier for the changed element, an associating operation identifier, and a target identifier.
10. The method of claim 9, further comprising storing, in relation to a defect, an indicator indicating whether the defect is or is not to be incorporated into a software project.
11. The method of claim 9, wherein generating a work item for each of the said listed changed elements to be merged further comprises retrieving a comment for association with the target.
12. A computer program product comprising a computer usable medium embodying a computer readable program, wherein the computer readable program when executed on a computer providing a software development environment comprising a set of at least one defect associated with a software project wherein the software project comprises a plurality of version-controlled software development objects, each defect being associated with at least one changed element, and each changed element comprising a modified version-controlled software development object, causes the computer to:
- generate, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation;
- generate a master work list comprising the said work items chronologically ordered; and
- for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, execute all work items associated with the unique element in chronological order.
13. The computer program product of claim 12, wherein the operation for each of the changed elements is selected from merging the changed element at the target and associating the changed element with the target, the target comprising a target version-controlled software development object.
14. The computer program product of claim 13, wherein when the computer readable program causes the computer to execute all work items associated with the unique element in chronological order for each unique version-controlled software development object, the computer readable program causes the computer to:
- generate, from the master work list, a sorted work list comprising work items associated with the unique version-controlled software development object, wherein the work items in the first sorted work list are chronologically ordered, and
- generate a revised master work list comprising the differences between the master work list and the sorted work list,
- repeat the generation of the sorted work list and the revised master work list for each unique version-controlled software development object, until the revised master work list does not contain any further work items; and
- execute each sorted work list in chronological order by executing each work item comprised in the sorted work list, until all sorted work lists have been executed.
15. The computer program product of claim 14, wherein when the computer readable program causes the computer to generate a work item comprising an identifier of the changed element for each of the changed elements in the software project, the computer readable program causes the computer to:
- generate a list of defects to be incorporated into the software project from the set of at least one defect;
- generate, from said list of defects to be incorporated, a list of changed elements to be merged with a target, the changed elements being associated with the defects thus listed;
- generate, from the set of at least one defect associated with the software project, a list of defects not to be incorporated into the software project;
- generate, from said list of defects not to be incorporated, a list of changed elements not to be merged, the changed elements being associated with the defects thus listed;
- generate, from the list of changed elements to be merged, a work item for each of the changed elements to be merged comprising an identifier for the changed element, a merging operation identifier, and a target identifier; and
- generate, from the list of changed elements not to be merged, a work item for each of the changed elements not to be merged comprising an identifier for the changed element, an associating operation identifier, and a target identifier.
16. The computer program product of claim 15, wherein merging comprises storing metadata indicating a merge relationship between the changed element and the target, and associating the changed element with the target comprises storing metadata associating the changed element with the target.
17. The computer program product of claim 16, wherein each of the changed elements is of a type selected from a file and a directory, and wherein the master work list is ordered by type and chronologically.
18. A system for selectively operating on changed elements, comprising:
- a data repository for storing version-controlled software development objects associated with a software project, and for storing at least one changed element comprising a modified version-controlled software development object; and
- a software development environment interoperable with the data repository for recording defects associated with a software project, for tracking changed elements, and for merging changed elements with a corresponding version-controlled software development object;
- wherein the software development environment is configured to: generate, for each of the changed elements in the software project, a work item comprising an identifier of the changed element, an operation for the changed element, and a target for said operation; generate a master work list comprising the said work items chronologically ordered; and for each unique version-controlled software development object associated with the changed elements of each work item in the master work list, execute all work items associated with the unique element in chronological order, wherein the operation for each of the changed elements is selected from merging the changed element at the target and associating the changed element with the target, the target comprising a target version-controlled software development object.
19. The system of claim 18, wherein the software development environment is further configured to execute all work items associated with the unique element in chronological order for each unique version-controlled software development object by:
- generating, from the master work list, a sorted work list comprising work items associated with the unique version-controlled software development object, wherein the work items in the first sorted work list are chronologically ordered, and
- generating a revised master work list comprising the differences between the master work list and the sorted work list,
- repeating the generation of the sorted work list and the revised master work list for each unique version-controlled software development object, until the revised master work list does not contain any further work items; and
- executing each sorted work list in chronological order by executing each work item comprised in the sorted work list, until all sorted work lists have been executed.
20. The system of claim 19, wherein the software development environment is further configured to generate a work item comprising an identifier of the changed element for each of the changed elements in the software project by:
- generating a list of defects to be incorporated into the software project from the set of at least one defect;
- generating, from said list of defects to be incorporated, a list of changed elements to be merged with a target, the changed elements being associated with the defects thus listed;
- generating, from the set of at least one defect associated with the software project, a list of defects not to be incorporated into the software project;
- generating, from said list of defects not to be incorporated, a list of changed elements not to be merged, the changed elements being associated with the defects thus listed;
- generating, from the list of changed elements to be merged, a work item for each of the changed elements to be merged comprising an identifier for the changed element, a merging operation identifier, and a target identifier; and
- generating, from the list of changed elements not to be merged, a work item for each of the changed elements not to be merged comprising an identifier for the changed element, an associating operation identifier, and a target identifier.
Type: Application
Filed: Feb 19, 2008
Publication Date: Aug 20, 2009
Applicant: INTERNATIONAL BUSINESS MACHINES CORPORATION (Armonk, NY)
Inventor: David John Martineau (Stouffville)
Application Number: 12/033,609
International Classification: G06F 9/44 (20060101);