# unit testing

Published articles for unit testing.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## API Testing Techniques Including Smoke, Functional, and Unit Testing

DevFeed: [API Testing Techniques Including Smoke, Functional, and Unit Testing](<https://devfeed.tech/articles/i-struggled-with-api-testing-until-i-learned-these-53-techniques-17908.md>)

Original publisher: [Read original article](<https://newsletter.systemdesign.one/p/api-testing-types>)

Author: Neo Kim

Published: 2026-08-31T11:19:11Z

Content type: article

Language: en

Sources: [System Design Newsletter](<https://devfeed.tech/sources/system-design-newsletter.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [api-testing](<https://devfeed.tech/tags/api-testing.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This article covers API testing techniques, including smoke testing, functional testing, unit testing, and 22 other techniques.

### Source excerpt

#173: Part 1 - smoke testing, functional testing, unit testing, and 22 others.

## Testing an Agent Harness Without Ever Calling the Model

DevFeed: [Testing an Agent Harness Without Ever Calling the Model](<https://devfeed.tech/articles/testing-an-agent-harness-without-ever-calling-the-model-34114.md>)

Original publisher: [Read original article](<https://philipptheserver.com/posts/testing-an-agent-harness/>)

Author: Philipp Lehmann (philipp.lehmann@gruppe.ai)

Published: 2026-07-31T07:00:00Z

Content type: tutorial

Language: en

Sources: [Philipp Lehmann](<https://devfeed.tech/sources/philipp-lehmann.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [Pytest](<https://devfeed.tech/topics/pytest.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [coding](<https://devfeed.tech/topics/coding.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-harness](<https://devfeed.tech/tags/agent-harness.md>), [agents](<https://devfeed.tech/tags/agents.md>), [api](<https://devfeed.tech/tags/api.md>), [network](<https://devfeed.tech/tags/network.md>), [permission](<https://devfeed.tech/tags/permission.md>), [pytest](<https://devfeed.tech/tags/pytest.md>), [python](<https://devfeed.tech/tags/python.md>), [recording](<https://devfeed.tech/tags/recording.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains how to unit test a coding agent's tool-call permission layer without calling a model. It recommends separating the decision function from model responses, using recorded real-request fixtures, and keeping the policy module independent of any LLM SDK.

### Source excerpt

Unit testing a coding agent's tool-call permission layer with pytest and recorded fixtures: allow, deny or ask decisions with no model or API key.

## How The New York Times is scaling Unit Test Coverage using AI Tools

DevFeed: [How The New York Times is scaling Unit Test Coverage using AI Tools](<https://devfeed.tech/articles/how-the-new-york-times-is-scaling-unit-test-coverage-using-ai-tools-39152.md>)

Original publisher: [Read original article](<https://open.nytimes.com/how-the-new-york-times-is-scaling-unit-test-coverage-using-ai-tools-fa796bf9b8d2?source=rss----51e1d1745b32---4>)

Author: The NYT Open Team

Published: 2026-01-13T18:51:55Z

Content type: article

Language: en

Sources: [New York Times](<https://devfeed.tech/sources/new-york-times.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Development](<https://devfeed.tech/topics/development.md>), [Web app](<https://devfeed.tech/topics/webapp.md>), [React](<https://devfeed.tech/topics/react.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-tools](<https://devfeed.tech/tags/ai-tools.md>), [code](<https://devfeed.tech/tags/code.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [development](<https://devfeed.tech/tags/development.md>), [reliability](<https://devfeed.tech/tags/reliability.md>), [scaling](<https://devfeed.tech/tags/scaling.md>), [software](<https://devfeed.tech/tags/software.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The New York Times describes using AI tools to expand unit-test coverage across its News site. The agents improved efficiency and coverage on critical code, but required strict human supervision and human review of the generated tests.

### Source excerpt

How AI tools are helping our software engineers write better tests at scaleIllustration by Nick Little By Eric Chima and Leonardo Quixadá At The New York Times, we're all excited to build fresh new experiences that delight our users. Our product managers are driven to find new ways to get our work in front of our audience and build reader engagement. Our engineers are motivated to solve unique technical challenges. And just when you think all that work is on track, breaking news strikes and all of our plans change at once. With all that going on, who could blame us if our test coverage couldn't quite keep up? Like every engineering organization, The Times deals with routine maintenance tasks: updating dependencies, cleaning up old code, maintaining accessibility standards, and, yes, building testing into all of our products. Our engineers are committed to quality, but when you work at the speed of news, there's always a new issue that needs to be addressed. Fortunately, generative AI has arrived with the promise of tidying up after us, taking care of the busy work, and giving time back to our developers to focus on feature development. But how far can you trust it? Recently, one of our platform teams used AI tools to build out unit tests across our flagship product, the News site. This was an opportunity for our testing to catch up with our rapid development. Our goal was to improve the reliability of our web app, but also to evaluate AI products and determine how far we could push them to do work in bulk across our codebase. As expected, the agents required strict human supervision, but they improved our efficiency in writing tests and let us quickly expand coverage on some of our most critical code. AI accelerates, but humans test the tests Unit tests are a crucial part of the development process. The idea is to divide application code into small pieces and write tests for each, creating guardrails to ensure that changing one piece of the site doesn't impact the r

## Lint Me: Test Sources 🖇

DevFeed: [Lint Me: Test Sources 🖇](<https://devfeed.tech/articles/lint-me-test-sources-26176.md>)

Original publisher: [Read original article](<https://zarah.dev/2025/12/02/lint-tests.html>)

Author: Zarah Dominguez

Published: 2025-12-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Zarah Dominguez](<https://devfeed.tech/sources/zarah-dominguez.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [files](<https://devfeed.tech/tags/files.md>), [flag](<https://devfeed.tech/tags/flag.md>), [lint](<https://devfeed.tech/tags/lint.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains how to configure an Android Lint TODO Detector to inspect test sources without enabling every normal Lint rule for those files. It covers the relevant scope configuration and adding unit-test coverage for the change.

### Source excerpt

It has been a year, which means it is once again time to re-examine our TODO Lint rule.

## Automating Exhaustive Branch Coverage for Sealed Types in Kotlin

DevFeed: [Automating Exhaustive Branch Coverage for Sealed Types in Kotlin](<https://devfeed.tech/articles/automating-exhaustive-branch-coverage-for-sealed-types-in-kotlin-20458.md>)

Original publisher: [Read original article](<https://eng.wealthfront.com/2025/11/20/sealed-tests/>)

Author: Sean Amos

Published: 2025-11-20T16:33:33Z

Content type: tutorial

Language: en

Sources: [Wealthfront](<https://devfeed.tech/sources/wealthfront.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [automation](<https://devfeed.tech/tags/automation.md>), [code](<https://devfeed.tech/tags/code.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-classes](<https://devfeed.tech/tags/sealed-classes.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [wealthfront-engineering](<https://devfeed.tech/tags/wealthfront-engineering.md>)

### AI overview

This article explains how to build an Exhaustive Test Runner for Kotlin sealed classes and interfaces. The approach ensures that functions accepting sealed parameters have at least one unit test for each subtype, including future subtypes added to the hierarchy.

### Source excerpt

We take code correctness and code quality seriously at Wealthfront. One of the most effective ways we ensure that our code is correct is through rigorous unit testing and strong typing. In Kotlin, sealed classes and sealed interfaces offer a powerful tool to model restricted class hierarchies. They provide strong guarantees about the types in... Read more

## Angular Zoneless Unit Testing

DevFeed: [Angular Zoneless Unit Testing](<https://devfeed.tech/articles/angular-zoneless-unit-testing-37461.md>)

Original publisher: [Read original article](<https://www.angularspace.com/angular-zoneless-unit-testing/>)

Author: Francesco Borzì

Published: 2025-09-30T06:30:10Z

Content type: tutorial

Language: en

Sources: [Daniel Glejzner](<https://devfeed.tech/sources/daniel-glejzner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [articles](<https://devfeed.tech/tags/articles.md>), [code](<https://devfeed.tech/tags/code.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

This tutorial explains how to adapt Angular unit tests for zoneless change detection. It recommends enabling provideZonelessChangeDetection(), avoiding unnecessary detectChanges() calls, and replacing Zone.js-dependent testing helpers as applications migrate away from Zone.js.

### Source excerpt

The Future Is Zoneless -- What Can We Do Today? You've probably heard: Angular is moving toward a Zoneless future. Migrating your Angular app to run without Zone.js brings several benefits, but for medium-to-large applications, the process might not be trivial. The good

## TDD & Commit: Is unit testing harmful? What about Rework/Refactoring?

DevFeed: [TDD & Commit: Is unit testing harmful? What about Rework/Refactoring?](<https://devfeed.tech/articles/tdd-commit-is-unit-testing-harmful-what-about-rework-refactoring-28433.md>)

Original publisher: [Read original article](<https://craftingtechteams.substack.com/p/tdd-and-commit-is-unit-testing-harmful>)

Author: Denis Čahuk

Published: 2025-07-26T06:54:19Z

Content type: article

Language: en

Sources: [Crafting Tech Teams](<https://devfeed.tech/sources/crafting-tech-teams.md>)

Topics: [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [refactoring](<https://devfeed.tech/tags/refactoring.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [video](<https://devfeed.tech/tags/video.md>)

### AI overview

A video talk examines how test-driven development relates to unit testing, refactoring, rework, and commit practices. It argues that testing problems usually stem from unclear intent, churn, poor test design, or misplaced tests rather than TDD itself.

### Source excerpt

A recording from Denis Čahuk's live video

## ☀ While I'm out: A 6-part deep dive on TDD, engineering culture and leadership

DevFeed: [☀ While I'm out: A 6-part deep dive on TDD, engineering culture and leadership](<https://devfeed.tech/articles/while-i-m-out-a-6-part-deep-dive-on-tdd-engineering-culture-and-leadership-28440.md>)

Original publisher: [Read original article](<https://craftingtechteams.substack.com/p/while-im-out-a-6-part-deep-dive-on>)

Author: Denis Čahuk

Published: 2025-07-17T14:03:59Z

Content type: article

Language: en

Sources: [Crafting Tech Teams](<https://devfeed.tech/sources/crafting-tech-teams.md>)

Topics: [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [engineering-culture](<https://devfeed.tech/topics/engineering-culture.md>)

Tags: [engineering-culture](<https://devfeed.tech/tags/engineering-culture.md>), [leadership](<https://devfeed.tech/tags/leadership.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The author announces a six-part Substack series based on earlier coaching streams and webinars. The series covers testing, mocking, TDD, engineering culture, team dynamics, and leadership, with posts scheduled from July 19 through July 26.

### Source excerpt

A Summer Deep-Dive on Testing, Design, and Teams from our previous webinars and coaching streams.

## Writing Clear, Focused Assertions in Unit Tests

DevFeed: [Writing Clear, Focused Assertions in Unit Tests](<https://devfeed.tech/articles/the-1-mistake-in-unit-testing-and-how-to-fix-it-26213.md>)

Original publisher: [Read original article](<https://craftbettersoftware.com/p/the-1-mistake-in-unit-testing-and>)

Author: Daniel Moka

Published: 2025-05-24T05:01:11Z

Content type: tutorial

Language: en

Sources: [Craft Better Software](<https://devfeed.tech/sources/craft-better-software.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [clean-code](<https://devfeed.tech/topics/clean-code.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [clean-code](<https://devfeed.tech/tags/clean-code.md>), [readability](<https://devfeed.tech/tags/readability.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [writing](<https://devfeed.tech/tags/writing.md>)

### AI overview

The article presents five practices for writing clean, expressive assertions in unit tests. It emphasizes testing one logical behavior per test, capturing domain knowledge through well-named helper functions, and treating tests as documentation.

### Source excerpt

Best practices to nail the most important part of your unit test

## Why Would you Write Tests before Code?

DevFeed: [Why Would you Write Tests before Code?](<https://devfeed.tech/articles/why-would-you-write-tests-before-code-28441.md>)

Original publisher: [Read original article](<https://craftingtechteams.substack.com/p/why-would-you-write-tests-before>)

Author: Denis Čahuk

Published: 2025-02-13T17:42:58Z

Content type: opinion

Language: en

Sources: [Crafting Tech Teams](<https://devfeed.tech/sources/crafting-tech-teams.md>)

Topics: [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [development](<https://devfeed.tech/tags/development.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [performance-testing](<https://devfeed.tech/tags/performance-testing.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The article explains test-driven development as writing tests before implementation to create refactoring capability early. It distinguishes capability testing, which verifies intended feature behavior, from regression testing, which records unexpected user-replicated behavior, and argues that TDD adoption depends more on a mindset shift toward higher-quality delivery than on additional workshops.

### Source excerpt

The Test-Driven Elephant In The Room

## Testing a React App in Chrome with Heroku CI

DevFeed: [Testing a React App in Chrome with Heroku CI](<https://devfeed.tech/articles/testing-a-react-app-in-chrome-with-heroku-ci-26500.md>)

Original publisher: [Read original article](<https://www.heroku.com/blog/testing-react-app-chrome-heroku-ci/>)

Author: Julián Duque

Published: 2024-09-24T20:11:00Z

Content type: tutorial

Language: en

Sources: [Heroku](<https://devfeed.tech/sources/heroku.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [Heroku](<https://devfeed.tech/topics/heroku.md>), [ci](<https://devfeed.tech/topics/ci.md>), [Playwright](<https://devfeed.tech/topics/playwright.md>), [Puppeteer](<https://devfeed.tech/topics/puppeteer.md>), [Headless Browser](<https://devfeed.tech/topics/headless-browser.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Jest](<https://devfeed.tech/topics/jest.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [ci](<https://devfeed.tech/tags/ci.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [download](<https://devfeed.tech/tags/download.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [github](<https://devfeed.tech/tags/github.md>), [google-chrome](<https://devfeed.tech/tags/google-chrome.md>), [guide](<https://devfeed.tech/tags/guide.md>), [heroku](<https://devfeed.tech/tags/heroku.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [jest](<https://devfeed.tech/tags/jest.md>), [react](<https://devfeed.tech/tags/react.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

### AI overview

This tutorial explains how to run end-to-end tests for a React application in Heroku CI using headless Chrome, Jest, and Puppeteer. It covers automating tests for a simple form-based application and configuring the application and test scripts for CI execution.

### Source excerpt

When building web applications, unit testing your individual components is certainly important. However, end-to-end testing provides assurance that the final user experience of your components chained together matches the expected behavior. Testing web application behavior locally in your browser can be helpful, but this approach isn't efficient or reliable, especially as your application grows more [...] The post Testing a React App in Chrome with Heroku CI appeared first on Heroku.

## Who Benefits Most from Cursor, Copilot, and Other AI Coding Assistants?

DevFeed: [Who Benefits Most from Cursor, Copilot, and Other AI Coding Assistants?](<https://devfeed.tech/articles/who-wins-with-cursor-copilot-33437.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2024/08/31/llm-pairing>)

Published: 2024-08-31T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [cursor](<https://devfeed.tech/topics/cursor.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [GitHub Copilot](<https://devfeed.tech/topics/github-copilot.md>), [pair\_programming](<https://devfeed.tech/topics/pair-programming.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [copilot](<https://devfeed.tech/tags/copilot.md>), [cursor](<https://devfeed.tech/tags/cursor.md>), [llm](<https://devfeed.tech/tags/llm.md>), [pair-programming](<https://devfeed.tech/tags/pair-programming.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This opinion article argues that the benefits of AI coding assistants such as Cursor and GitHub Copilot depend less on whether a programmer is simply good or bad and more on their strengths, weaknesses, temperament, and personality. It compares these tools with unit testing and pair programming, emphasizing that AI assistants can provide broad technical knowledge, speed, and brainstorming while still making mistakes and struggling with design and innovation.

### Source excerpt

Who wins now that Cursor is out? Good programmers? Bad programmers? Here, I make the case that it is more about your tempermant and personality traits. If you're good in the places where the AI is weak, you'll knock it out of the park.

## Coroutine Testing - Never ending tests & backgroundScope

DevFeed: [Coroutine Testing - Never ending tests & backgroundScope](<https://devfeed.tech/articles/coroutine-testing-never-ending-tests-backgroundscope-25236.md>)

Original publisher: [Read original article](<https://kau.sh/blog/coroutine-testing-backgroundscope/>)

Author: Kaushik Gopal

Published: 2024-08-30T07:00:45Z

Content type: tutorial

Language: en

Sources: [Kaushik Gopal's Site](<https://devfeed.tech/sources/kaushik-gopal-s-site.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [channel](<https://devfeed.tech/tags/channel.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutine-testing](<https://devfeed.tech/tags/coroutine-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [flow](<https://devfeed.tech/tags/flow.md>), [job](<https://devfeed.tech/tags/job.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

This tutorial explains why coroutine tests can time out when they collect from non-terminating Channels, SharedFlow, StateFlow, or ViewModel jobs. It presents manual Job cancellation and backgroundScope, which cancels child coroutines when the test body completes.

### Source excerpt

series This is part of a series of posts on Coroutine Testing: Picking the right Dispatcher Never ending tests & backgroundscope <- Controlling time Helpful @Junit TestRule extension (coming soon) Full USF example for Android (coming soon) If you've spent some time testing Coroutines this exception should look familiar: After waiting for 1m, the test coroutine is not completing, there were active child jobs This tends to happen when you have a coroutine job in your test, that fails to complete on its own. Let's take a simple example. src on github We use a Channel here which is the proverbial event bus for Coroutines. source: kotlinlang.org Channels don't terminate on their own. So when you run a simple test checking the emission, while the items might get collected correctly per the assert statement in the test, the test itself fails like so: test on github The test here is waiting for that coroutine job to complete, which in turn requires the Channel to, but that never happens and the test times out. Where else would I run into this problem? # Channels aren't the only case you'll run into this problem. For example if you use a "hot" Flow like SharedFlow or StateFlow, they don't terminate on their own, so the onus is on you to complete or cancel their Job in tests. Android developers can frequently run into this problem too if you use ViewModels and have an internal StateFlow providing your "view level data" (what i personally like to call "view state"). You typically use the viewModelScope to launch internal coroutine jobs in a ViewModel. The OS then calls the lifecycle method onClear when the Activity or Fragment no longer needs the ViewModel where all jobs started in the viewModelScope are canceled. But when unit testing these ViewModels, you don't have access to the viewModelScope and shouldn't need it anyway. Solving this problem # There's two ways to solve this problem: 1. Manually cancel the Job ## If you have access to the Job that spawns the never-ending co

## Test Failures Should Be Actionable

DevFeed: [Test Failures Should Be Actionable](<https://devfeed.tech/articles/test-failures-should-be-actionable-23857.md>)

Original publisher: [Read original article](<http://testing.googleblog.com/2024/05/test-failures-should-be-actionable.html>)

Author: Google Testing Bloggers (noreply@blogger.com)

Published: 2024-05-06T13:26:00Z

Content type: article

Language: en

Sources: [Google Testing Blog](<https://devfeed.tech/sources/google-testing-blog.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [site-reliability-engineering](<https://devfeed.tech/topics/site-reliability-engineering.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Pytest](<https://devfeed.tech/topics/pytest.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [pytest](<https://devfeed.tech/tags/pytest.md>), [site-reliability-engineering](<https://devfeed.tech/tags/site-reliability-engineering.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [testing](<https://devfeed.tech/tags/testing.md>), [titus-winters](<https://devfeed.tech/tags/titus-winters.md>), [tott](<https://devfeed.tech/tags/tott.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The article argues that unit test failures should be actionable: developers should be able to start investigating using only the test name and failure messages. It recommends precise invariants and assertion-library matchers, illustrating the point with a C++ status-check example.

### Source excerpt

This article was adapted from a Google Testing on the Toilet (TotT) episode. You can download a printer-friendly version of this TotT episode and post it in your office. By Titus Winters There are a lot of rules and best practices around unit testing. There are many posts on this blog; there is deeper material in the Software Engineering at Google book; there is specific guidance for every major language; there is guidance on test frameworks, test naming, and dozens of other test-related topics. Isn't this excessive? Good unit tests contain several important properties, but you could focus on a key principle: Test failures should be actionable. When a test fails, you should be able to begin investigation with nothing more than the test's name and its failure messages--no need to add more information and rerun the test. Effective use of unit test frameworks and assertion libraries (JUnit, Truth, pytest, GoogleTest, etc.) serves two important purposes. Firstly, the more precisely we express the invariants we are testing, the more informative and less brittle our tests will be. Secondly, when those invariants don't hold and the tests fail, the failure info should be immediately actionable. This meshes well with Site Reliability Engineering guidance on alerting. Consider this example of a C++ unit test of a function returning an absl::Status (an Abseil type that returns either an "OK" status or one of a number of different error codes): EXPECT_TRUE(LoadMetadata().ok()); EXPECT_OK(LoadMetadata()); Sample failure output load_metadata_test.cc:42: Failure Value of: LoadMetadata().ok() Expected: true Actual: false load_metadata_test.cc:42: Failure Value of: LoadMetadata() Expected: is OK Actual: NOT_FOUND: /path/to/metadata.bin If the test on the left fails, you have to investigate why the test failed; the test on the right immediately gives you all the available detail, in this case because of a more precise GoogleTest matcher. Here are some other posts on this blog that emp

## Updating to .NET 8, updating to IHostBuilder, and running Playwright Tests within NUnit headless or headed on any OS

DevFeed: [Updating to .NET 8, updating to IHostBuilder, and running Playwright Tests within NUnit headless or headed on any OS](<https://devfeed.tech/articles/updating-to-net-8-updating-to-ihostbuilder-and-running-playwright-tests-within-nunit-headless-or-headed-on-any-os-21858.md>)

Original publisher: [Read original article](<https://www.hanselman.com/blog/updating-to-net-8-updating-to-ihostbuilder-and-running-playwright-tests-within-nunit-headless-or-headed-on-any-os>)

Author: Scott Hanselman

Published: 2024-03-07T01:12:13Z

Content type: tutorial

Language: en

Sources: [Scott Hanselman](<https://devfeed.tech/sources/scott-hanselman.md>)

Topics: [Playwright](<https://devfeed.tech/topics/playwright.md>), [.NET](<https://devfeed.tech/topics/net.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Browser Automation](<https://devfeed.tech/topics/browser-automation.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>), [Selenium](<https://devfeed.tech/topics/selenium.md>), [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>)

Tags: [asp-net](<https://devfeed.tech/tags/asp-net.md>), [automation-testing](<https://devfeed.tech/tags/automation-testing.md>), [browser](<https://devfeed.tech/tags/browser.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [debug](<https://devfeed.tech/tags/debug.md>), [devops](<https://devfeed.tech/tags/devops.md>), [dotnetcore](<https://devfeed.tech/tags/dotnetcore.md>), [integration](<https://devfeed.tech/tags/integration.md>), [linux](<https://devfeed.tech/tags/linux.md>), [net](<https://devfeed.tech/tags/net.md>), [playwright](<https://devfeed.tech/tags/playwright.md>), [selenium](<https://devfeed.tech/tags/selenium.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [visual-studio](<https://devfeed.tech/tags/visual-studio.md>), [vs-code](<https://devfeed.tech/tags/vs-code.md>), [web](<https://devfeed.tech/tags/web.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

A tutorial on updating a .NET application to .NET 8 and running Playwright browser tests through NUnit. It explains the transition from IWebHostBuilder to IHostBuilder and describes cross-platform, headless or headed testing across local systems, containers, and CI environments.

### Source excerpt

I've been doing not just Unit Testing for my sites but full on Integration Testing and Browser Automation Testing as early as 2007 with Selenium. Lately, however, I've been using the faster and generally more compatible Playwright. It has one API and can test on Windows, Linux, Mac, locally, in a container (headless), in my CI/CD pipeline, on Azure DevOps, or in GitHub Actions. For me, it's that last moment of truth to make sure that the site runs completely from end to end. I can write those Playwright tests in something like TypeScript, and I could launch them with node, but I like running end unit tests and using that test runner and test harness as my jumping off point for my .NET applications. I'm used to right clicking and "run unit tests" or even better, right click and "debug unit tests" in Visual Studio or VS Code. This gets me the benefit of all of the assertions of a full unit testing framework, and all the benefits of using something like Playwright to automate my browser. In 2018 I was using WebApplicationFactory and some tricky hacks to basically spin up ASP.NET within .NET (at the time) Core 2.1 within the unit tests and then launching Selenium. This was kind of janky and would require to manually start a separate process and manage its life cycle. However, I kept on with this hack for a number of years basically trying to get the Kestrel Web Server to spin up inside of my unit tests. I've recently upgraded my main site and podcast site to .NET 8. Keep in mind that I've been moving my websites forward from early early versions of .NET to the most recent versions. The blog is happily running on Linux in a container on .NET 8, but its original code started in 2002 on .NET 1.1. Now that I'm on .NET 8, I scandalously discovered (as my unit tests stopped working) that the rest of the world had moved from IWebHostBuilder to IHostBuilder five version of .NET ago. Gulp. Say what you will, but the backward compatibility is impressive. As such my code for Progr

## Spotlight on SIG Testing

DevFeed: [Spotlight on SIG Testing](<https://devfeed.tech/articles/spotlight-on-sig-testing-17569.md>)

Original publisher: [Read original article](<https://www.kubernetes.dev/blog/2023/11/24/sig-testing-spotlight-2023/>)

Author: The Kubernetes Authors

Published: 2023-11-24T00:00:00Z

Content type: article

Language: en

Sources: [Kubernetes Contributors Blog](<https://devfeed.tech/sources/kubernetes-contributors-blog.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [developers](<https://devfeed.tech/tags/developers.md>), [e2e-testing](<https://devfeed.tech/tags/e2e-testing.md>), [go](<https://devfeed.tech/tags/go.md>), [intel](<https://devfeed.tech/tags/intel.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [logging](<https://devfeed.tech/tags/logging.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

An interview-style Kubernetes SIG spotlight introduces SIG Testing and its contributors, describing the group's work on testing tools, infrastructure, test-result analysis, E2E testing practices, and unit-testing approaches.

### Source excerpt

Welcome to another edition of the SIG spotlight blog series, where we highlight the incredible work being done by various Special Interest Groups (SIGs) within the Kubernetes project. In this edition, we turn our attention to SIG Testing , a group interested in effective testing of Kubernetes and automating away project toil. SIG Testing focus on creating and running tools and infrastructure that make it easier for the community to write and run tests, and to contribute, analyze and act upon test results. To gain some insights into SIG Testing, Sandipan Panda spoke with Michelle Shepardson , a senior software engineer at Google and a chair of SIG Testing, and Patrick Ohly , a software engineer and architect at Intel and a SIG Testing Tech Lead. Meet the contributors Sandipan: Could you tell us a bit about yourself, your role, and how you got involved in the Kubernetes project and SIG Testing? Michelle: Hi! I'm Michelle, a senior software engineer at Google. I first got involved in Kubernetes through working on tooling for SIG Testing, like the external instance of TestGrid. I'm part of oncall for TestGrid and Prow, and am now a chair for the SIG. Patrick: Hello! I work as a software engineer and architect in a team at Intel which focuses on open source Cloud Native projects. When I ramped up on Kubernetes to develop a storage driver, my very first question was "how do I test it in a cluster and how do I log information?" That interest led to various enhancement proposals until I had (re)written enough code that also took over official roles as SIG Testing Tech Lead (for the E2E framework ) and structured logging WG lead. Testing practices and tools Sandipan: Testing is a field in which multiple approaches and tools exist; how did you arrive at the existing practices? Patrick: I can't speak about the early days because I wasn't around yet 😆, but looking back at some of the commit history it's pretty obvious that developers just took what was available and started usi

## How To Ensure Exceptional Software Quality On Mobile

DevFeed: [How To Ensure Exceptional Software Quality On Mobile](<https://devfeed.tech/articles/how-to-ensure-exceptional-software-quality-on-mobile-35083.md>)

Original publisher: [Read original article](<https://novoda.com/blog/2023/09/26/how-to-ensure-exceptional-software-quality-on-mobile/>)

Author: Ben

Published: 2023-09-26T08:49:48Z

Content type: tutorial

Language: en

Sources: [Novoda](<https://devfeed.tech/sources/novoda.md>)

Topics: [Mobile](<https://devfeed.tech/topics/mobile.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>)

Tags: [engineering](<https://devfeed.tech/tags/engineering.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-development](<https://devfeed.tech/tags/mobile-development.md>), [mobile-devops](<https://devfeed.tech/tags/mobile-devops.md>), [mobile-engineering](<https://devfeed.tech/tags/mobile-engineering.md>), [quality](<https://devfeed.tech/tags/quality.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains software quality for mobile products through the testing pyramid, performance and stability metrics, scalability, and maintainability. It emphasizes unit tests as a foundation, followed by integration and UI tests to validate component interactions and user flows.

### Source excerpt

Explore the key ways to ensure exceptional software quality on mobile including the pyramid of testing, performance and stability metrics, scalability and maintainability. The post How To Ensure Exceptional Software Quality On Mobile appeared first on Novoda.

## Kotlin Coroutines Best Practices

DevFeed: [Kotlin Coroutines Best Practices](<https://devfeed.tech/articles/best-practices-39232.md>)

Original publisher: [Read original article](<https://kt.academy/article/cc-best-practices>)

Published: 2023-04-24T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [async](<https://devfeed.tech/topics/async.md>), [await](<https://devfeed.tech/topics/await.md>), [Android](<https://devfeed.tech/topics/android.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [backend](<https://devfeed.tech/tags/backend.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A concise review of Kotlin coroutine practices, including avoiding unnecessary async/await usage, preferring awaitAll in suitable cases, keeping suspending functions safe across threads, selecting appropriate dispatchers, injecting dispatchers for unit testing, and using yield in CPU-intensive or blocking work.

### Source excerpt

Let's review the Kotlin Coroutines best practices.

## Unit Testing ChatGPT Prompts: Introducing Riteway for SudoLang

DevFeed: [Unit Testing ChatGPT Prompts: Introducing Riteway for SudoLang](<https://devfeed.tech/articles/unit-testing-chatgpt-prompts-introducing-riteway-for-sudolang-20720.md>)

Original publisher: [Read original article](<https://medium.com/javascript-scene/unit-testing-chatgpt-prompts-introducing-riteway-for-sudolang-52761c34abc4?source=rss----c0aeac5284ad---4>)

Author: Eric Elliott

Published: 2023-04-03T21:11:26Z

Content type: article

Language: en

Sources: [Eric Elliot](<https://devfeed.tech/sources/eric-elliot.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Language models](<https://devfeed.tech/topics/language-models.md>), [ChatGPT](<https://devfeed.tech/topics/chatgpt.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Prompt Engineering](<https://devfeed.tech/topics/prompt-engineering.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [chatgpt](<https://devfeed.tech/tags/chatgpt.md>), [framework](<https://devfeed.tech/tags/framework.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [technology](<https://devfeed.tech/tags/technology.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The article introduces Riteway for SudoLang, a testing framework for unit-testing prompts and AI-generated outputs. It describes using constraints, requirements, and warnings to help language models produce code and tests that better satisfy specified requirements.

### Source excerpt

Running Riteway's usage example tests in SudoLang running on ChatGPT using GPT-4 I have been a long-time advocate of Test-Driven Development (TDD) because of its many productivity and quality benefits. You can read more about those in "TDD Changed My Life". When I realized that GPT-4 was capable of following complex instructions, one of the first things I thought of was trying to unit test prompts. To do that, I needed more precise control over the prompts. SudoLang is a powerful natural language, constraint-based pseudocode language for GPT-4 and other language model AIs. Since language model outputs can vary significantly and sometimes lack determinism, unit tests play a pivotal role in guaranteeing that the model adheres to all software requirements while generating implementations. Riteway has been my testing framework of choice since we built it during the development of educational software to test student code. With SudoLang, Riteway becomes even more powerful by allowing the language model to provide intelligent feedback on the quality of your tests, and by using intelligent inference to produce quality unit tests for non-deterministic AI-generated outputs. Constraints in SudoLang SudoLang is a constraint-based programming language inspired by the constraints in Ivan Sutherland's Sketchpad. In SudoLang, a constraint is a predefined condition or rule that the model should follow when generating and interpreting code. Constraints help improve the accuracy and relevance of the code functionality, ensuring that it meets the specified requirements. Constraints combine with AI's omnipotent inference to automatically and dynamically synchronize related state changes in SudoLang programs. A lot of the magic in Riteway for SudoLang comes from the powerful, AI-inferred omnipotent constraint solving. Riteway for SudoLang: Built-in Constraints, Requirements, and Warnings Riteway for SudoLang goes beyond traditional testing by incorporating constraints, requirements, and

## Interfaces 101 : Testing with a Mock Interface Ep. 8

DevFeed: [Interfaces 101 : Testing with a Mock Interface Ep. 8](<https://devfeed.tech/articles/interfaces-101-testing-with-a-mock-interface-ep-8-22220.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/03/interfaces-101-testing-with-a-mock-interface-ep-8.html>)

Published: 2023-03-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [client](<https://devfeed.tech/topics/client.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [health-check](<https://devfeed.tech/tags/health-check.md>), [http](<https://devfeed.tech/tags/http.md>), [http-roundtripper](<https://devfeed.tech/tags/http-roundtripper.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [mock-api](<https://devfeed.tech/tags/mock-api.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [video](<https://devfeed.tech/tags/video.md>)

### AI overview

This video tutorial explains how to design small, composable interfaces in Go and test an API client. It demonstrates performing HTTP requests and using a mock implementation to specify server response codes during unit testing.

### Source excerpt

Introduction In episode 7, Miki discussed design considerations to keep in mind while creating interfaces in Go with the first idea he proposed being that an interface should represent what we need from a type, and not what is stored on the type. To add some clarity to this thought, Miki explained how the io.Reader and io.Writer interfaces each require one method to be implemented although the underlying concrete type may store more information. The second idea he proposed was that interfaces should be small, with less than 6 methods, to ensure your code remains composable.

## React, Vite and TypeScript: Get started in under 2 minutes

DevFeed: [React, Vite and TypeScript: Get started in under 2 minutes](<https://devfeed.tech/articles/react-vite-and-typescript-get-started-in-under-2-minutes-21445.md>)

Original publisher: [Read original article](<https://nx.dev/blog/react-vite-and-typescript-get-started-in-under-2-minutes>)

Author: Juri Strumpflohner

Published: 2023-01-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Vite](<https://devfeed.tech/topics/vite.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code-generation](<https://devfeed.tech/tags/code-generation.md>), [development](<https://devfeed.tech/tags/development.md>), [nx](<https://devfeed.tech/tags/nx.md>), [react](<https://devfeed.tech/tags/react.md>), [routing](<https://devfeed.tech/tags/routing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tools](<https://devfeed.tech/tags/tools.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [vite](<https://devfeed.tech/tags/vite.md>)

### AI overview

A tutorial showing how to create a standalone React application with Vite and TypeScript using Nx. It covers scaffolding, project structure, running the application, and Nx targets, while noting built-in support for testing, linting, formatting, code generation, routing, and modularization.

### Source excerpt

Learn how to quickly set up a modern React application with Vite and TypeScript using Nx, featuring built-in testing, linting, and development tools.

## StateFlow and SharedFlow in ViewModels

DevFeed: [StateFlow and SharedFlow in ViewModels](<https://devfeed.tech/articles/stateflow-and-sharedflow-in-viewmodels-22664.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/stateflow-sharedflow-flow-viewmodel-lifecycle>)

Author: James Shvarts

Published: 2022-12-28T19:21:19Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Compose](<https://devfeed.tech/topics/compose.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [sharedflow](<https://devfeed.tech/tags/sharedflow.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

A practical guide to choosing between StateFlow and SharedFlow in Android ViewModels. It covers lifecycle-aware collection, exposing flows as UI state in view-based apps and Compose, and unit testing ViewModels that convert flows into state or shared events.

### Source excerpt

Collecting State and Shared Flows from ViewModels while respecting lifecycle of the collector views

## Effective Kotlin Item 5: Specify your expectations for arguments and state

DevFeed: [Effective Kotlin Item 5: Specify your expectations for arguments and state](<https://devfeed.tech/articles/effective-kotlin-item-5-specify-your-expectations-for-arguments-and-state-39278.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-expectations>)

Published: 2022-10-12T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Code](<https://devfeed.tech/topics/code.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [errors](<https://devfeed.tech/tags/errors.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [state](<https://devfeed.tech/tags/state.md>), [type-system](<https://devfeed.tech/tags/type-system.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains how to specify argument and state expectations in Kotlin using declarative checks such as argument checks, state checks, functions that signal unexpected states, and the Elvis operator. These checks make requirements visible, fail early with exceptions, help prevent partial state changes, and support smart casting.

### Source excerpt

How do we specify requirements and expectations in Kotlin.

## Stateful Testing for Android App State Logic

DevFeed: [Stateful Testing for Android App State Logic](<https://devfeed.tech/articles/top-notch-stateful-testing-in-android-25693.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/top-notch-stateful-testing-in-android>)

Author: Sergio Sastre Florez

Published: 2022-08-31T05:59:40Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [test](<https://devfeed.tech/topics/test.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [java](<https://devfeed.tech/tags/java.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [state](<https://devfeed.tech/tags/state.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [view](<https://devfeed.tech/tags/view.md>)

### AI overview

This tutorial explains stateful testing for Android applications by modeling app state, user actions, preconditions, and postconditions. It uses a text editor with text changes, undo, and redo as an example.

### Source excerpt

Broadly speaking, in an app, state is any value that can change over time. All Android apps display state to the user, e.g. an enabled/disabled button, the text displayed in a View, etc. We expect users to modify the state by performing actions throu...

[Next page](<https://devfeed.tech/tags/unit-testing.md?cursor=WyIyMDIyLTA4LTMxVDA1OjU5OjQwKzAwOjAwIiwgIjMzNmQ2N2IwLWM5MDAtNGUyNi05NmU5LTg4M2U4ZDMxYTVhMCJd>)