tabletest

Generate TableTest-style JUnit tests in Java or Kotlin for data-driven scenarios.

30|1|Updated Feb 8, 2025
One-click install
npx skills add https://github.com/nchaugen/tabletest --skill tabletest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tabletest
Source: https://github.com/nchaugen/tabletest/tree/main/agents/skills/tabletest
Command: npx skills add https://github.com/nchaugen/tabletest --skill tabletest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of data-driven JUnit tests, reducing boilerplate code and improving test readability for complex scenarios.

Core Features & Use Cases

  • Data-Driven Testing: Express multiple test cases with varying inputs and expected outputs in a clear, tabular format.
  • Concise Test Code: Consolidate multiple similar @Test methods into a single, maintainable test.
  • Use Case: When testing a leapYear function with various year inputs (e.g., 1900, 2000, 2004), use this Skill to define all these cases in a table within a single test method.

Quick Start

Use the tabletest skill to write a JUnit test for the Calculator.add method with inputs (1,2) expecting 3, and inputs (0,5) expecting 5.

Frequently Asked Questions about tabletest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write data-driven JUnit tests for multiple input scenarios?

You can consolidate multiple similar @Test methods into a single test by defining varying inputs and expected outputs in a tabular format, reducing boilerplate code for complex scenarios.

Can I use table tests to document business rules in Java or Kotlin?

Yes, table tests document business rules as tables by mapping numerous input and output examples directly within a single JUnit test method in Java or Kotlin.

What is the best way to test a function with many different inputs in JUnit?

The best way is using a data-driven testing approach that expresses all test cases with varying inputs and expected outputs clearly in a table within a single test method.

When should I avoid using data-driven table tests?

You should avoid table tests for single-case scenarios or divergent logic, as they are specifically designed to consolidate multiple similar test methods sharing the same business rules.

Does this data-driven testing approach support both Java and Kotlin?

Yes, this approach generates TableTest-style JUnit tests in both Java and Kotlin, allowing you to write data-driven scenarios with clear tabular formatting in either language.