# unit test

Unit testing tests the smallest testable components of code to verify expected behavior and detect defects.

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

## 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

## Meta's TestGen-LLM uses verified LLM-generated improvements to expand existing unit-test coverage

DevFeed: [Meta's TestGen-LLM uses verified LLM-generated improvements to expand existing unit-test coverage](<https://devfeed.tech/articles/meta-s-new-llm-based-test-generator-is-a-sneak-peek-to-the-future-of-development-39094.md>)

Original publisher: [Read original article](<https://read.engineerscodex.com/p/metas-new-llm-based-test-generator>)

Author: Engineer's Codex

Published: 2024-02-23T07:34:54Z

Content type: article

Language: en

Sources: [Engineer's Codex](<https://devfeed.tech/sources/engineer-s-codex.md>)

Topics: [Meta](<https://devfeed.tech/topics/meta.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [developer](<https://devfeed.tech/tags/developer.md>), [development](<https://devfeed.tech/tags/development.md>), [llm](<https://devfeed.tech/tags/llm.md>), [meta](<https://devfeed.tech/tags/meta.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

This article examines Meta's TestGen-LLM, an internal system that uses large language models to generate candidate improvements for existing human-written unit tests. It describes an ensemble approach that filters candidates for correctness, improved code coverage, and non-regression before human review.

### Source excerpt

Meta's TestGen-LLM is a sneak peek to the future of developer productivity: specialized, orchestrated, and rigorously filtered.

## Create an application layer load balancer with Golang

DevFeed: [Create an application layer load balancer with Golang](<https://devfeed.tech/articles/create-an-application-layer-load-balancer-with-golang-32281.md>)

Original publisher: [Read original article](<https://domenicoluciani.com/2024/02/12/creating-an-application-layer-load-balancer.html>)

Author: Domenico Luciani

Published: 2024-02-11T23:00:00Z

Content type: tutorial

Language: en

Sources: [Domenico Luciani](<https://devfeed.tech/sources/domenico-luciani.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [nginx](<https://devfeed.tech/topics/nginx.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [health check](<https://devfeed.tech/topics/health-check.md>), [servers](<https://devfeed.tech/topics/servers.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [client](<https://devfeed.tech/topics/client.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [client](<https://devfeed.tech/tags/client.md>), [go](<https://devfeed.tech/tags/go.md>), [health-check](<https://devfeed.tech/tags/health-check.md>), [high-availability](<https://devfeed.tech/tags/high-availability.md>), [http](<https://devfeed.tech/tags/http.md>), [load-balancer](<https://devfeed.tech/tags/load-balancer.md>), [server](<https://devfeed.tech/tags/server.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

A tutorial describing the implementation of an application-layer load balancer in Golang. It explains HTTP request routing across multiple servers, health checks, handling servers going offline or returning online, and testing a request-forwarding component.

### Source excerpt

Since the last time I had too much fun, I wanted to repeat the experiment by taking another Coding Challenge. This time I'm gonna explain how I implemented an Application Load...

## Why clear, readable code is harder to write than clever code

DevFeed: [Why clear, readable code is harder to write than clever code](<https://devfeed.tech/articles/clever-code-is-probably-the-worst-code-you-could-write-39082.md>)

Original publisher: [Read original article](<https://read.engineerscodex.com/p/clever-code-is-probably-the-worst>)

Author: Engineer's Codex

Published: 2023-11-20T09:58:13Z

Content type: opinion

Language: en

Sources: [Engineer's Codex](<https://devfeed.tech/sources/engineer-s-codex.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [Code review](<https://devfeed.tech/topics/code-review.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [code-review](<https://devfeed.tech/tags/code-review.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

This opinion article argues that clever code, including code-golfing-style one-liners, is difficult to understand and debug. It contrasts that with clear, readable code and describes using smaller diffs, helper functions, refactoring, and reasonable unit test coverage to make a C++ change easier to review.

### Source excerpt

And clear, readable code is probably the hardest code to write

## Instantiate test data with Instantiator

DevFeed: [Instantiate test data with Instantiator](<https://devfeed.tech/articles/instantiate-test-data-with-instantiator-25469.md>)

Original publisher: [Read original article](<https://hannesdorfmann.com/instantiator/>)

Author: Hannes Dorfmann

Published: 2022-08-05T09:00:00Z

Content type: tutorial

Language: en

Sources: [Hannes Dorfmann](<https://devfeed.tech/sources/hannes-dorfmann.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [data](<https://devfeed.tech/topics/data.md>), [Library](<https://devfeed.tech/topics/library.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [data](<https://devfeed.tech/tags/data.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [library](<https://devfeed.tech/tags/library.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tool](<https://devfeed.tech/tags/tool.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

The article introduces Instantiator, a Kotlin library that uses reflection to fill objects with random test data. It is presented as a way to reduce the effort of creating test data for unit tests involving transformed backend data, pagination, and nested data classes.

### Source excerpt

I have noticed that most of the unit tests I write are testing how my code transforms data or business logic. My class or business logic just needs data as input (thus I need some test data to write unit tests). For example, most of my android apps load a list of items from the backend and then the android app is transforming that data into some state object or front-end specific domain objects.

## Our Android testing process

DevFeed: [Our Android testing process](<https://devfeed.tech/articles/our-android-testing-process-24579.md>)

Original publisher: [Read original article](<https://medium.com/headspace-engineering/our-android-testing-process-e055f1c7e15c?source=rss-3da90e297190------2>)

Author: Headspace

Published: 2022-06-22T05:16:52Z

Content type: article

Language: en

Sources: [Stories by Headspace on Medium](<https://devfeed.tech/sources/stories-by-headspace-on-medium.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-testing](<https://devfeed.tech/tags/android-testing.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [junit](<https://devfeed.tech/tags/junit.md>), [mental-health](<https://devfeed.tech/tags/mental-health.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [mobile-test-automation](<https://devfeed.tech/tags/mobile-test-automation.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [quality-assurance](<https://devfeed.tech/tags/quality-assurance.md>), [test-lab](<https://devfeed.tech/tags/test-lab.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

Headspace describes its Android testing strategy after rewriting its app, including unit-test coverage standards, selective end-to-end testing, mocking, dependency injection, Robolectric, and Firebase Test Lab.

### Source excerpt

Our testing strategy, how we integrate it into our development workflow, and what the future holds for testing at Headspace. By John Qualls, Senior Software Engineer, Greg Rami, Principal Software Engineer, and Anton Gerasimenko, Software Engineer Introduction When we took on the daunting task of rewriting our entire app at the end of 2019, one of our key focus areas was testability. At the time, we had less than 20% of our code covered by unit tests -- no integration or end-to-end (E2E) tests -- and adding any tests to the code base was a big effort. From the beginning, we agreed on the standard of at least 80% unit test coverage on all Pull Requests (PRs), E2E tests for critical flows, and an architecture that was focused on testability. The result is a more robust codebase. Today, we're able to capture critical bugs via our tests suite coverage before they hit our users and, very importantly, it's now trivial, and very fast, to add new tests. Let's detail our testing strategy, how we integrate it into our development workflow, and what the future holds for testing at Headspace. Testing Strategy Shortly after the rewrite, we had hundreds of unit tests and around twenty E2E tests. We wanted to optimize the number of E2E tests that we do to only certain use cases where it makes sense to take on the additional time and costs in exchange for the reduced risk. Test selection pyramid for cost and speedUnit Tests Our unit tests are straightforward. They test a very small unit of code by relying on JUnit 5 and different layers of mocking: MockK to mock all the dependencies that are unrelated to the current test. This is made easier by using good architecture principles such as Single Responsibility Principle (SRP) and Dependency Injection (DI) We introduced a Java Faker library, that provides "fakes" for primitive values that do not need to have a specific value Similarly, we have our own "model Fakers" that provide domain objects. That way when the underlying classes chang

## Slow unit tests: objects mocking

DevFeed: [Slow unit tests: objects mocking](<https://devfeed.tech/articles/slow-unit-tests-objects-mocking-26139.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2022/06/03/slow-unit-tests-part-1-objects-mocking.html>)

Author: Vadzimv Dev Blog

Published: 2022-06-03T09:00:00Z

Content type: article

Language: en

Sources: [vadzimv Dev Blog](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [junit](<https://devfeed.tech/tags/junit.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

This article measures factors that affect unit-test execution time, focusing on object mocking. It compares a baseline with real objects, manually written test doubles, and mocking libraries such as Mockito and Mockk. In the reported measurements, Mockito significantly increased execution time when creating the first mock, while repeated mocks and behavior verification had little additional cost.

### Source excerpt

What does make unit tests slow? Is it objects mocking?

## Compose Hackathon: Day 2.5

DevFeed: [Compose Hackathon: Day 2.5](<https://devfeed.tech/articles/compose-hackathon-day-2-5-30525.md>)

Original publisher: [Read original article](<https://blog.zachklipp.com/compose-hackathon-day-2-5/>)

Author: Zach Klippenstein

Published: 2022-05-04T19:49:00Z

Content type: opinion

Language: en

Sources: [Zach Klippenstein's Blog](<https://devfeed.tech/sources/zach-klippenstein-s-blog.md>)

Topics: [Hackathon](<https://devfeed.tech/topics/hackathon.md>), [Code](<https://devfeed.tech/topics/code.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Java](<https://devfeed.tech/topics/java.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [compose](<https://devfeed.tech/tags/compose.md>), [hackathon](<https://devfeed.tech/tags/hackathon.md>), [java](<https://devfeed.tech/tags/java.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [spring-2022-compose-hackathon](<https://devfeed.tech/tags/spring-2022-compose-hackathon.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

A progress report from day 2.5 of a Compose hackathon describes work on abstract and concrete piece-table implementations, including snapshot support, shared unit tests, and benchmarks. It also discusses the lack of a standard Java or Kotlin interface for efficient multi-character copying.

### Source excerpt

Well, so much for blogging every day. Better late than never, right? Anyway, I have a good excuse: I've been super busy writing code and tests, and it's not going terribly. I'm calling this day 2.5 since I was up a large part

## Understanding and Configuring your Kotlin Multiplatform Mobile Test Suite - Gustavo Fão Valvassori

DevFeed: [Understanding and Configuring your Kotlin Multiplatform Mobile Test Suite - Gustavo Fão Valvassori](<https://devfeed.tech/articles/understanding-and-configuring-your-kotlin-multiplatform-mobile-test-suite-gustavo-fao-valvassori-38342.md>)

Original publisher: [Read original article](<https://touchlab.co/understanding-and-configuring-your-kmm-test-suite>)

Published: 2022-01-11T21:22:39Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-multiplatform-mobile](<https://devfeed.tech/tags/kotlin-multiplatform-mobile.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [tests](<https://devfeed.tech/tags/tests.md>), [verify](<https://devfeed.tech/tags/verify.md>)

### AI overview

This tutorial explains how to configure the test suite in a Kotlin Multiplatform Mobile project. It distinguishes Android unit and instrumented tests, describes the corresponding source sets, and contrasts them with testing on iOS, where both types run in the same target by default.

### Source excerpt

Writing tests is part of every developer's day-to-day routine. They help you write better and more reliable code. In addition, they can verify that your code does what it was supposed to do, and your changes haven't introduced bugs. In this article, I'll show you how to configure the test suite from your KMM project.

## Android Native Text

DevFeed: [Android Native Text](<https://devfeed.tech/articles/android-native-text-26137.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/10/01/android-native-text.html>)

Author: Vadzimv Dev Blog

Published: 2021-10-01T09:00:00Z

Content type: tutorial

Language: en

Sources: [vadzimv Dev Blog](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Localization (l10n)](<https://devfeed.tech/topics/localization.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [locale](<https://devfeed.tech/tags/locale.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains how to handle Android string and plural resources in view models while avoiding stale text after configuration or language changes. It recommends storing resource IDs and arguments in view models, resolving localized text in the UI, and unit-testing the resulting parameters without directly interacting with the Android framework.

### Source excerpt

How to use Android String and Plurals resources in a View Model + Unit testing them.

## Finding the right abstraction (when working with Strings)

DevFeed: [Finding the right abstraction (when working with Strings)](<https://devfeed.tech/articles/finding-the-right-abstraction-when-working-with-strings-25436.md>)

Original publisher: [Read original article](<https://hannesdorfmann.com/abstraction-text-resource/>)

Author: Hannes Dorfmann

Published: 2021-01-22T09:00:00Z

Content type: tutorial

Language: en

Sources: [Hannes Dorfmann](<https://devfeed.tech/sources/hannes-dorfmann.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

A tutorial on introducing an abstraction layer for Android string resources. It explains how to handle simple, formatted, translated, and backend-provided text consistently, while keeping implementation details out of business logic and making ViewModels easier to test.

### Source excerpt

Finding the right abstraction is hard. In this blog post, I would like to share a technique that works well for us (my android teammates and me) when dealing with String resources on android. An abstraction layer for Strings? Why do we even need an abstraction to simply work with Strings on Android?

## ArchUnit

DevFeed: [ArchUnit](<https://devfeed.tech/articles/archunit-27311.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201908/archunit/>)

Published: 2019-08-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [Java](<https://devfeed.tech/topics/java.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [structure](<https://devfeed.tech/tags/structure.md>), [test](<https://devfeed.tech/tags/test.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This tutorial introduces ArchUnit, a free Java library for testing architecture conventions with standard Java unit test frameworks. It demonstrates checks for test naming conventions, package and class dependencies, and preventing internal classes from appearing in public APIs.

### Source excerpt

In the past, I've implemented couple of tests that aimed to verify naming conventions or some other practices team agreed upon. And presented a way how to ensure they are followed. When I've been writing those I was not aware that there is a library that aims to test architecture conventions - ArchUnit in this post I'll write a simple test case to check what's possible out of the box. Read more

## Architecting an iOS networking layer: Part 2

DevFeed: [Architecting an iOS networking layer: Part 2](<https://devfeed.tech/articles/architecting-an-ios-networking-layer-part-2-24562.md>)

Original publisher: [Read original article](<https://medium.com/bleeding-edge/architecting-an-ios-networking-layer-part-2-fe92a9231995?source=rss----d8ebe85cdc0f---4>)

Author: Melissa Yung

Published: 2019-04-01T10:05:31Z

Content type: tutorial

Language: en

Sources: [Bleeding Edge - Medium](<https://devfeed.tech/sources/bleeding-edge-medium.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [networking](<https://devfeed.tech/topics/networking.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [clean-code](<https://devfeed.tech/tags/clean-code.md>), [ios](<https://devfeed.tech/tags/ios.md>), [networking](<https://devfeed.tech/tags/networking.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [swift](<https://devfeed.tech/tags/swift.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

Part 2 demonstrates an iOS networking layer in a sample app. It shows how a view uses request configuration, an HTTP client, a request object, and event listeners to fetch forum posts through a REST API, and explains unit testing with mocks.

### Source excerpt

A sample project including unit tests to demo our clean architectureIllustration by Marta Pucci Welcome to Part 2 of this two part series, where we go through the networking layer we use in our iOS app at Clue. As a follow-up to Part 1, where we went through the main building blocks of our networking architecture, we would like to now show it in action in our demo app. This demo app consists of a simple view with a button that is used to fetch forum posts. Based on the success of the request, the UI is updated to reflect the number of fetched posts. We will use a fake online REST API https://jsonplaceholder.typicode.com/ to achieve this. The View For simplicity's sake, we will only focus on the bit that performs the network request i.e. fetchPosts. https://medium.com/media/62e814391f03e564236862388fcef9c2/href A. The view needs to keep a reference to the fetchPostsRequest instance to ensure that it doesn't get deallocated prematurely. B. The view puts together the required building blocks to make the service call i.e RequestConfiguration, HTTPClient, Request and RequestEventListenerFactory The Request Objecthttps://medium.com/media/11bdd42c97a15f6245aa97fe9ed64bd5/href A.1 and A.3 The request conforms to the HTTPClientDelegate protocol as we want to make a service call and handle its success or failure. A.1 and A.2 The request conforms to the RequestObserving protocol as we have interested listeners that want to be notified of the results once the service call is complete. This means that it has an eventListenerFactory which will provide a list of listeners. B. Both the required HTTPClient and the RequestEventListenerFactory are injected to the constructor to ensure testability. C. We need to set the request to be the delegate of the HTTPClient so that we can be notified when the service call returns. D. The only public interface is the actual call to perform the service call. It is public since this class lives in the networking layer module which is separate from

## Twitch for Android: From Meme to Dream

DevFeed: [Twitch for Android: From Meme to Dream](<https://devfeed.tech/articles/twitch-for-android-from-meme-to-dream-20456.md>)

Original publisher: [Read original article](<https://medium.com/twitch-news/twitch-for-android-from-meme-to-dream-141e6b7e8416?source=rss----3ae745429979--engineering>)

Author: Joaquim Verges

Published: 2019-02-26T21:45:39Z

Content type: article

Language: en

Sources: [Twitch](<https://devfeed.tech/sources/twitch.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [test](<https://devfeed.tech/topics/test.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [architecture-pattern](<https://devfeed.tech/tags/architecture-pattern.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [test](<https://devfeed.tech/tags/test.md>), [twitch](<https://devfeed.tech/tags/twitch.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

Twitch describes how its PogDroid Android app grew from a small app with basic streaming and chat functionality into a larger project. The team redesigned the app, rewrote much of it, introduced a common MVP architecture, and organized code into data, presentation, and view layers to make unit testing easier.

### Source excerpt

Meet PogDroid, our beloved Android app, to watch the latest memes unfold live while on the go. PogDroid started with very humble beginnings, and has seen incredible growth in the past couple of years. We quadrupled the team, redesigned the entire app, and rewrote most of it in only a few months using the latest and greatest Android has to offer. Buckle up: this is PogDroid's epic adventure. Level 1: Meme app with big dreams Back in March 2017, PogDroid was maintained by a very small team of engineers, and covered the most basic functionality of Twitch: browse and watch a stream with Chat. Old PogDroid, before the big makeover Mobile, and Android in particular, was getting more and more users, and the company decided it was time for a serious investment in PogDroid. The plan was to give the app a fresh new look, and build up some important features that were missing. The team grew only a little bit, but were tasked to take on this big project. As with most apps maintained by a very small team, the code structure was a mess. It became clear that such a big redesign compounded with adding new features could not be built cleanly on top of the current foundation. There was no common pattern to build screens, not a single unit test, and a lot of core classes were more than 3,000 lines of code long, with very complex state management, handling everything from network requests to UI rendering. We all agreed that in order to make PogDroid what we were dreaming of, we first needed to rethink its foundations. Step 1: Agree on a common architecture pattern The first thing we did is come up with a common design pattern to build features and screens. We wanted this design pattern to be: easy to understand hard to get wrong flexible enough to be applied to any feature or screen easy to unit test We quickly settled on a straightforward MVP pattern that looks like this: With these layers in mind, it became easy to categorize the type of classes we needed for every feature: Typical c

## Write that first complicated test

DevFeed: [Write that first complicated test](<https://devfeed.tech/articles/write-that-first-complicated-test-26279.md>)

Original publisher: [Read original article](<https://www.justinweiss.com/articles/write-that-first-complicated-test/>)

Author: Justin Weiss

Published: 2017-03-01T05:05:56Z

Content type: tutorial

Language: en

Sources: [Justin Weiss](<https://devfeed.tech/sources/justin-weiss.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Git](<https://devfeed.tech/topics/git.md>), [networking](<https://devfeed.tech/topics/networking.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [also](<https://devfeed.tech/tags/also.md>), [code](<https://devfeed.tech/tags/code.md>), [git](<https://devfeed.tech/tags/git.md>), [integration-test](<https://devfeed.tech/tags/integration-test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This article explains how to approach testing complicated code involving threads, commands, Git, networking, or user interfaces. It recommends investing in fakes, mocks, fixtures, and test-specific configuration, and using integration tests as a practical starting point when fast unit tests are difficult to write.

### Source excerpt

What code of yours isn't tested? Is it code that deals with complicated situations that you don't control? Threads, running commands, git, networking, or UI? Our apps are most interesting when they're complicated. They're also most dangerous. And that's why code that's hard to test is exactly the kind of code that needs to be tested well. That doesn't always happen. Instead, every time you touch that code, you touch lightly. You tread carefully. Maybe you do some manual testing. And when you send the pull request, you hope your teammates don't realize those tests don't exist. But that won't make things better. You'll run into the same problems, the same bugs, the same stress next time - and every time after that. How can you finally make those challenging tests something you can rely on? Shift your mindset The most frustrating thing about these tests? It's going to take ten times as long to write it as it feels like it should. If you estimate the time the test saves you against the time you spend writing the test, it just doesn't seem worth it. But it's not just about this test. It's about all your future tests. Most of the best-tested code I've seen has a lot of support. It's not just the code in test/models. Extremely well-tested code has fakes, it has mocks, it has a good set of test fixtures, it has configuration options specifically for the tests. All that takes time to write and put together. But once you have it, it feels so good. You can come up with test after test, feeling comfortable about your code, and confident in quickly you can move after the investment you've made. You can rely on the work you've already done. So it's not just about preventing bugs in complicated code. It's also about making future code easier to test, piece by piece. Make it an integration test (for now) Sometimes, though, it's not about understanding the value - I get it. Instead, I just get stuck because I can't figure out how to write a small, fast, unit test. How do you know yo

## Maintainability and Expect Literals

DevFeed: [Maintainability and Expect Literals](<https://devfeed.tech/articles/maintainability-and-expect-literals-31920.md>)

Original publisher: [Read original article](<http://blog.jayfields.com/2016/06/maintainability-and-expect-literals.html>)

Author: Jay (noreply@blogger.com)

Published: 2016-06-16T11:21:00Z

Content type: opinion

Language: en

Sources: [Jay Fields](<https://devfeed.tech/sources/jay-fields.md>)

Topics: [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [test](<https://devfeed.tech/topics/test.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [formatting](<https://devfeed.tech/topics/formatting.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [code](<https://devfeed.tech/tags/code.md>), [formatting](<https://devfeed.tech/tags/formatting.md>), [function](<https://devfeed.tech/tags/function.md>), [literals](<https://devfeed.tech/tags/literals.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [readability](<https://devfeed.tech/tags/readability.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.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>), [wewut](<https://devfeed.tech/tags/wewut.md>), [xunit](<https://devfeed.tech/tags/xunit.md>)

### AI overview

The author argues that literal expected values in unit tests improve readability and keep failures focused, while helper functions can broaden the scope of maintenance and couple tests. For changing or inconsistent strings, the article suggests duplication with bulk edits or testing variable-dependent behavior separately from formatting.

### Source excerpt

Recently, Stephen Schaub asked the following on the wewut group: Several of the unit test examples in the book verify the construction of both HTML and plain text strings. Jay recommends using literal strings in the assertions. However, this strikes me as not a particularly maintainable approach. If the requirements regarding the formatting of these strings changes (a very likely scenario), every single test that verifies one of these strings using a literal must be updated. Combined with the advice that each test should check only one thing, this leads to a large number of extremely brittle tests. Am I missing something here? I can appreciate the reasons Jay recommends using literals in the tests. However, it seems that we pay a high maintainability price in exchange for the improved readability. I responded to Stephen; however, I've seen similar questions asked a few times. Below are my extended thoughts regarding literals as expected values. In general, given the option of having many similar strings (or any literal) vs a helper function, I would always prefer the literal. When a test is failing I only care about that single failing test. If I have to look at the helper function I no longer have the luxury of staying focused on the single test; now I need to consider what the helper function is giving me and what it's giving all other callers. Suddenly the scope of my work has shifted from one test to all of the tests coupled by this helper function. If this helper function wasn't written by me, this expansion in scope wasn't even my decision, it was forced upon me by the helper function creator. In the best case the helper function could return a single, constant string. The scope expansion becomes even worse when the helper function contains code branches. As for alternatives, my solution would depend on the problem. If the strings were fairly consistent, I would likely simply duplicate everything knowing that any formatting changes can likely be addressed usin

## Massive View Controllers

DevFeed: [Massive View Controllers](<https://devfeed.tech/articles/massive-view-controllers-37508.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2015/09/21/massive-view-controllers/>)

Author: Marcus Zarra

Published: 2015-09-21T19:58:15Z

Content type: opinion

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Persistence](<https://devfeed.tech/topics/persistence.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [cocoa-touch](<https://devfeed.tech/tags/cocoa-touch.md>), [code](<https://devfeed.tech/tags/code.md>), [coding-practice](<https://devfeed.tech/tags/coding-practice.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [development](<https://devfeed.tech/tags/development.md>), [kvo-kvc](<https://devfeed.tech/tags/kvo-kvc.md>), [persistence](<https://devfeed.tech/tags/persistence.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

The article argues that view controllers should remain focused on presentation rather than containing network code. It recommends separate units for network requests, a top-level data controller, dependency injection, persistence through Core Data, and isolated unit testing.

### Source excerpt

While at Empirical Development and then MartianCraft I had been distanced from all of the inventive solutions that other development teams have been coming up with for the past few years. I was living in a bubble of our development teams. Now that I am working independently again, I am being exposed to a large [...]

## Elliptic Curves as Python Objects

DevFeed: [Elliptic Curves as Python Objects](<https://devfeed.tech/articles/elliptic-curves-as-python-objects-40347.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/02/24/elliptic-curves-as-python-objects/>)

Published: 2014-02-24T10:00:28Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [classes](<https://devfeed.tech/topics/classes.md>), [object](<https://devfeed.tech/topics/object.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [test](<https://devfeed.tech/topics/test.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [elliptic-curves](<https://devfeed.tech/tags/elliptic-curves.md>), [groups](<https://devfeed.tech/tags/groups.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [test](<https://devfeed.tech/tags/test.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This tutorial translates elliptic-curve point addition from its geometric and formal description into Python code. It introduces curve and point classes, associates each point with its curve, implements relevant operators, and includes checks that points lie on smooth curves.

### Source excerpt

Last time we saw a geometric version of the algorithm to add points on elliptic curves. We went quite deep into the formal setting for it (projective space $ \mathbb{P}^2$), and we spent a lot of time talking about the right way to define the "zero" object in our elliptic curve so that our issues with vertical lines would disappear. With that understanding in mind we now finally turn to code, and write classes for curves and points and implement the addition algorithm.

## Code coverage in django with 'coverage' and 'django-jenkins'

DevFeed: [Code coverage in django with 'coverage' and 'django-jenkins'](<https://devfeed.tech/articles/code-coverage-in-django-with-coverage-and-django-jenkins-35380.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/code-coverage-in-django-with-coverage-and-django-jenkins/>)

Author: Graham King

Published: 2012-03-15T17:59:38Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Django](<https://devfeed.tech/topics/django.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Jenkins](<https://devfeed.tech/topics/jenkins.md>), [ci](<https://devfeed.tech/topics/ci.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [django](<https://devfeed.tech/tags/django.md>), [jenkins](<https://devfeed.tech/tags/jenkins.md>), [python](<https://devfeed.tech/tags/python.md>), [software](<https://devfeed.tech/tags/software.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

A practical guide to measuring unit-test code coverage in Python and Django using coverage and django-jenkins. It explains how to limit test runs to the project's apps, generate HTML coverage reports, and use django-jenkins with Jenkins continuous integration.

### Source excerpt

"Boost your Django test coverage with ease: A practical guide"

## Introducing NetLint

DevFeed: [Introducing NetLint](<https://devfeed.tech/articles/introducing-netlint-33370.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2011/06/26/introducing-netlint>)

Published: 2011-06-26T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [javascript](<https://devfeed.tech/tags/javascript.md>), [nuget](<https://devfeed.tech/tags/nuget.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tool](<https://devfeed.tech/tags/tool.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [visual-studio](<https://devfeed.tech/tags/visual-studio.md>)

### AI overview

The article introduces NetLint, a tool that compares files listed in Visual Studio project files with files present on disk. It reports discrepancies through an exception, supports file-globbing exclusions, can be run from a unit test, and is distributed as a NuGet package under the MIT license.

### Source excerpt

Last week our QA guys wrote up a bug that one of our new pages wasn't working. After a little investigation I figured out it was just a JavaScript file that was inadvertently merged out of existence while resolving merge conflicts. We also had something like this happen where the app would run locally on developer boxes but would fail miserably when we deployed to the test environment.I don't really like giving the QA guys an excuse to blemish my reputation with bug reports, so I threw together a little tool to prevent this from ever happening again. Enter NetLint...NetLint processes Visual Studio project files (*.csproj, *.fsproj, etc) and compares files that exist in the project file and the files that actually exist on disk. So if a JavaScript file exists on disk but isn't in the project file, NetLint will throw an exception summarizing this and any other discrepancies.I also setup NetLint with simple file globbing functionality, so all files under bin/ and obj/ are ignored by default (you can also do custom patterns). I run NetLint from a unit test, so whenever anyone resolves merge conflicts they will instantaneously know if they missed a file.The future of NetLint will be a staging ground for testing conventions. I'm licensing it under the MIT license, so hopefully no one should have any reservations due to licensing. I also created a NuGet package to make it even easier to use

## Technical quality should be understood through its impact on FINN.no users

DevFeed: [Technical quality should be understood through its impact on FINN.no users](<https://devfeed.tech/articles/putting-a-face-on-quality-31952.md>)

Original publisher: [Read original article](<https://tech.finn.no2011/05/09/putting-a-face-on-quality/>)

Author: espen

Published: 2011-05-09T12:44:05Z

Content type: opinion

Language: en

Sources: [Finn.no](<https://devfeed.tech/sources/finn-no.md>)

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

Tags: [quality](<https://devfeed.tech/tags/quality.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>)

### AI overview

The article argues that discussions about testing, automation, zero defects, and unit-test coverage should remain connected to their impact on end users. At FINN.no, service quality means maintaining a dependable marketplace whose downtime or defects can prevent people from buying or selling important items.

### Source excerpt

The topic of ensuring quality in the services we provide is a much debated topic in our industry [1]. It tends to focus upon things such as testing and how to best automate it to try and reach a state of zero defects. These initiatives are great and we should all pursue them in our daily work. These debates tend to be very focused upon the technical side and how to prevent the intrusion of defects in our build cycle. A result of the technical focus is that you become abstracted from the real issues at hand and it becomes yet another ideological debate (or even worse yet another pissing contest between believers and non-believers). At FINN.no we try to always view things from an end-user perspective and technical quality is no different. So what does technical quality mean for our end users and do they really care? Making dreams come true A service such as FINN.no is much more than just a site where you view classified ads. It is a service where everyday people make some of their dreams come true. They buy the house they have been dreaming of in order to start a family. It is a place where you buy things to keep your kids safe and comfortable. So in order to answer the previous question, do they care about quality? Naturally. Down time on a Sunday at FINN.no prevents people from buying the house, the car or the boat of their dreams. You get the picture right? Quality of service means that we deliver on our promisse of being a marketplace you can rely on to make some of your dreams come true. Behind the discussions about unit-test coverage there is a family not getting their house, car or boat if you mess things up. When we debate whether to write tests up-front or do waterfall planning there is someone out there not getting their car sold. We get so caught up in technology some times that we actually think that it matters. In order to try and get more in touch with how our quality affects our users we realized we had to do something. When growing from a small company