Skip to content

matixi9/command-completion-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command Completion Sandbox & Testing Report

Executive Summary

This report documents the exploratory testing session of the new Command Completion feature in IntelliJ IDEA. The feature successfully handles core code transformations like "Surround with try-catch" and local variable creation. However, two critical areas for improvement were identified:

  1. Performance (UI Responsiveness): Notable delays in loading the full list of completion suggestions.
  2. Context Awareness in Broken AST: The tool suggests advanced refactoring actions in syntactically incorrect code where simple syntax fixes should be prioritized.

Environment:

  • IDE: IntelliJ IDEA 2026.1 (Build #IU-261.22158.277)
  • JDK: 26
  • Language: JAVA
  • Hardware: ASUS Vivobook S14, 16GB RAM, Intel® Core™ Ultra 5 226V

Test Cases:

TC-01: Replace to text block behavior inside array initializers

  • Steps:
  1. Define a string array: String[] names = {"Josh", };
  2. Trigger command completion on the string literal "Josh"
  3. Select the "Replace with text block" command
  • Expected result: The string is converted to a text block with proper indentation, preserving the array's readability on a single line (if possible).

  • Actual result: The IDE converts it to """\nJosh""" which introduces awkward formatting and unnecessary line breaks inside a single line array. IDE will compile it correctly but it affects readability.

TC-02: Basic statement completion and formatting

  • Steps:
  1. Write a basic print statement without a semicolon e.g.: System.out.println("Test")
  2. Trigger the command completion popup.
  3. Select the default completion suggestion (adding the semicolon).
  • Expected result: The IDE seamlessly completes the statement and appending the missing semicolon, applies proper line formatting, and moves the cursor to end of the statement.

  • Actual result: The statement is correctly completed with a semicolon and formatted. However, the cursor remains positioned before the newly added semicolon, rather than moving past it. This might disrupt the typing flow if the user wants to immediately start a new line.

TC-03: "Create local variable" action for an unresolved symbol

  • Steps:
  1. Write a statement using an undeclared variable, e.g., System.out.println(hello);
  2. Place the cursor on the unresolved symbol hello.
  3. Trigger the command completion popup.
  4. Select the "Create local variable 'hello'" command.
  • Expected result: The IDE should automatically generate a local variable declaration for hello above the current line, correctly inferring the context, and allow immediate assignment of a value

  • Actual result: As expected. The IDE successfully generates the variable declaration and places the cursor ready to assign its value.

TC-04: Code Transformation - "Surround with try-catch"

  • Steps:
  1. Write a statement that throws a checked exception, e.g.: Files.readAllLines(Path.of("test.txt"));
  2. Trigger the command completion popup on the statement.
  3. Select the "Surround with try-catch" command.
  • Expected result: The IDE correctly wraps the statement in a try-catch block, automatically identifying the required IOException and adding the necessary imports.

  • Actual result: As expected. The transformation is executed seamlessly, generating syntactically correct code and properly handling the checked exception type.


Bug Reports:

BUG-01: [Performance] Command completion experiences a ~0.5sec delay

  • Severity: Minor

  • Priority: High

  • User Impact: High frequency of use makes even a 0.5s delay noticeable. On fresh starts (up to 2s delay), it disrupts the flow expected from IntelliJ, potentially discouraging users from relying on the feature.

  • Steps:

  1. Write any valid java statement e.g.: String test = "Test";
  2. Trigger any completion command popup
  3. Observe the loading time of the suggested commands
  • Expected result: The full list of completion command suggestions loads immediately

  • Actual result: Suggestions pop up in waves; only 2-3 appear initially, with the rest following after a delay.

  • Reference:

  • See BUG-01_Initial_State.png and BUG-01_Full_Loaded_Suggestions.png.

  • Note:

  • This delay was observed on a machine with Intel® Core™ Ultra 5 226V and a 16GB RAM.

BUG-02: IDE shows more completion options for broken code than for correct one

  • Severity: Minor

  • Priority: Medium

  • User Impact: Visual noise. When a semicolon is missing, users expect a quick fix ("Insert ';'"). Displaying complex refactorings (like Extract Method) that require valid syntax is distracting and provides poor Developer Experience.

  • Steps:

  1. Write a variable declaration without a semicolon: int i = 0
  2. Trigger command completion and look at the suggestions
  3. Write another variable with a semicolon: int j = 0; and trigger command completion again
  4. Compare suggestions
  • Expected result: IDE should prioritize fixing the syntax error (Insert ';') and limit complex refactoring suggestions that require a valid AST (Abstract Syntax Tree).

  • Actual result: Invalid syntax triggers a bloated list of irrelevant actions (Introduce Field, Type Info, etc.) that disappear once the code is corrected.

  • Reference: See BUG-02_Correct_Syntax_Clean_List.png , BUG-02_Invalid_Syntax_Bloated_List_1.png and BUG-02_Invalid_Syntax_Bloated_List_2.png.


Future Scope & Prioritization Strategy:

If I had to prioritize the testing efforts below, I would start with Complex Code Structures. Command Completion relies heavily on context analysis. If it fails in complex Stream API chains or nested generics, it might introduce subtle logic errors into the user's code, which destroys trust in the feature. Performance and interoperability can be optimized iteratively, but the core code transformation logic must be undeniably reliable first.

To ensure the reliability of command completion further testing should cover:

  • Complex Code Structures Testing suggestions inside deeply nested generic types, complex Stream API chains and advances lambda expressions.
  • Performance Under Heavy Load: Testing response times and memory consumption in massive enterprise projects (files with >10 000 lines of code) to ensure no UI freezes occur.
  • Plugin Interoperability: Verifying if command completion conflicts with other heavily used plugins that manipulates code in the editor e.g. Lombok, Spring Boot tools.
  • Cross Language Behavior: Evaluating completion accuracy in mixed Java/Kotlin projects

About

Exploratory testing environment and bug reports for the IntelliJ IDEA Command Completion feature (JetBrains QA Internship Task).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages