Software Engineering & Testing Preset

Unit & Integration Test Generator Prompt | Vezz me

Download the Unit & Integration Test Generator JSON preset for Vezz me. Highlight any function, class, or API handler to generate edge-case unit tests.

Best fit

Best for software developers writing robust unit and integration tests in Vitest, Jest, pytest, or Go testing.

On-screen walkthrough

How this looks on a real webpage.

Instead of switching tabs and rebuilding context, highlight the exact passage that slowed you down and press your shortcut (default: Ctrl+Shift+X or Cmd+Shift+X on macOS, fully customizable in settings).

github.com/org/gateway/blob/main/src/rateLimiter.ts
Context: Detailed
1. Highlighted on page (Backend Module — Token Bucket Rate Limiter Function)
export function consumeTokens(bucket: TokenBucket, tokens: number, nowMs: number): boolean { const elapsed = (nowMs - bucket.lastRefillMs) / 1000; bucket.currentTokens = Math.min(bucket.capacity, bucket.currentTokens + elapsed * bucket.refillRatePerSec); bucket.lastRefillMs = nowMs; if (bucket.currentTokens >= tokens) { bucket.currentTokens -= tokens; return true; } return false; }
Ctrl+Shift+X“Generate edge-case unit tests with Vitest for this function.”
2. Vezz me on-screen answer overlay

**Edge-Case Test Matrix**:

1. Consuming when tokens are available (`true`).

2. Consuming more tokens than capacity (`false` immediately).

3. Zero tokens requested (`tokens = 0`).

4. Clock drift backwards (`nowMs < bucket.lastRefillMs`).

5. Partial fractional token accumulation.

```ts

import { describe, it, expect } from 'vitest';

import { consumeTokens } from './rateLimiter';

describe('consumeTokens', () => {

it('should refill tokens up to capacity but not exceed it', () => {

const bucket = { capacity: 10, currentTokens: 5, refillRatePerSec: 10, lastRefillMs: 1000 };

expect(consumeTokens(bucket, 10, 2000)).toBe(true);

expect(bucket.currentTokens).toBe(0);

});

it('should handle clock skew gracefully if nowMs is in the past', () => {

const bucket = { capacity: 10, currentTokens: 5, refillRatePerSec: 10, lastRefillMs: 2000 };

// If system clock jumped backwards 500ms, elapsed is negative!

consumeTokens(bucket, 1, 1500);

// Flag: Note that elapsed < 0 will subtract tokens in your current implementation!

});

});

```

3. Suggested follow-up questions in thread
  • “Did you spot a bug with negative elapsed time if the server clock drifts backwards?”
  • “Show how to fix the clock-drift bug in the source code.”
Importable Prompt Preset

Use this custom prompt in Vezz me.

Copy the system prompt below or download the .json preset file to import it directly into the Vezz me Chrome or Firefox extension.

Vezz me Custom Prompt Preset

Unit & Integration Test Generator

Focuses on boundary edge cases (empty strings, zero, negative numbers, network timeouts, concurrent retries) rather than repetitive happy-path tests.

Recommended context: Detailed
System Prompt
Download .json for Vezz me
Act as a Principal Software Engineer writing production tests for the selected code: 1) Edge-Case Matrix: identify boundary values, off-by-one errors, empty arrays/null inputs, network timeouts, and concurrency races, 2) Test Suite: write clean, self-contained test cases (using Vitest/Jest for TS/JS, pytest for Python, or testing for Go) with descriptive test names ('should return 400 when X is empty'), and 3) Mocking Guidance: mock external I/O cleanly without over-mocking internal business logic.
Step-by-step workflow

How to run this workflow in place.

1

Download and import the JSON preset

Save `unit-and-integration-test-generator.json` and import it into Vezz me.

2

Highlight any function or API route handler on GitHub or docs

Select the implementation and press your shortcut (default: Ctrl+Shift+X).

3

Copy the test suite into your test file

Paste the generated test cases directly into your codebase and run `npm test` or `pytest`.

Key details

Why this approach works better than switching tabs.

Tests that actually catch production bugs
Testing trivial happy paths gives high code coverage without protecting against real production failures.
  • Tests boundary numbers ($0$, $-1$, `MAX_SAFE_INTEGER`, empty arrays)
  • Audits time-based logic for clock-drift, timezone, and leap-second bugs
  • Formats test names using standard behavior-driven naming conventions (`should ... when ...`)
Frequently asked questions

Common questions about software engineering & testing preset.

Can I specify my preferred testing framework in the prompt?

Yes! You can append 'using Vitest', 'using pytest', 'using Go standard library', or 'using Rust #[test]' to your query.

Does it test asynchronous error paths?

Yes—the prompt explicitly checks for unhandled Promise rejections, timeout exceptions, and HTTP non-2xx status codes.

Which preset should I use to review the implementation code first?

Use our Senior Engineer Code Reviewer preset.

Related workflows & guides

Explore connected pages.

Available for Chrome and Firefox

Ready to try this workflow on your own reading?

Install Vezz me free, highlight text on any webpage, and press your customizable shortcut (default: Ctrl+Shift+X or Cmd+Shift+X on Mac) to get an answer right beside the source.