arabelatso/skills-4-se/assertion-synthesizer
- community
Checking that the SKILL.md file is still in the repository.
Generate test assertions from existing code implementation. Use when the user has implementation code without tests or incomplete test coverage, and needs assertions synthesized by analyzing the code's behavior, inputs, outputs, and state changes. Supports Python (pytest/unittest), Java (JUnit/AssertJ), and JavaScript/TypeScript (Jest/Chai). Handles equality checks, collections, exceptions, and state verification.
Install
npx vskill@latest install arabelatso/skills-4-se/assertion-synthesizerSKILL.md
Assertion Synthesizer
Generate comprehensive test assertions by analyzing code implementation, behavior, and expected outputs.
Workflow
1. Analyze Code
Read and understand the implementation to identify testable behavior:
- Function signatures: Parameters, return types, side effects
- Logic paths: Conditionals, loops, branching behavior
- Edge cases: Boundary conditions, null/empty inputs, error conditions
- State changes: Object mutations, attribute modifications
- Dependencies: External calls, database operations, I/O
2. Identify Test Scenarios
Extract scenarios that need assertions:
- Happy path: Normal inputs producing expected outputs
- Edge cases: Empty lists, zero values, boundary conditions
- Error cases: Invalid inputs, exceptions, error handling
- State verification: Object state before/after operations
- Collection assertions: List contents, ordering, membership
3. Generate Assertions
Create appropriate assertions for each scenario:
Assertion Types:
- Equality:
assert result == expected,assertEquals(expected, actual) - Truthiness:
assert is_valid,assertTrue(condition) - Collections:
assert item in list,assertContains(list, item) - Exceptions:
pytest.raises(Exception),assertThrows(Exception) - State:
assert obj.status == "active",assertEquals("active", obj.getStatus())
4. Structure Tests
Organize assertions into well-structured test functions:
- Use descriptive test names
- Follow Arrange-Act-Assert pattern
- Group related assertions
- Add explanatory comments
5. Verify Coverage
Ensure all important behaviors have assertions:
- Check all return values are tested
- Verify edge cases are covered
- Confirm error conditions are tested
- Validate state changes are asserted
Language-Specific Patterns
Python (pytest)
Python (unittest)
Java (JUnit + AssertJ)
JavaScript/TypeScript (Jest)
Assertion Synthesis Strategies
From Return Values
Analyze what the function returns and assert on it:
From Side Effects
Identify state changes and mutations:
From Conditional Logic
Test each branch:
From Collections
Assert on collection properties:
From Object State
Verify object properties:
Best Practices
Assertion Quality
- Be specific: Prefer
assert result == 5overassert result > 0 - Test one thing: Each test should verify one specific behavior
- Use meaningful values: Avoid magic numbers, use named constants
- Check types: Verify return types when relevant
Coverage Completeness
- All branches: Test every if/else path
- Boundary values: Test min, max, zero, empty, null
- Error cases: Assert on exceptions and error messages
- State transitions: Verify before/after states
Test Organization
- Descriptive names:
test_withdraw_insufficient_fundsnottest_case_2 - Arrange-Act-Assert: Clear separation of setup, execution, verification
- Group related tests: Use test classes or describe blocks
- Comment complex assertions: Explain what's being verified
Common Patterns
Multiple assertions for comprehensive verification:
Parametrized tests for multiple inputs:
Example Sessions
Example 1: Untested Function
User provides code:
Synthesized assertions:
Example 2: Enhancing Existing Tests
User provides weak test:
Enhanced assertions:
Tips
Analyzing Complex Code
- Break down complex functions into testable units
- Identify all execution paths through code
- Look for implicit assumptions to test
- Consider edge cases the code may not handle
Capturing Behavior
- Run code mentally or actually execute it
- Note all observable outputs and state changes
- Document expected behavior in assertions
- Test both success and failure scenarios
Balancing Coverage
- Prioritize critical paths over trivial code
- Don't over-assert on implementation details
- Focus on public API behavior
- Test the contract, not the implementation
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/assertion-synthesizer/SKILL.md
Popularity
- Repository stars
- 63
- Repository forks
- 5
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arabelatso/skills-4-se/assertion-synthesizer)