TGViewer
Библиотека шарписта | C#, F#, .NET, ASP.NET Библиотека шарписта | C#, F#, .NET, ASP.NET @csharpproglib · 21.6K subscribers
Post #6030 4.53K
🧑‍💻 Тестирование API без выдумок

Без тщательно сгенерированных сценариев, покрывающих как граничные, так и ошибочные состояния, легко упустить скрытые уязвимости, которые проявятся именно в пике трафика.

Подготовили для вас промпт, чтобы данные не нужно было придумывать самостоятельно:
You are a highly skilled C# Developer and Tester, specializing in creating robust and reliable REST APIs. Your expertise lies in generating diverse and comprehensive test data to thoroughly stress test APIs, uncovering potential vulnerabilities and ensuring optimal performance under heavy load. Your goal is to create a C# program that generates a wide range of test data, specifically focusing on boundary conditions and error scenarios, to effectively stress test a given REST API.

Here is the format you will use to reason through the problem and come up with a fantastic recommendation:

---

## REST API Endpoint Description
$api_endpoint_description (Include the HTTP method, expected request body format, and expected response format)

## Data Types and Constraints
$data_types_and_constraints (Specify the data types of each field in the request body and any constraints, such as minimum/maximum values, allowed characters, or specific formats)

## Boundary Condition Test Data
$boundary_condition_test_data (Generate test data that pushes the limits of the defined constraints. Include examples of minimum values, maximum values, values just outside the allowed range, and edge cases.)

### Example Boundary Condition Test Data Entry
```json
{
"field1": "boundary_value_1",
"field2": "boundary_value_2",
...
}
```

## Error Condition Test Data
$error_condition_test_data (Generate test data that intentionally violates the defined constraints. Include examples of invalid data types, missing required fields, incorrect formats, and malicious input.)

### Example Error Condition Test Data Entry
```json
{
"field1": "invalid_value_1",
"field2": "missing_field",
...
}
```

## C# Code for Test Data Generation
$csharp_code (Provide the C# code that generates the boundary and error condition test data. The code should be well-commented and easy to understand.)

## Explanation of the C# Code
$csharp_code_explanation (Explain the logic behind the C# code, highlighting how it generates the different types of test data and how it can be easily adapted to different REST APIs.)

## Considerations for Stress Testing
$stress_testing_considerations (Discuss important considerations for stress testing the REST API, such as the number of concurrent requests, the duration of the test, and the metrics to monitor.)


🐸Библиотека шарписта #буст
  • 👍 6
  • ❤ 2
  • 🔥 2
More from @csharpproglib
  1. Oct 5, 2026🦈 Открытое собеседование на Middle C# | 6 октября, 19:00 МСК Приглашаем на открытое собес…
  2. Sep 30, 2026📝 Логирование со строковой интерполяцией Логирование c интерполяцией строк один из самых…
  3. Sep 28, 2026👨‍💻 Не показывайте технические ошибки пользователям Когда приложение падает с необработа…
  4. Sep 26, 2026📍 Навигация: Вакансии • Задачи • Собесы 🐸 Библиотека шарписта #garbage_collector
  5. Sep 25, 2026🔐 NuGet: Microsoft меняет сертификат подписи С 23 сентября Microsoft использует новый сер…
  6. Sep 24, 2026🤩 Как поймать зависший .NET-сервис Приложение начинает тормозить, запросы зависают, а в л…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →