SShortSingh.
Back to feed

Spring PetClinic Contract Testing Reveals Hidden API and Test Infrastructure Gaps

0
·1 views

Full stack developer Kuruba Ramesh, interning with Specmatic, integrated contract testing into the Spring PetClinic REST project, which exposes 18 API paths and 36 operations backed by an OpenAPI 3.0 spec. Running Specmatic's JUnit 5 test suite generated 221 scenarios, of which 214 passed and 7 failed, uncovering real gaps in the existing API design. A POST /visits failure was traced to a missing petId foreign key in the request schema, which was resolved by introducing a dedicated VisitCreate DTO and a corresponding MapStruct mapping. Six DELETE operations then surfaced 404 errors instead of expected 200 responses, pointing to a deeper issue in the test infrastructure rather than the API logic itself. The exercise demonstrated that contract testing can expose limitations in test setup and data lifecycle management, not just API correctness.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds AI Tool That Transforms Personal Passions Into Cinematic Microsites

A developer named Divyesh built 'Origin,' an AI-powered web app submitted for a weekend coding challenge, that converts a user's answers to seven questions into a cinematic microsite. The output includes an origin story, a five-stage timeline, a character card, an AI-generated movie poster, and voice narration powered by ElevenLabs. The app requires no sign-up, giving users instant access to a shareable public page with a QR code. Built with Next.js, React 19, and Google Gemini 2.5 Flash, the tool includes automatic fallbacks for 3D rendering and voice playback to ensure a consistent experience across devices. The project is live on Vercel and open-sourced on GitHub.

0
ProgrammingDEV Community ·

Lazy Loading Videos Can Boost Web Performance, But Browser Support Remains Limited

Lazy loading is a technique that delays downloading video files until they are close to entering the user's viewport, reducing initial page load time, bandwidth usage, and memory consumption. Developers can implement it using the native HTML 'loading=lazy' attribute on video elements, optionally paired with a poster image to show a preview before playback. Currently, native support is limited to Chromium-based browsers such as Google Chrome, Microsoft Edge, and Opera, while Firefox and Safari do not yet support the feature. As an alternative, developers can use the Intersection Observer API to dynamically load video sources, providing a reliable fallback for unsupported browsers. Best practices also include compressing videos, using modern formats, and measuring performance gains through tools like Lighthouse and Core Web Vitals.

0
ProgrammingDEV Community ·

Rivalry Engine uses Snowflake and AI to narrate football history without fabricating facts

A developer built 'Rivalry Engine,' a Snowflake-based app that analyzes 150 years of national football match data to characterize rivalries between any two countries. The tool calculates a heat score, classifies the rivalry's shape, and uses Snowflake's Cortex AI to generate a narrative — but only from facts computed via SQL. A key design rule prevents Cortex from ever producing a number itself, ensuring all statistics come from verified match data. If two nations have never played each other, the app returns an honest 'first chapter unwritten' card instead of generating speculative content. The entire stack — data, analytics, AI, and front-end — runs within Snowflake's Streamlit environment, with nothing leaving the warehouse.

0
ProgrammingDEV Community ·

Study Finds Vision-Language AI Still Struggles With Complex Social Scenes Despite Benchmark Gains

A new research study evaluated nine vision-language AI models spanning 2017 to 2025 on their ability to describe complex social behavior in images, challenging the widely cited claim of near-human captioning performance. Researchers created a 100-image Complex Social Behavior dataset drawn from movie frames requiring multi-person interaction reasoning, alongside a ranked set of 20 human descriptions per image as a gold standard. Results showed that older pre-MLLM models performed poorly on the new dataset despite appearing competent on the standard MS-COCO benchmark, while modern multimodal large language models closed much of that gap. The study introduced a five-category error taxonomy and found that modern models have largely eliminated four error types, but continue to struggle with spatial dependence — understanding positional relationships between objects and people. The findings suggest that headline accuracy figures in AI vision research are significantly inflated by easy benchmark datasets that fail to capture real-world scene complexity.

Spring PetClinic Contract Testing Reveals Hidden API and Test Infrastructure Gaps · ShortSingh