SShortSingh.
Back to feed

Software developer advocates for custom test fakes over mocking libraries

0
·1 views

A software developer argues that custom test fakes can be preferable to popular mocking libraries like Moq or NSubstitute. The author demonstrates that custom fakes can reduce wordiness and improve test readability compared to traditional mocking. Custom test-doubles also decouple tests from specific method signatures, making dependencies easier to change. This approach allows more implementation freedom and can lead to creating reusable testing tools. The developer concludes that while mocking libraries are powerful, custom fakes offer significant advantages for test design.

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 ·

Telegram API's 'Free' Options Carry Hidden Costs for Channel Monitoring

Accessing Telegram channel messages via the official bot API is free but requires the bot to be an admin of the channel, often necessitating difficult outreach to channel owners. Using a full client API with api_id and api_hash allows greater access but risks account bans and aggressive rate limits for new accounts. Scraping the public web interface at https://t.me/s/ provides the last ~20 messages without authentication but offers no historical backfill and requires careful parsing. The article, based on a developer's production experience, outlines these trade-offs for monitoring multiple channels.

0
ProgrammingDEV Community ·

Small SaaS observability strategy prioritizes quiet monitoring, focused alerts

The author recommends a streamlined observability approach for a small, one-person Node.js media SaaS. Key elements include probing a public health endpoint from both Europe and the US to check user-visible availability. For AI agent operations, a single structured event per loop should capture timing and usage data for cost and latency analysis. Alerts should only trigger for sustained, user-facing failures, while other data is reserved for dashboards and daily review. This strategy aims to minimize unnecessary interruptions by giving each signal a specific purpose.

0
ProgrammingDEV Community ·

Startups advised to separate SMS verification from report delivery for compliance

A technical analysis recommends startups using SMS verification APIs separate authorization from evidence delivery. The guidance suggests maintaining an independent audit ledger while using hosted OTP services for login workflows. This approach is particularly important for handling education records under FERPA or GDPR regulations. The analysis emphasizes that compliance responsibilities remain with the application, not the OTP provider.

0
ProgrammingDEV Community ·

AI-powered app Plan A Date creates personalized outing itineraries

Plan A Date is an AI-powered outing planner that generates personalized itineraries based on user inputs. The application uses Google's Gemma AI model through the Gemini API to organize activities. It incorporates real-world venue discovery via SerpApi's Google Local search capabilities. The tool aims to reduce planning time and encourage users to spend more meaningful time offline.

Software developer advocates for custom test fakes over mocking libraries · ShortSingh