DEV Community

Pratik Kotal
Pratik Kotal

Posted on

How Keploy Transformed My API Testing Experience During Their Fellowship Program

Hey everyone! πŸ‘‹
I recently completed building CodeSentry as part of the Keploy API Fellowship program, and I wanted to share how this experience completely changed my perspective on API testing. You can check out the project on GitHub if you're interested.

The Testing Challenge I Faced

CodeSentry is a comprehensive code analysis API built with Go and MongoDB. It has multiple endpoints for different types of analysis - security checks, complexity analysis, style validation, and more. Each endpoint handles different request formats and returns detailed analysis results.
As I was building these features during the fellowship, I quickly realized that testing was becoming a major bottleneck. Writing comprehensive test cases manually meant:

  • Creating detailed JSON payloads for every scenario

  • Writing assertions for complex response structures

  • Testing various error conditions and edge cases

  • Ensuring database interactions work correctly

  • Validating the analysis logic for different programming languages
    I found myself spending way more time writing and maintaining tests than actually developing the core functionality.

Discovering Keploy's Power

Since this was a Keploy fellowship project, I had the opportunity to really dive deep into their testing platform. What I discovered was genuinely impressive.
Keploy offers multiple ways to generate test suites, and I got to experience all of them:

  1. Recording live interactions: Simply use your API normally, and Keploy captures everything in the background
  2. OpenAPI schema import: Upload your API specification and generate tests automatically
  3. Base URL crawling: Point Keploy at your API's base URL and let it discover and test endpoints
  4. cURL command conversion: Paste existing cURL commands and instantly convert them to test cases

The Keploy dashboard made this incredibly intuitive. I could literally paste my CodeSentry API's base URL (http://localhost:8080/api/v1) for local testing, and within minutes, it had discovered all my endpoints and generated comprehensive test suites for each one.

Dashboard-Based Test Generation

What really impressed me was how the Keploy dashboard streamlined test suite generation using three key components:
Base URL + OpenAPI Schema + cURL Commands = Complete Test Suite
The process was incredibly straightforward:

I provided my CodeSentry API's base URL (http://localhost:8080)
Uploaded my existing OpenAPI schema documentation
Added the cURL commands I had been using for manual testing

Within minutes, the dashboard combined all three components to generate comprehensive test suites for my entire API. It wasn't three separate approaches - it was three pieces of information that Keploy used together to create complete test coverage automatically.

A Concrete Example:
Here's what really sold me on the approach. I was testing the main analysis endpoint with a code snippet that contained security vulnerabilities:

curl -X POST http://localhost:8080/api/v1/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "code": "func main() {\n    password := \"admin123\"\n    if user == \"admin\" {\n        fmt.Println(\"Welcome admin\")\n    }\n}",
    "language": "go",
    "options": {
      "check_security": true,
      "check_style": true,
      "check_complexity": true,
      "check_metrics": true
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Instead of manually writing test cases to verify that the API correctly identifies hardcoded credentials, detects style issues, and calculates complexity metrics, I had multiple options:

  • Live recording: Make the request once and let Keploy capture it
  • cURL conversion: Paste this exact cURL command into the dashboard and get an instant test case
  • Schema validation: If this endpoint was in my OpenAPI spec, tests were auto-generated with proper validation

All three approaches took less than a minute and produced comprehensive test coverage that would have taken hours to write manually.

Seamless CI/CD Integration

One of the most valuable aspects of the fellowship was learning how to integrate Keploy into a proper development workflow. The CI/CD integration was straightforward and incredibly effective.
I added a GitHub Actions workflow that runs all Keploy-generated tests on every push:

      - name: Install Keploy CLI
        run: |
          curl --silent -L https://keploy.io/ent/install.sh | bash

      - name: Run Keploy Test Suite
        run: |
          export KEPLOY_API_KEY=${{ secrets.KEPLOY_API_KEY }}
          keploy test-suite --app=dcfa8d58-e06c-449f-baa1-6a239e95e616 --base-path http://localhost:8080/api/v1 --cloud
Enter fullscreen mode Exit fullscreen mode

Now every code change is automatically validated against real usage patterns. This caught several regression issues that would have been difficult to identify with traditional unit tests.

Measurable Impact

The difference was dramatic across all test generation methods:

Test creation time: From hours per endpoint to literally minutes for entire API suites
Coverage completeness: Base URL discovery found endpoints I had forgotten to test manually
Schema consistency: OpenAPI import ensured tests matched documentation perfectly
Developer workflow: cURL conversion meant existing debug commands became permanent tests
Test maintenance: Essentially zero - tests update automatically as the API evolves
Bug detection: Identified 3 critical regressions in the first week that manual tests missed

The dashboard provided clear visibility into test coverage and results, making it easy to identify gaps and track API health over time.

What Makes Keploy Different

After working with it extensively during the fellowship, here's what stands out:

  1. Context-aware recording: It doesn't just capture HTTP requests - it understands database states, external dependencies, and the complete application context.
  2. Zero learning curve: If you can make API calls, you can create tests. No special syntax or frameworks to learn.
  3. Real-world accuracy: Tests reflect how your API actually behaves in production scenarios.
  4. Automatic maintenance: As your API evolves, the tests evolve with it.

Fellowship Program Benefits

Being part of the Keploy fellowship provided several advantages:

  • Hands-on mentorship: Direct guidance on best practices for API testing
  • Real project experience: Building a complete application with proper testing infrastructure
  • Community support: Access to other fellows working on similar challenges
  • Industry exposure: Understanding how testing fits into modern development workflows

Honest Assessment

Keploy isn't a silver bullet. There are still scenarios where custom test logic is necessary, particularly for complex business rules or very specific edge cases. But for the majority of API testing needs - especially the tedious, repetitive parts - it eliminates significant overhead.
The Chrome extension is also quite useful for testing web applications that interact with APIs, allowing you to capture real user workflows and turn them into automated tests.

Recommendations for Other Developers

If you're working on API-heavy projects and finding testing to be a time sink, I'd strongly recommend trying Keploy. Start with one or two endpoints to get familiar with the workflow, then gradually expand coverage.
For students or early-career developers, I'd also suggest looking into their fellowship program if they offer it again. It's an excellent way to gain practical experience with modern testing approaches while building something meaningful.

Project Outcomes

CodeSentry now has comprehensive API test coverage with minimal maintenance overhead. The project includes endpoints for security analysis, complexity calculation, style checking, and result management - all thoroughly tested through Keploy-generated test suites.
You can see the integration results and test coverage in the project's GitHub repository. The README includes examples of the test outputs and CI/CD pipeline integration.
This fellowship experience has fundamentally changed how I approach API development and testing. Having confidence that every deployment is properly validated makes development much more enjoyable and productive.

Top comments (0)