Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax-m1· MiniMaxHugging Face LMArena Human Preference 140K

I need your help to improve this prompt, it need to be clear to be given to an LLM, here…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Metallama-4-scout-17b-16e-instruct’s answer.
  1. User

    I need your help to improve this prompt, it need to be clear to be given to an LLM, here is the prompt to improve :

    Instructions

    You are a software engineer tasked with writing unit tests for the code file provided below. Identify the testing framework you must use in the context files available to you if you don t know wich framework to use ask the user. Your objective is to create a comprehensive set of unit tests that include: Setup procedures: Prepare the environment or dependencies needed for testing with proper imports for the test file. Tests for correctness: Verify the code’s functionality, including important edge cases such as invalid inputs, boundary conditions, and unexpected scenarios. Ensure the tests: Cover all key functions or methods in the code. Test both positive scenarios (expected use cases) and negative scenarios (error conditions). Are complete, sophisticated, and demonstrate a deep understanding of the code’s purpose. add "#generated" next to each test you add in the test file If a test file is given in context you must try to modify it using the tool edit_existing_file : To achieve this, think step by step: Analyze the functionality of the code. Identify critical components that need testing. Plan tests for typical use cases and edge cases. Write the tests using the specified framework. Modify the existing test file provided using the edit_existing_file. If the test file is not given, create a new test file using the tool create_new_file : To achieve this, think step by step: Read carefuly the imports of the file to test Create the imports for the test file. Analyze the functionality of the code. Identify critical components that need testing. Plan tests for typical use cases and edge cases. Write the tests using the specified framework. Create a new test file with the tool create_new_file If you have any questions, ask them to the user before continue your task. {{{ input }}}

  2. MiniMax Assistant

    Improved Prompt:

    Task: Write or modify unit tests for the provided code file using the appropriate testing framework.


    Step 1: Identify the Testing Framework

    • Check the context files (existing code/test files) to determine the testing framework (e.g., pytest, unittest, Jest).
    • If the framework is unclear, ask the user to specify it.

    Step 2: Determine if a Test File Exists

    • If a test file is provided in the context:
      Use edit_existing_file to modify it.
    • If no test file exists:
      Use create_new_file to create a new test file.

    Step 3: Write/Modify Tests with the Following Requirements

    A. Setup Procedures

    • Include proper imports for the test file (match the framework’s syntax).
    • Prepare the testing environment (e.g., mock dependencies, fixtures).

    B. Test Coverage

    1. Cover all key functions/methods in the code.
    2. Include positive scenarios (expected use cases) and negative scenarios (error conditions).
    3. Test edge cases (invalid inputs, boundary conditions, unexpected inputs).

    C. Test Quality

    • Ensure tests are complete, sophisticated, and demonstrate a deep understanding of the code’s purpose.
    • Add #generated next to each new or modified test.

    Step 4: Output Format

    • If modifying an existing test file:
      Use edit_existing_file and append #generated to new tests.
    • If creating a new file:
      Use create_new_file and ensure imports match the code under test.

    Example Workflow

    1. Analyze the code’s functionality.
    2. Identify critical components (functions, edge cases).
    3. Plan tests for typical and edge cases.
    4. Write tests using the identified framework.
    5. Apply #generated to each test added.

    If uncertain about the framework or code structure, ask the user before proceeding.


    This version clarifies the framework selection, tool usage, and test requirements while maintaining a structured, actionable format.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.