Dynamic Source Code Comment Generation via User Context

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software developers face difficulties in understanding software source code due to insufficient detail in comments, which vary based on the reviewer's role, leading to inefficient debugging, enhancement, and maintenance processes.

Innovation Solution

A computer-implemented method using AI to dynamically generate source code comments by identifying the user, predicting their reason for reviewing the code, and analyzing navigation patterns to create context-specific comments displayed overlayed on the source code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If generic comments are provided in software source code, then the comments can be created automatically without analyzing user context, but the comments do not provide sufficient detail for different reviewer roles leading to inefficient understanding

Engineering Contradiction:
Improvecode review efficiencyVSAvoidcontext-specific information in comments
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The system dynamically generates comments based on the reviewer's identity, role, and navigation patterns rather than using static generic comments. The comment content adapts in real-time according to user context, making the information delivery dynamic and role-specific.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent replaces manual comment writing with an automated AI-based system that analyzes user context, navigation patterns, and code structure to generate appropriate comments automatically, eliminating the need for manual intervention.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Ease of operation

If detailed role-specific comments are provided for every user, then understanding is improved, but the system complexity increases due to need for AI analysis of user identity, skills, and navigation patterns

Engineering Contradiction:
Improvecode understandingVSAvoidcomment generation system
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The system serves multiple reviewer roles (developers, testers, managers, architects, analysts) with a single unified platform that automatically adapts to each user type, eliminating the need for separate comment systems for each role.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system automatically identifies user identity, retrieves relevant skills and navigation patterns, and generates appropriate comments without requiring manual input from reviewers, making the process self-service and automated.

Inventive Principle:
Principle #25Self-service

3Loss of information

If manual comment writing is used to provide sufficient detail, then the comments can be tailored to reviewer needs, but the time and effort required to create and maintain comments increases significantly

Engineering Contradiction:
Improvedetailed logic informationVSAvoidcomment creation and maintenance time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The patent replaces manual comment writing with an automated AI system that generates detailed comments by analyzing code structure, user role, and navigation patterns, eliminating the time-consuming manual process while maintaining high information quality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system pre-retrieves user skills and navigation patterns before generating comments, and uses this information proactively to create tailored comments, rather than waiting for manual input after the fact.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11481211B1Dynamically creating source code comments
Publication Date: 2022.10.25 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11481211B1 patent drawing
  • US11481211B1 patent drawing
  • US11481211B1 patent drawing

AI summary

An approach for dynamically generating comments associated with software source code. The identifies a user accessing the software source code. The approach retrieves data associated with the software source code, e.g., server logs, requirements documents, etc. The approach identifies skills associated with the user. The approach, using artificial intelligence (AI), predicts the reason the user is accessing the software source code. The approach identifies navigation patterns based on the user access. The approach, using AI, dynamically generates comments for the user. The approach overlays the comments on the software sour code under review and displays the combination to the user.