udf-gen-test

Generate ScalaTest unit tests for Apache Spark UDFs before GPU conversion.

993|294|Updated May 14, 2020
One-click install
npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-gen-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: udf-gen-test
Source: https://github.com/NVIDIA/cudf-spark/tree/main/skills/udf-gen-test
Command: npx skills add https://github.com/NVIDIA/cudf-spark --skill udf-gen-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the manual effort of building a reliable unit test harness for an Apache Spark UDF before converting it to a GPU-compatible implementation. It helps establish a clear behavioral contract for the CPU UDF so later conversion work can be validated against known inputs and outputs.

Core Features & Use Cases

  • Project setup: Creates a self-contained Scala test project from the provided template and places the target UDF source in the expected package structure.
  • Test implementation: Fills in unit test placeholders, replaces UDF name tokens, and builds coverage-focused test data with nulls, malformed inputs, boundary values, and mixed valid or invalid rows.
  • Verification loop: Compiles, runs tests, reviews coverage, and iterates until the test suite passes and the important branches of the UDF are exercised.
  • Use case: A developer with an existing Spark CPU UDF can use this Skill to generate a strong pre-conversion test specification that supports later GPU or SQL porting.

Quick Start

Provide the Java or Scala UDF source path and ask the Skill to generate the unit test project, implement the test cases, and iterate until the suite passes.

Frequently Asked Questions about udf-gen-test

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

FAQPage Schema
How do I generate unit tests for an Apache Spark UDF before GPU conversion?

To generate unit tests for an Apache Spark UDF before GPU conversion, provide the Java or Scala source path to automatically create a self-contained ScalaTest project with coverage-focused test data and branch-aware validation.

What is the best way to ensure edge-case coverage for my Scala Spark UDF?

The best way to ensure edge-case coverage for a Scala Spark UDF is to generate a test suite that automatically builds coverage-focused test data with nulls, malformed inputs, boundary values, and mixed valid or invalid rows.

Can I use ScalaTest and scoverage to validate a CPU UDF before porting it to GPU?

Yes, you can use ScalaTest and scoverage to validate a CPU UDF before porting it to GPU by compiling, running tests, reviewing coverage reports, and iterating until the important branches of the UDF are fully exercised.

Does the Spark UDF test generation workflow support Java source files or only Scala?

The Spark UDF test generation workflow supports both Java and Scala CPU UDFs, placing the target source into the expected package structure within a self-contained Scala template project to establish a clear behavioral contract.

Why does my Spark UDF need a self-contained test project before converting to GPU?

A Spark UDF needs a self-contained test project before GPU conversion to establish a clear behavioral contract for the CPU implementation, allowing later conversion work to be validated against known inputs and outputs.

How to iterate on UDF test coverage until the test suite passes?

To iterate on UDF test coverage until the suite passes, compile the generated ScalaTest project, run the tests, review the scoverage output, and repeat the loop until all important branches are exercised and validated.