home.social

#unittesting — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #unittesting, aggregated by home.social.

fetched live
  1. Is there a concept in #UnitTesting of a mock which decorates the original? I want to examine how many times something was called, but I want the real behaviour to happen. #phpunit #prophecy

  2. [Перевод] Победить Hibernate в тестах. Возможно?

    Победить Hibernate в тестах. Сможем? Всем, привет! На связи Михаил Поливаха, технический лидер Open Source проекта Axelix (проект, посвященный помочь вам идентифицировать частые проблемы в Java server-side приложениях, в т.ч в рамках работы с Hibernate). Данная, последняя статья является продолжением небольшой серии статей ответов на вопросы, которые возникли у участников Spring АйО Академии в рамках программы Hibernate. Я рассмотрю оставшиеся последние вопросы, а именно: “Можно ли в тестах как-то проверить, что Hibernate под капотом делает что-то страшное?” Тут очень важно не давать вам “рыбу”, а научить вас рыбачить, т.е. дать вам некоторый фреймворк о том, что стоит держать в уме при работе с Hibernate.

    habr.com/ru/companies/spring_a

    #java #hibernate #axelix #orm #sql #jpa #test #unittesting #springdata #springboot

  3. Indirect inputs and outputs are essential to understanding the different kinds of test doubles. This concept helps to determine when to use a dummy or stub, and when to use a spy or mock.

    You can read more in the following article:
    principal-it.eu/2020/04/indire

    #tdd #testdrivendevelopment #unittests #unittesting #softwaredesign

  4. Coding agents love hardcoded test fixtures.

    I wrote a Quarkus walkthrough that replaces EVT-001-style literals with Datafaker + Instancio, then teaches IBM Bob through a project skill so the next scaffold does not regress.

    the-main-thread.com/p/quarkus-

    #Java #Quarkus #Testing #UnitTesting

  5. Как нам в Домклик LLM рефакторинг делала

    Написал агента который за ночь переписал 100 тестов с Mockito на MockK, а за следующую — исправил 1700 ошибок линта. Спойлер: секрет не в крутом промпте, а в правильно выстроенном цикле — чётком DoD, автоматической проверке результата и обратной связи с моделью.

    habr.com/ru/companies/domclick

    #llm #llmагент #android #android_development #claude #opencode #unittesting

  6. Celebrating a smoother testing experience for the Go community! 🚀

    I’m excited to share that pgxmock v5.1.0 has officially been released!

    If you are using pgx for PostgreSQL in Go, this library remains one of the best ways to build robust unit tests without needing a live database.

    github.com/pashagolub/pgxmock/

  7. Локальное нагрузочное тестирование в Java с использованием Virtual Threads

    Всем привет! Меня зовут Михаил, я работаю главным экспертом в ОТП Банке. Я люблю тестировать свои решения и почти всегда пишу unit- и integration-тесты. Но вот с нагрузочным тестированием ситуация обычно совсем другая: о нем вспоминают ближе к релизу, когда архитектуру уже поздно менять. В какой-то момент я поймал себя на мысли: А как вообще заранее понять, сколько ресурсов будет потреблять сервис под нагрузкой? Сколько памяти съест приложение? Когда упрется в CPU? Как поведет себя БД при разном кол-ве запросов? Чтобы ответить на эти вопросы, я написал небольшую библиотеку для локального нагрузочного тестирования на Java Virtual Threads. Она запускает большое количество задач, собирает метрики и формирует отчет - прямо в консоли или в CSV. Сегодня я покажу сам подход, разберу код библиотеки и оставлю ссылку на GitHub-репозиторий, чтобы вы могли попробовать ее у себя или адаптировать под свои задачи.

    habr.com/ru/articles/1035238/

    #java #virtual_threads #multithreading #виртуальные_потоки #нагрузочное_тестирование #нагрузочное_тестрование #unittesting

  8. 𝐓𝐨𝐝𝐚𝐲, 𝐀𝐩𝐫𝐢𝐥 27, is the last day to secure your spot at the 𝐞𝐚𝐫𝐥𝐲-𝐛𝐢𝐫𝐝 𝐫𝐚𝐭𝐞 for my workshop 𝐖𝐞𝐥𝐥-𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐝 𝐓𝐞𝐬𝐭-𝐃𝐫𝐢𝐯𝐞𝐧 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐦𝐞𝐧𝐭. Join us on 𝐌𝐚𝐲 21-22, 2026 at 𝐓𝐡𝐞 𝐁𝐫𝐚𝐢𝐧 𝐄𝐦𝐛𝐚𝐬𝐬𝐲 𝐢𝐧 𝐀𝐧𝐭𝐰𝐞𝐫𝐩 .

    Don’t miss this final chance to invest in your skills at a reduced price.

    🔗 𝐒𝐞𝐜𝐮𝐫𝐞 𝐲𝐨𝐮𝐫 𝐬𝐩𝐨𝐭 𝐧𝐨𝐰.

    For more information: principal-it.eu/training/well-

    #tdd #testdrivendevelopment #unittests #unittesting #softwaredesign

  9. Knock knock.

    Who’s there?

    AI.

    AI who?

    AI think skipping unit tests just got harder to justify.

    #AI #UnitTesting

  10. Letting the implementation details of the Subject Under Test seep into your test code quickly becomes problematic. It harms readability, forcing readers to decipher the test’s behavior, sometimes even debug it, just to understand what’s happening. Tests should be simple and easy to understand! That’s why it’s crucial to keep the domain knowledge in the production code, and out of your tests.

    principal-it.eu/2020/09/preven

    #tdd #testdrivendevelopment #unittests #unittesting #softwaredesign

  11. Third-party tools aren't ideal—but they're essential. Apple's never solved SwiftUI testing. The community has. Meet ViewInspector. qualitycoding.org/viewinspecto #UnitTesting

  12. Quick update: I wrapped up adding test cases for tree widget of #GitRaven

    Its job is to construct tree like structures for given 1D paths like “foo/bar/baz.txt”

    Next up, diff generation logic needs to be tested. I wrote 2 test cases manually and got them to pass.

    Later, gave those two over to ChatGPT along with my enum declarations so it understands context and asked it to explain the code.

    Once I am happy with the answer, I asked it to come up with test cases.

    In this process, we came across a diff logic bug in the app.

    I confirmed the bug on the UI so writing test cases for this will prove to be very useful. A lot of learning in just a day!

    <rant>
    I am bittersweet about AI tech. It has its use cases but its run by not so trustworthy people for definitely not good intentions 🫠
    </rant>

    #unittesting #cpp #qttest