본문으로 건너뛰기
cccskills
무료GitHub에 공개

cscheck

Write and simplify C# property-based, model-based, and executable specification tests with CsCheck. Use for generators, shrinking, stateful command sequences, Spec guards and rules, implementation conformance, or replaying generated failures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md4.6 KB
  • references/failures.md5.1 KB
  • references/properties.md5.7 KB
  • references/specifications.md9.2 KB
  • references/stateful-and-async.md7.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

CsCheck

Use CsCheck to explore inputs and action sequences; keep the application's contract visible in the test. Let the library generate, shrink, print, and replay counterexamples. Start with the smallest test that can falsify the claim, rather than building a testing framework around CsCheck.

Choose the test shape

What needs checkingStart withRead when needed
A function, round trip, algebraic law, or data transformationGen + SampleProperties and generators
An implementation with a simpler reference representationSampleModelBased / SampleModelBasedAsyncStateful and async tests
A protocol or lifecycle with explicit state, guards, and requirementsSpec.From, then Exhaustive and ConformExecutable specifications
Async resources or expectations that must incorporate observed outcomesGenerated command arrays + SampleAsync, with cleanup inside each caseStateful and async tests
A failing property, seed replay, or a before/after bug demonstrationNative sampling controls and a concrete regressionFailure discovery and replay

Read only the references needed for the task. These examples use xUnit, but CsCheck itself is test-framework independent. Preserve the project's existing framework and package-management conventions.

Establish the contract first

Identify an observable requirement and a plausible wrong result it would reject. Separate generated inputs, expected behavior, and actual observations. A model may consume observations, but must validate them against prior expectations before accepting them as new state. Do not use the implementation's answer to manufacture its expected answer.

Generate individual operations and their arguments, allowing CsCheck to compose arbitrary sequences. Finite domains, weighted boundary values, and preconditions are legitimate modeling choices. Handwritten whole scenarios are useful regressions, but are not a substitute for exploring action orderings.

Keep rejected requests testable when rejection is part of the contract. A guard saying “only withdraw when funds exist” cannot test insufficient-funds rejection. Preconditions describe what can be attempted; postconditions describe the response, including allowed failures.

Keep the test machinery small

  • Prefer composed Gen values to Random, hand-chosen seed lists, custom shrinkers, or retries-until-green.
  • Construct a fresh mutable implementation and model for each generated case, including shrinking.
  • Use ordinary records, direct calls, and meaningful comparisons. equal: must compare behavior or state; cleanup belongs in finally/using, not an equality predicate that always returns true.
  • Keep seeds out of ordinary discovery runs. Replay a seed emitted by a failure, then pin concrete inputs when the regression must survive generator changes.
  • Preserve domain coverage and historical counterexamples when simplifying. Fewer lines alone do not establish that the replacement checks the same behavior.

Verify the right thing

Spec.Exhaustive checks the model. Spec.Conform checks the real implementation through the adapter and only for sampled traces and compared observations. Keep both claims explicit. Inspect unreachable requirements, deadlocks, and search cutoffs; a green run can be vacuous.

When practical, show that the test rejects a known broken implementation or a small deliberate defect in an isolated copy. Compile and execute examples rather than assuming similarly named FsCheck APIs exist in CsCheck. Reuse native model-based APIs when their independent transitions and comparison fit; a custom async loop is a useful alternative, not a universal replacement.

API baseline

The linked examples were compiled and run with CsCheck 4.9.1 on .NET 8. Its package identifies source revision 5050355. Check the installed package before adapting signatures. For upgrades, verify the NuGet package and upstream source; do not infer a major version or native async Spec.Conform support from another library's API.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Patterns for building entity actors with Akka.Hosting - GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. Supports both local testing and clustered production modes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Configure Akka.NET with .NET Aspire for local development and production deployments. Covers actor system setup, clustering, persistence, Akka.Management integration, and Aspire orchestration patterns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Critical Akka.NET best practices including EventStream vs DistributedPubSub, supervision strategies, error handling, Props vs DependencyResolver, work distribution patterns, and cluster/local mode abstractions for testability.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Akka.Management for cluster bootstrapping, service discovery (Kubernetes, Azure, Config), health checks, and dynamic cluster formation without static seed nodes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Guidelines for making .NET libraries and applications trimming-safe and Native AOT compatible. Covers the trimming/AOT model, the MSBuild properties that enable analysis (IsTrimmable, IsAotCompatible, PublishTrimmed, PublishAot), the trimming attributes (RequiresUnreferencedCode, RequiresDynamicCode, DynamicallyAccessedMembers, UnconditionalSuppressMessage), IL2xxx/IL3xxx warning codes, and a pattern playbook: source generators and UnsafeAccessor, generated-interception diagnostic suppressors, intentional runtime scanning boundaries, trimming-safe islands and feature switches, migration analyzers, and temporary warning-approval baselines. Use when introducing trimming/AOT support, resolving IL2xxx/IL3xxx warnings, or making reflection-heavy code trimming-safe in C# / .NET codebases. For System.Text.Json AOT scenarios, see also the serialization skill.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aaronontheweb/dotnet-skills1.2천2026년 10월 12일 업데이트

Aaronontheweb의 스킬 모두 보기

이 스킬의 문제 신고