SuperAPI AI Directory

testcase

Testing & quality

View repository

Updated 10-15 21:52

About this skill

testcase

How It Works

  1. The user needs to specify a file. If there is no file, have the user implement a minimal testable model, send thereference/li-case.luacode to the user, and interrupt
  2. After ensuring there is a user-specified file, read the test cases in the code
  3. Then read the function definitions in the associated code and analyze which conditions need to be covered
  4. Supplement the user's test cases to ensure all conditions are covered

Requirements

Equivalence Partitioning

  • Divide the input data into several equivalence classes, and select representative data from each class for testing.
  • This item must contain at least 2 test cases: one valid equivalence class and one invalid equivalence class

Boundary Value Analysis

  • Use the boundary three-point method, using boundary values that cover the input data
  • Boundary three-point method: lower off-point (min-1) | lower point (min) | inner point (middle value) | upper point (max) | upper off-point (max+1)
  • This item must contain at least 5 test cases

Full Coverage Analysis

  • There must be at least one test case covering each non-mutually-exclusive condition
  • This item must contain at least 1 test case; give 1 test case covering N conditions as much as possible, and add 1 group of test cases for each additional group of mutually exclusive conditions

Dirty Data

  • Critical data missing, string format error, whether the condition is returnfalseor error interruption

Test Case Quantity Judgment

  • Quantity is not mandatory; adjust adaptively according to scenario complexity
  • The more complex the conditions, the more test cases
  • The more input items, the more test cases
  • The more combination possibilities, the more test cases

Code Writing

  • Continue the user's code style and maintain consistency
  • Use clear naming and Chinese comments and LOG to enhance readability
  • Only modify the file passed in by the user, do not modify other files