SShortSingh.
Back to feed

Spec-first AI coding: writing boring scenarios before C# code is generated

0
·4 views

A developer describes writing acceptance scenarios for a coupon-redemption feature in .NET 10 before letting an AI coding agent implement it. The example centers on a coupon that should work on a retry after an initially rejected cart, illustrating how unstated rules can lead code to consume a coupon on a failed attempt. The spec was written in GitHub Spec Kit's layout, with each scenario mapped to an ID that is run as an xUnit test, totaling 37 tests. The author lists practices such as giving every scenario an ID, testing boundaries from both sides, and naming the clock and time zone. A test that cross-checks spec IDs against test data keeps the document and the test suite in sync.

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 ·

Generating Changelogs from Git Log Between Two Tags

Writing release notes by hand from git log output is tedious, especially when sorting commit messages by type. The article shows how to list commit subjects between two tags or hashes using git log with a pretty format. It then demonstrates a shell approach that uses grep to split commits prefixed with feat, fix, and chore into separate files and group them under Markdown headings. The author notes this pipeline becomes unwieldy when commit conventions are inconsistent or release sizes grow. The piece ends by promoting a paid tool that automates grouped Markdown changelog generation.

0
ProgrammingDEV Community ·

PantryPulse: An Open-Source Kitchen App for Tracking Ingredients and Cutting Food Waste

A developer has built PantryPulse, a kitchen companion app designed to help users cook with what they already have and waste less food. The app aims to scan ingredients and maintain a running inventory of a user's fridge contents. It pairs a React Native and Expo mobile and web front end with a Python backend and AI-assisted food features. The project was submitted to a Hacktoberfest Open-Source AI Challenge and emphasizes privacy-friendly, offline-first AI that works across devices. The developer also highlights open-source development as a way to let others contribute and to explore running AI locally instead of relying on closed services.

0
ProgrammingDEV Community ·

Safely cleaning up merged git branches and avoiding the squash-merge trap

Long-lived repositories often accumulate many stale local branches that are hard to track. The article recommends switching to main, pulling the latest changes, and listing branches already merged into main, since deleting those loses no work. It advises using the lowercase -d flag, which refuses to delete unmerged branches, and previewing candidates in a file before removing anything. Because squash-merged pull requests are not recognized by git branch --merged, the author suggests verifying them on the pull request page before forcing deletion with -D. Remote branch deletion is flagged as something to coordinate with the team, and the piece closes with a promotion for a paid Python helper tool.

0
ProgrammingDEV Community ·

Cómo la IA puede influir sutilmente en las decisiones de compra de los consumidores

Un artículo advierte que algoritmos de inteligencia artificial influyen de forma discreta en las decisiones de consumo, sin que las personas lo perciban. Según el texto, sistemas de recomendación y precios dinámicos pueden orientar a los compradores hacia marcas o productos que maximizan el margen del vendedor. El análisis señala que pequeñas empresas de Latinoamérica, como una cafetería en Costa Rica, enfrentan desventajas al competir con grandes firmas que usan estas herramientas. Entre las tácticas mencionadas figuran el sesgo de confirmación, la escasez artificial y el aprovechamiento de la fatiga de decisión. El autor recomienda transparencia y un uso ético de la IA como defensa tanto para consumidores como para emprendedores.