Browse Tasks

Select category

Select category

Select category

Select category

Select Task

Select Task

Select Task

Select Task

Select Tasks

Select Industry

Code Review

Pull Request Summary

Commit Message Review

Error Log Analysis

Test Case Generation

Internationalisation (i18n) Implementation

Prompt Enhancement

Insurance Advisor

Test Case Generation

This Task automates the process of generating unit test cases based on function signatures and descriptions, helping developers increase code coverage and improve software quality. Designed for use by Software Developers, Quality Assurance Teams, and Test Engineers, the system performs the following functions:

  • Analyses function signatures to identify input parameters and return types

  • Interprets function descriptions to understand expected behaviour and edge cases

  • Generates a comprehensive set of test cases covering various scenarios

  • Creates test inputs including boundary values, typical cases, and edge cases

  • Suggests expected outputs for each test case

  • Provides a code skeleton for implementing the generated test cases


It is designed to integrate with popular testing frameworks, continuous integration systems, and integrated development environments (IDEs). The template can be adapted to address specific testing requirements within an organisation's development workflow. This customisation allows for tailored improvements in test case generation, coverage analysis, and quality assurance processes.

Example outputs:

{
  "test_cases": [
    "Test with typical positive integer",
    "Test with zero",
    "Test with maximum integer value",
    "Test with negative integer",
    "Test with non-integer input",
    "Test with null input"
  ],
  "test_inputs": [
    "5",
    "0",
    "2147483647",
    "-3",
    "3.14",
    "null"
  ],
  "expected_outputs": [
    "120",
    "1",
    "Infinity or error due to integer overflow",
    "Error:Input must be a non-negative integer",
    "Error:Input must be an integer",
    "Error:Input cannot be null"
  ],
  "test_descriptions": [
    "Verifies correct calculation for a typical positive integer input",
    "Checks handling of zero as input, which should return 1",
    "Tests behavior with maximum integer value to check for overflow handling",
    "Ensures proper error handling for negative inputs",
    "Verifies error handling for non-integer inputs",
    "Checks null input handling"
  ],
  "code_skeleton": "def test_factorial():\n    # Test case 1: Typical positive integer\n    assert factorial(5) == 120\n\n    # Test case 2: Zero\n    assert factorial(0) == 1\n\n    # Test case 3: Maximum integer value\n    with pytest.raises(OverflowError):\n        factorial(2147483647)\n\n    # Test case 4: Negative integer\n    with pytest.raises(ValueError, match=\"Input must be a non-negative integer\"):\n        factorial(-3)\n\n    # Test case 5: Non-integer input\n    with pytest.raises(TypeError, match=\"Input must be an integer\"):\n        factorial(3.14)\n\n    # Test case 6: Null input\n    with pytest.raises(TypeError, match=\"Input cannot be null\"):\n        factorial(None)",
  "coverage_estimate": "The generated test cases provide approximately 90% code coverage, testing main functionality, boundary conditions, and error handling. Additional tests may be needed for specific implementation details."