#unittests

Clare Sudberyclaresudbery
2025-06-13

How can you use code coverage and mutation testing to add tests to legacy code? At @mendercon last year, I demonstrated this powerful technique step by step on the Gilded Rose kata, which is hosted by @emilybache on her GitHub account: github.com/emilybache/GildedRo

You can watch the talk here: youtube.com/watch?v=0qna5cuzDI0

Jan Van Ryswyckjanvanryswyck
2025-06-03

Tomorrow I'll be hosting my hands-on lab "Fast Feedback Development By Avoiding The Fallacy Of Integrated End-To-End Tests" at @dddeu. Hope to see you there!

2025.dddeurope.com/program/fas

2025-05-30

Покрытие процедурного кода в ООП проекте юнит-тестами в C++

Legacy проекты на С++ зачастую являются многокомпонентными, когда продукт использует несколько библиотек, которые имеют различную архитектуру для работы с ними. Обычно это: библиотеки, поставляемые как ООП решение (Некоторые модули boost, SOCI как пример) библиотеки, реализованные в функциональном стиле (OpenGL через С API, POSIX как пример) Из-за этого в итоговом проекте появляются сущности, которые внутри реализованы через классы, но внутри методов класса идет обращение к обычным функциям. Некоторые библиотеки имеют специфичные функции, которые для своей работы требуют первоначальную инициализацию. Как пример: поиск подключенных устройств и получение на них ссылок для дальнейшей работы или функции, которые требуют инициализации большого количества памяти. Вследствие этого возникает вопрос - как лучше реализовать покрытие юнит-тестами специфичных объектов, которые внутри себя имеют функции, требующие специальных условий для своей работы?

habr.com/ru/companies/megafon/

#c++ #gtest #google_testing_framework #mocking #unittesting #unittests

Jan Van Ryswyckjanvanryswyck
2025-05-27

Next week, I'll be hosting a hands-on lab "Fast Feedback Development By Avoiding The Fallacy Of Integrated End-To-End Tests" at 2025. In this workshop, we’re going to address the underlying issues caused by integrated E2E tests. You’ll be able to practice how to apply trustworthy collaboration and contract tests to gain the same level of confidence as integrated E2E tests without all the hassle.

2025.dddeurope.com/program/fas

Already looking forward to it!

Jan Van Ryswyckjanvanryswyck
2025-05-01

For me this approach of writing tests after the production code add too much overhead to the development process. I like to prevent such unnecessary headaches. That's why I find Test-Driven Development to be the most effective approach to developing software.

Jan Van Ryswyckjanvanryswyck
2025-04-29

Test-Driven Development can be considered as reducing your WIP (Work-In-Progress) at a microlevel. By focusing on writing just enough code to make a failing test pass, refactoring what you added and push to source control, we minimise the amount of unexecuted code (= WIP). Limiting WIP is essential for fast software delivery.

Thiago Bomfimthiagobfim
2025-04-09

Testing is a crucial activity to guarantee the software keeps working after fixing a bug or adding a new feature.

Read more 👉 lttr.ai/AQ1jo

Helsinki PythonHelPy@fosstodon.org
2025-04-02

🇫🇮🐍 Welcome to this month's meetup on Tuesday 15th April 2025 at Reaktor!

Talks:

🧪 @maaretp - Exploratory Unit Testing with and for GenAI

🪈 Toni Vanhala - Stable and Observable: Celery Setup Essentials for SQL Pipelines

⁉️ And the famous HelPy quiz!

meetup.com/helpy-meetups/event

See you there!

#HelPy #Helsinki #Python #meetup #testing #UnitTests #GenAI #Celery #SQL #Pipelines

2025-03-28

Hey Mastodon, question for my #sysadmin and #DevOps types. Has anyone used #Pester and #PSScriptAnalyzer to set up unit testing for test driven development, particularly on (relatively) simple #PowerShell scripts like you might use for application detection, installation, and uninstallation from a system like #SCCM #Intune or #ManageEngine ?

Apologies for the buzzword bingo, but I’m trying to reach folks who may be following the hashtags, but not necessarily have a connection otherwise.

#TDD #unittests

Jan Van Ryswyckjanvanryswyck
2025-03-27

"A high-risk decision is a gambling decision between a direct cost to mitigate a risk, and the potential indirect cost of ignoring the risk. One of the most common high-risk decisions in software development is skipping unit tests in an attempt to save time." - Janelle Arty Starr

Johannes Schnattererschnatterer@floss.social
2025-03-24

Who writes #unittests for #helm #charts? 🙋

Same as for code, they speed up development and prevent recursions.

The helm-unittest plugin makes them easy to use.
github.com/helm-unittest/helm-

While contributing to the kube-prometheus-stack chart last year, I discovered that the project contains a small suite of unit tests implemented in helm-unittest.

I found helm-unittest easy to read, write and execute. See for yourself 👇️

Terminal emulator showing this command:
helm unittest . -f  unittests/prometheus/scrape_config_selector_test.yaml 

And its output

 PASS  test scrapeConfigSelector        unittests/prometheus/scrape_config_selector_test.yaml

Charts:      1 passed, 1 total
Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshot:    0 passed, 0 total
Time:        152.612251msYAML definition of a Helm unit test.
Test file can be found at this URL
https://github.com/prometheus-community/helm-charts/blob/1251b0/charts/kube-prometheus-stack/unittests/prometheus/scrape_config_selector_test.yaml
Jan Van Ryswyckjanvanryswyck
2025-03-20

I'll be hosting a hands-on lab "Fast Feedback Development By Avoiding The Fallacy Of Integrated End-To-End Tests" at Domain-Driven Design Europe 2025. In this workshop, we’re going to address the underlying issues caused by integrated end-to-end tests.

2025.dddeurope.com/program/fas

Hope to meet you there!

Gary "grim" Kramlichgrimmy
2025-03-13

@pidgin Also if anyone wants to explore more themselves, meson makes this really easy.

From the top of our source tree you can run meson with the following command

meson build -Db_coverage=true -Dgplugin:vapi=false build-coverage

The vala bindings need to be disabled because the confuse gcovr.

Once configuration is done you can run the tests and generate the coverage report with the following

cd build-coverage
ninja turtles
ninja coverage-html

Gary "grim" Kramlichgrimmy
2025-03-13

@pidgin Some more info. Keep in mind that the 130 suites include libraries we maintain as well, but the code coverage here does not include.

Also, the coverage includes, libpurple, pidgin, and the protocol plugins and that pidgin and the protocol plugins aren't exactly testable although we have some stuff we're working on for that.

A screen shot of gcovr output for pidgin3.

The biggest notes are 

lines: 56.4% (20011 out of 35486)
functions: 61.3% (2524 out of 4115)
branches: 36.6% (7294 out of 19925)
2025-03-07

Heard in a meeting today: "There is a saying that OSHA rules are written in blood. Similarly, good Unit Tests are written in support tickets."

#softwareengineering #unittests

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst