Distributed, non-intrusive code review in a development environment

Code review is performed by initiating a source code editing session associated with a first user, where the source code editing session is controlled by a computer-based source code editing tool that is configured to accept changes to source code of a computer-based software application during the source code editing session, displaying on a computer display, in the context of the source code editing session, a source code portion of the computer-based software application, and displaying on the computer display, in the context of the source code editing session, a visual indicator that is associated with the source code portion, and that indicates that the source code portion was added or modified by a second user.

BACKGROUND

1. Technical Field

The invention relates generally to computer-based systems and methods for reviewing computer software source code.

2. Discussion of the Related Art

Code review refers to the process of examining computer software source code, for example, in order to identify programming defects or security vulnerabilities. In many organizations, a computer-based source code control (SCC) system is used to keep track of changes made to source code during software development, and a code review tool that works within or otherwise with the SCC system is used to perform code review of the source code. Typical code review tools highlight recently added or modified source code, such as to indicate to a reviewer what source code requires review, and track the reviewed parts of the source code. Typical code review tools are designed for formal code review sessions that are conducted as a separate step in the software development life cycle.

BRIEF SUMMARY

An example embodiment of the invention comprises a method for code review, the method comprising initiating a source code editing session associated with a first user, where the source code editing session is controlled by a computer-based source code editing tool that is configured to accept changes to source code of a computer-based software application during the source code editing session, displaying on a computer display, in the context of the source code editing session, a source code portion of the computer-based software application, and displaying on the computer display, in the context of the source code editing session, a visual indicator that is associated with the source code portion, and that indicates that the source code portion was added or modified by a second user.

In another example embodiment of the invention, a method is provided for code review, the method comprising providing a source code portion of a computer-based software application to a set of users for editing in a plurality of source code editing sessions, providing a first review level indicator to each of the users in the set of users, where each first review level indicator indicates that the source code portion was added or modified by a first user and that the source code portion is at a first level of review, receiving a review event indicator from any of the users in the set of users, where the review event indicator indicates that a review event related to the source code portion has occurred, and providing a second review level indicator to each of the users in the set of users, where each second review level indicator indicates that the source code portion was added or modified by a first user and that the source code portion is at a second level of review that indicates a greater level of review than the first level of review.

Other example embodiments of the invention comprise systems and computer program products for implementing the methods described above.

The above and still further features and advantages of embodiments of the present invention will become apparent upon consideration of the following detailed description thereof, particularly when taken in conjunction with the accompanying drawings wherein like reference numerals in the various figures are utilized to designate like components.

DETAILED DESCRIPTION

The invention is now described within the context of one or more example embodiments, although the description is intended to be illustrative of the invention as a whole, and is not to be construed as limiting the invention to the example embodiments shown. It is appreciated that various modifications may occur to those skilled in the art that, while not specifically shown herein, are nevertheless within the true spirit and scope of the invention.

Reference is now made toFIG. 1, which is a simplified conceptual illustration of a code review system, constructed and operative in accordance with an example embodiment of the invention. In the system ofFIG. 1, an integrated coding and reviewing environment100is shown, where integrated coding and reviewing environment100includes a source code editing tool102and a code review tool104. Source code editing tool102is configured to initiate a source code editing session associated with a computer user, such as a user106. During the source code editing session, source code editing tool102displays one or more portions of source code of a computer-based software application on a computer display, such as of a computer108, and may accept changes to the source code, such as are made by user106. Source code editing tool102is configured to access or otherwise receive the source code, such as from a source code control system110, which may be any computer-based system that maintains a repository112of source code. Source code editing tool102is also configured to access or otherwise receive a review status associated with any portion of the source code, such as from source code control system110that maintains a database114of the review status of the source code in source code repository112.

In accordance with the invention, when any portion of the source code is added or modified, a review status associated with the added or modified source code portion is set to indicate that the source code portion requires review. The review status may indicate any review status information known in the art of code review, as well as any of the following information:the identity of the computer user or users who added or modified the source code portion, such as users116and118the time and/or date when the addition or modification occurredthe identities of other users who are to review the source code portiona level of review that the source code portion has undergone since the addition or modification occurred, such as using a predefined scale of review levels or using a predefined criteria to determine the review level. The review level may be maintained irrespective of who reviews the source code portion, and/or a different review level may be maintained for different reviewers.

Code review tool104is configured such that for any source code portion that is displayed by source code editing tool102on a computer display in the context of a source code editing session associated with a first computer user, code review tool104displays on the computer display a visual indicator associated with the displayed source code portion, where the source code portion has an associated review status that indicates that the source code portion was added or modified by one or more other computer users and requires review by the first user. Code review tool104is preferably configured to detect the occurrence of a review event associated with the source code portion. In certain example embodiments of the invention, the review event is the receipt of an input that is associated with the source code portion and that is of a predefined type that represents a review event. The input may, for example, be in the form of a mouse click on a displayed menu selection indicating that the first user has reviewed the source code portion, or may be in the form of a modification made by the first user to the source code portion, where changing the source code portion is considered tantamount to having reviewed the source code portion. In other example embodiments of the invention, the review event is considered to have occurred if the source code portion has been displayed for at least a predefined amount of time or on at least a predefined number of occasions or on at least a predefined number of days in the context of at least one source code editing session associated with the first user.

Code review tool104may be configured to cease to display the visual indicator after detecting the review event. Code review tool104may also be configured to display a different visual indicator after detecting the review event. For example, the different visual indicator may be one of a predefined sequence of indicators indicating increasing age of the added or modified source code portion and/or that a series of other review events has occurred, such as being of increasingly lighter shades and/or smaller sizes than the visual indicator that was displayed before the review event was detected, such as to indicate a lessening of the need to review the source code portion. In this way, a visual indicator may be replaced multiple times with visual indicators according to the predefined sequence after the occurrence of each review event in a series of review events associated with the source code portion.

In one example embodiment of the invention, code review tool104is configured as described hereinabove to display a visual indicator associated with a displayed source code portion in the context of a source code editing session associated with a first computer user, where the source code portion has an associated review status that indicates that the source code portion was added or modified by a second computer user. However, in this embodiment code review tool104is configured to display the visual indicator only if a predefined ranking exists indicating that the first user is senior to the second user.

In any of the example embodiments of the invention described herein, or in any combination thereof, code review tool104is preferably configured to provide an indication to source code control system110of a review event that was detected in the context of the source code editing session associated with a first user and in association with the source code portion that was added or modified by a second user.

Any of the elements shown inFIG. 1are preferably implemented by one or more computers, such as computer108, by implementing any of the elements shown inFIG. 1in computer hardware and/or in computer software embodied in a non-transient, computer-readable medium in accordance with conventional techniques.

Reference is now made toFIG. 2which is a simplified flowchart illustration of an example method of operation of the system ofFIG. 1, operative in accordance with an example embodiment of the invention. In the method ofFIG. 2, a source code editing session associated with a first computer user is initiated (step200). During the source code editing session, a portion of the source code of a computer-based software application is displayed on a computer display (step202), along with a visual indicator indicating that the source code portion was added or modified by one or more other computer users and requires review by the first user (step204). The occurrence of a review event associated with the source code portion is detected (step206). The display of the visual indicator is ceased after the review event is detected (step208). Steps204,206, and208may be repeated for the source code portion for a series of review events, where a different visual indicator is displayed after each review event. An indication may be provided to a source code control system that a review event was detected in the context of the source code editing session associated with the first user and in association with the source code portion (step210).

Reference is now made toFIG. 3, which is a simplified flowchart illustration of an example method of detecting a review event, operative in accordance with an example embodiment of the invention. In the method ofFIG. 3, an input is received that is associated with a source code portion requiring review (step300). If the input is of a predefined type that represents a review event (step302), such as in the form of a mouse click on a displayed menu selection indicating that the first user has reviewed the source code portion, or in the form of a modification made by the first user to the source code portion, where changing the source code portion is considered tantamount to having reviewed the source code portion, then a review event has been detected (step304).

Reference is now made toFIG. 4, which is a simplified flowchart illustration of an example alternative method of detecting a review event, operative in accordance with an example embodiment of the invention. In the method ofFIG. 4, if a source code portion requiring review has been displayed in the context of at least one source code editing session associated with a user on at least a predefined number of occasions (step400), or on at least a predefined number of days (step402), or for at least a predefined amount of time (step404), then a review event has been detected (step406). The method ofFIG. 4may be modified to require specific combinations of steps400,402, and404before a review event is considered to have occurred.

Reference is now made toFIG. 5, which is a simplified flowchart illustration of an example alternative method of operation of the system ofFIG. 1, operative in accordance with an example embodiment of the invention. In the method ofFIG. 5, a source code portion of a computer-based software application is provided to multiple users for editing in multiple source code editing sessions (step500), such as by source code control system110(FIG. 1). A first review level indicator is provided to each of the users, such as by source code control system110, where each first review level indicator provided to a recipient user indicates that the source code portion was added or modified by a first user and that the source code portion is at a first level of review (step502). A review event indicator is received from any of the users, such as from code review tool104, where the review event indicator indicates that a review event related to the source code portion has occurred (step504). A second review level indicator is provided to any of the users, such as by source code control system110, where each second review level indicator provided to a recipient user indicates that the source code portion was added or modified by a first user and that the source code portion is at a second level of review that indicates a greater level of review than the first level of review (step506). Review level indicators provided to a recipient user may indicate a level of review with respect to the recipient user only, or may indicate a consolidated level of review with respect to all of the multiple users.

In any of the example embodiments of the invention described herein, or in any combination thereof, the number of reviewers that reviewed any source code addition or modification may be tracked and reported. Source code file names may also be displayed in different colors depending on the number of review events they passed.

Reference is now made toFIG. 6, which is a simplified graphical user interface illustrating example features of the invention. InFIG. 6, a window600is shown in which visual indicators602and604are displayed to the left of corresponding portions of source code. A pop-up menu606is shown, having been activated by a mouse click on visual indicator604, where any of several review action may be selected.

Referring now toFIG. 7, block diagram700illustrates an example hardware implementation of a computing system in accordance with which one or more example components/methodologies of the invention (e.g., components/methodologies described in the context ofFIGS. 1-6) may be implemented, according to an example embodiment of the invention.

As shown inFIG. 7, the techniques for controlling access to at least one resource may be implemented in accordance with a processor710, a memory712, I/O devices714, and a network interface716, coupled via a computer bus718or alternate connection arrangement.

It will be appreciated that any of the elements described hereinabove may be implemented as a computer program product embodied in a computer-readable medium, such as in the form of computer program instructions stored on magnetic or optical storage media or embedded within computer hardware, and may be executed by or otherwise accessible to a computer (not shown).

While the methods and apparatus herein may or may not have been described with reference to specific computer hardware or software, it is appreciated that the methods and apparatus described herein may be readily implemented in computer hardware or software using conventional techniques.