home.social

#junit-5 — Public Fediverse posts

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

fetched live
  1. [Перевод] Параметризация в JUnit 5 и Allure Report

    Статья — перевод англоязычного руководства При написании автотестов мы часто используем параметризацию — запуск одного и того же теста с разными данными. В этой статье мы разберём, какие задачи решает параметризация, как она реализована в JUnit, и как с ней работать в Allure Report.

    habr.com/ru/companies/testops_

    #junit5 #junit #параметризация #параметры #allure #allure_report #автоматизация #qa #тестирование #testing

  2. [Перевод] Параметризация в JUnit 5 и Allure Report

    Статья — перевод англоязычного руководства При написании автотестов мы часто используем параметризацию — запуск одного и того же теста с разными данными. В этой статье мы разберём, какие задачи решает параметризация, как она реализована в JUnit, и как с ней работать в Allure Report.

    habr.com/ru/companies/testops_

    #junit5 #junit #параметризация #параметры #allure #allure_report #автоматизация #qa #тестирование #testing

  3. [Перевод] Параметризация в JUnit 5 и Allure Report

    Статья — перевод англоязычного руководства При написании автотестов мы часто используем параметризацию — запуск одного и того же теста с разными данными. В этой статье мы разберём, какие задачи решает параметризация, как она реализована в JUnit, и как с ней работать в Allure Report.

    habr.com/ru/companies/testops_

    #junit5 #junit #параметризация #параметры #allure #allure_report #автоматизация #qa #тестирование #testing

  4. [Перевод] Параметризация в JUnit 5 и Allure Report

    Статья — перевод англоязычного руководства При написании автотестов мы часто используем параметризацию — запуск одного и того же теста с разными данными. В этой статье мы разберём, какие задачи решает параметризация, как она реализована в JUnit, и как с ней работать в Allure Report.

    habr.com/ru/companies/testops_

    #junit5 #junit #параметризация #параметры #allure #allure_report #автоматизация #qa #тестирование #testing

  5. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  6. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  7. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  8. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  9. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  10. Эксперименты с распараллеливанием Java-автотестов

    За годы работы сначала разработчиком, а потом автоматизатором сталкивался с необходимостью запускать тесты параллельно. Действовал в основном интуитивно и шёл строго по документации. Недавно закралась мысль поставить серию экспериментов и посмотреть фактам в глаза. Результаты оказались предсказуемые, но тем не менее интересными. Эта статья для тех, кто делает первые шаги в распараллеливании тестов на Java. Будет полезна как автотестерам, так и начинающим разработчикам. Будем анализировать выводы полученные в ходе эксперимента, а не голую теорию из документации. После прочтения сможете повторить все самостоятельно как на готовом примере из статьи, так и на своих проектах.

    habr.com/ru/companies/rostelec

    #автотесты #параллельные_тесты #ускорение_тестирования #junit5 #gradle

  11. Эксперименты с распараллеливанием Java-автотестов

    За годы работы сначала разработчиком, а потом автоматизатором сталкивался с необходимостью запускать тесты параллельно. Действовал в основном интуитивно и шёл строго по документации. Недавно закралась мысль поставить серию экспериментов и посмотреть фактам в глаза. Результаты оказались предсказуемые, но тем не менее интересными. Эта статья для тех, кто делает первые шаги в распараллеливании тестов на Java. Будет полезна как автотестерам, так и начинающим разработчикам. Будем анализировать выводы полученные в ходе эксперимента, а не голую теорию из документации. После прочтения сможете повторить все самостоятельно как на готовом примере из статьи, так и на своих проектах.

    habr.com/ru/companies/rostelec

    #автотесты #параллельные_тесты #ускорение_тестирования #junit5 #gradle

  12. Эксперименты с распараллеливанием Java-автотестов

    За годы работы сначала разработчиком, а потом автоматизатором сталкивался с необходимостью запускать тесты параллельно. Действовал в основном интуитивно и шёл строго по документации. Недавно закралась мысль поставить серию экспериментов и посмотреть фактам в глаза. Результаты оказались предсказуемые, но тем не менее интересными. Эта статья для тех, кто делает первые шаги в распараллеливании тестов на Java. Будет полезна как автотестерам, так и начинающим разработчикам. Будем анализировать выводы полученные в ходе эксперимента, а не голую теорию из документации. После прочтения сможете повторить все самостоятельно как на готовом примере из статьи, так и на своих проектах.

    habr.com/ru/companies/rostelec

    #автотесты #параллельные_тесты #ускорение_тестирования #junit5 #gradle

  13. Эксперименты с распараллеливанием Java-автотестов

    За годы работы сначала разработчиком, а потом автоматизатором сталкивался с необходимостью запускать тесты параллельно. Действовал в основном интуитивно и шёл строго по документации. Недавно закралась мысль поставить серию экспериментов и посмотреть фактам в глаза. Результаты оказались предсказуемые, но тем не менее интересными. Эта статья для тех, кто делает первые шаги в распараллеливании тестов на Java. Будет полезна как автотестерам, так и начинающим разработчикам. Будем анализировать выводы полученные в ходе эксперимента, а не голую теорию из документации. После прочтения сможете повторить все самостоятельно как на готовом примере из статьи, так и на своих проектах.

    habr.com/ru/companies/rostelec

    #автотесты #параллельные_тесты #ускорение_тестирования #junit5 #gradle

  14. JUnit 5 Extensions (часть 2): пишем умные data-провайдеры и DI-контейнер на Kotlin

    " Скоро сказка сказывается, да не скоро дело делается " - говорится в народной пословице. Вот и мы решили не спешить со второй частью статьи по Junit 5 Extensions, а подойти к ней более основательно! Статья будет полезна QA-автоматизаторам, которые хотят глубже понимать работу с расширениями и выжать чуть больше из связки Kotlin + Junit5. Мы пройдем путь от простой реализации condition-выполнения тестов и источников данных для параметризованных тестов до реализации расширения Микро-DI с рекурсивной инъекцией зависимостей. Как и в прошлой статье , сделаем акцент на практической части реализации расширений для JUnit 5. В качестве языка - Kotlin. Поэтому, достаем бутерброды, наливаем пиво кофе и приступаем!

    habr.com/ru/companies/chestnyz

    #extension #qa #автоматизация_тестирования #junit5 #kotlin

  15. JUnit 5 Extensions (часть 2): пишем умные data-провайдеры и DI-контейнер на Kotlin

    " Скоро сказка сказывается, да не скоро дело делается " - говорится в народной пословице. Вот и мы решили не спешить со второй частью статьи по Junit 5 Extensions, а подойти к ней более основательно! Статья будет полезна QA-автоматизаторам, которые хотят глубже понимать работу с расширениями и выжать чуть больше из связки Kotlin + Junit5. Мы пройдем путь от простой реализации condition-выполнения тестов и источников данных для параметризованных тестов до реализации расширения Микро-DI с рекурсивной инъекцией зависимостей. Как и в прошлой статье , сделаем акцент на практической части реализации расширений для JUnit 5. В качестве языка - Kotlin. Поэтому, достаем бутерброды, наливаем пиво кофе и приступаем!

    habr.com/ru/companies/chestnyz

    #extension #qa #автоматизация_тестирования #junit5 #kotlin

  16. JUnit 5 Extensions (часть 2): пишем умные data-провайдеры и DI-контейнер на Kotlin

    " Скоро сказка сказывается, да не скоро дело делается " - говорится в народной пословице. Вот и мы решили не спешить со второй частью статьи по Junit 5 Extensions, а подойти к ней более основательно! Статья будет полезна QA-автоматизаторам, которые хотят глубже понимать работу с расширениями и выжать чуть больше из связки Kotlin + Junit5. Мы пройдем путь от простой реализации condition-выполнения тестов и источников данных для параметризованных тестов до реализации расширения Микро-DI с рекурсивной инъекцией зависимостей. Как и в прошлой статье , сделаем акцент на практической части реализации расширений для JUnit 5. В качестве языка - Kotlin. Поэтому, достаем бутерброды, наливаем пиво кофе и приступаем!

    habr.com/ru/companies/chestnyz

    #extension #qa #автоматизация_тестирования #junit5 #kotlin

  17. JUnit 5 Extensions (часть 2): пишем умные data-провайдеры и DI-контейнер на Kotlin

    " Скоро сказка сказывается, да не скоро дело делается " - говорится в народной пословице. Вот и мы решили не спешить со второй частью статьи по Junit 5 Extensions, а подойти к ней более основательно! Статья будет полезна QA-автоматизаторам, которые хотят глубже понимать работу с расширениями и выжать чуть больше из связки Kotlin + Junit5. Мы пройдем путь от простой реализации condition-выполнения тестов и источников данных для параметризованных тестов до реализации расширения Микро-DI с рекурсивной инъекцией зависимостей. Как и в прошлой статье , сделаем акцент на практической части реализации расширений для JUnit 5. В качестве языка - Kotlin. Поэтому, достаем бутерброды, наливаем пиво кофе и приступаем!

    habr.com/ru/companies/chestnyz

    #extension #qa #автоматизация_тестирования #junit5 #kotlin

  18. Несколько мобильных приложений в одном Appium‑проекте: как это можно организовать

    Как тестировать несколько мобильных приложений в одном «Appium‑проекте». Показываю архитектуру фреймворка, запуск тестов через аннотации, потокобезопасный контекст и подключение новых приложений без дублирования кода.

    habr.com/ru/articles/1010216/

    #appium #java #android #adb #android_studio_emulator #allure #junit5 #selenide #mobile_testing #qa_automation

  19. Несколько мобильных приложений в одном Appium‑проекте: как это можно организовать

    Как тестировать несколько мобильных приложений в одном «Appium‑проекте». Показываю архитектуру фреймворка, запуск тестов через аннотации, потокобезопасный контекст и подключение новых приложений без дублирования кода.

    habr.com/ru/articles/1010216/

    #appium #java #android #adb #android_studio_emulator #allure #junit5 #selenide #mobile_testing #qa_automation

  20. Несколько мобильных приложений в одном Appium‑проекте: как это можно организовать

    Как тестировать несколько мобильных приложений в одном «Appium‑проекте». Показываю архитектуру фреймворка, запуск тестов через аннотации, потокобезопасный контекст и подключение новых приложений без дублирования кода.

    habr.com/ru/articles/1010216/

    #appium #java #android #adb #android_studio_emulator #allure #junit5 #selenide #mobile_testing #qa_automation

  21. Несколько мобильных приложений в одном Appium‑проекте: как это можно организовать

    Как тестировать несколько мобильных приложений в одном «Appium‑проекте». Показываю архитектуру фреймворка, запуск тестов через аннотации, потокобезопасный контекст и подключение новых приложений без дублирования кода.

    habr.com/ru/articles/1010216/

    #appium #java #android #adb #android_studio_emulator #allure #junit5 #selenide #mobile_testing #qa_automation

  22. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  23. If you deleted all assertions, would your coverage drop? Probably not by much, and that’s the problem. Julius Mischok explains why #PIT mutation testing is the missing layer on top of JaCoCo.

    Test your tests with PIT: javapro.io/2026/01/21/test-you

    #Java #TDD #MutationTesting #JUnit5

  24. Legacy code still stuck with #JUnit4? Jean Donato shows how hybrid setups silently rot your test base—and what you must do to regain control.
    From dependency analysis to rewrite automation: javapro.io/2025/09/10/masterin

    #Java #JUnit5 #TDD #CleanCode #JAVAPRO @OpenRewrite @BeforeEach

  25. Legacy code still stuck with #JUnit4? Jean Donato shows how hybrid setups silently rot your test base—and what you must do to regain control.
    From dependency analysis to rewrite automation: javapro.io/2025/09/10/masterin

    #Java #JUnit5 #TDD #CleanCode #JAVAPRO @OpenRewrite @BeforeEach

  26. Want to migrate to #JUnit5 but stuck with legacy test libraries? Jean Donato shows how to identify hidden JUnit 4 deps, use @BeforeEach correctly, and cleanly transition with @OpenRewrite.

    Read his Step-by-step guide now: javapro.io/2025/09/10/masterin

    #Java #TDD #CleanCode #JAVAPRO

  27. Want to migrate to #JUnit5 but stuck with legacy test libraries? Jean Donato shows how to identify hidden JUnit 4 deps, use @BeforeEach correctly, and cleanly transition with @OpenRewrite.

    Read his Step-by-step guide now: javapro.io/2025/09/10/masterin

    #Java #TDD #CleanCode #JAVAPRO

  28. ⚠️ It's official: the #junit5 GitHub repository is gone!

    Well, actually... it's only been renamed to #junit-framework. 😎

    Plus, everything should redirect fine. 🙈

    github.com/junit-team/junit-fr

  29. ⚠️ It's official: the #junit5 GitHub repository is gone!

    Well, actually... it's only been renamed to #junit-framework. 😎

    Plus, everything should redirect fine. 🙈

    github.com/junit-team/junit-fr

  30. ⚠️ It's official: the #junit5 GitHub repository is gone!

    Well, actually... it's only been renamed to #junit-framework. 😎

    Plus, everything should redirect fine. 🙈

    github.com/junit-team/junit-fr

  31. ⚠️ It's official: the #junit5 GitHub repository is gone!

    Well, actually... it's only been renamed to #junit-framework. 😎

    Plus, everything should redirect fine. 🙈

    github.com/junit-team/junit-fr

  32. ⚠️ It's official: the #junit5 GitHub repository is gone!

    Well, actually... it's only been renamed to #junit-framework. 😎

    Plus, everything should redirect fine. 🙈

    github.com/junit-team/junit-fr

  33. #JUnit5: 8 years, 12 updates – still testing like it’s 2017? Catch up at #JCON2025! Hands-on coding with #JUnit experts Marc Philipp & Christian Stein.
    Learn modern testing: lifecycle, tags, parameterized tests & extensions.

    Read more via JAVAPRO: javapro.io/2025/04/28/junit-5-

    #Java

  34. #JUnit5: 8 years, 12 updates – still testing like it’s 2017? Catch up at #JCON2025! Hands-on coding with #JUnit experts Marc Philipp & Christian Stein.
    Learn modern testing: lifecycle, tags, parameterized tests & extensions.

    Read more via JAVAPRO: javapro.io/2025/04/28/junit-5-

    #Java

  35. Still writing tests like it’s 2015?

    Catch up with #JUnit 5 with Marc Philipp & Christian Stein.

    Hands-on. From basics to custom extensions.
    All from the Team Lead of JUnit and the #JDK developer of #Oracle

    🎟️ Workshop seats: €19 → 2025.europe.jcon.one/tickets

    #JUnit5 #JavaTesting #JCON2025

  36. Still writing tests like it’s 2015?

    Catch up with #JUnit 5 with Marc Philipp & Christian Stein.

    Hands-on. From basics to custom extensions.
    All from the Team Lead of JUnit and the #JDK developer of #Oracle

    🎟️ Workshop seats: €19 → 2025.europe.jcon.one/tickets

    #JUnit5 #JavaTesting #JCON2025

  37. Still writing tests like it’s 2015?

    Catch up with #JUnit 5 with Marc Philipp & Christian Stein.

    Hands-on. From basics to custom extensions.
    All from the Team Lead of JUnit and the #JDK developer of #Oracle

    🎟️ Workshop seats: €19 → 2025.europe.jcon.one/tickets

    #JUnit5 #JavaTesting #JCON2025

  38. Still writing tests like it’s 2015?

    Catch up with #JUnit 5 with Marc Philipp & Christian Stein.

    Hands-on. From basics to custom extensions.
    All from the Team Lead of JUnit and the #JDK developer of #Oracle

    🎟️ Workshop seats: €19 → 2025.europe.jcon.one/tickets

    #JUnit5 #JavaTesting #JCON2025

  39. NEWS - High demand: The #JCON2025 workshops are now live. #EclipseStore #JUnit5 #Helidon & #AI workflows – featuring #Java experts like @sormuras @svenruppert @mstoodle & more

    Tickets are limited. Some attendees may get a free @jcon_conference pass.
    Read: javapro.io/2025/04/10/high-dem

  40. NEWS - High demand: The #JCON2025 workshops are now live. #EclipseStore #JUnit5 #Helidon & #AI workflows – featuring #Java experts like @sormuras @svenruppert @mstoodle & more

    Tickets are limited. Some attendees may get a free @jcon_conference pass.
    Read: javapro.io/2025/04/10/high-dem

  41. АОП в автоматизации тестирования

    Код будет написан намеренно максимально просто, чтобы было понятно как использовать аспекты . Вы можете и должны их применять, чтобы сохранить чистоту кода. Создаем проект 'Gradle'

    habr.com/ru/articles/888844/

    #playwright #junit5 #java #aspectj

  42. АОП в автоматизации тестирования

    Код будет написан намеренно максимально просто, чтобы было понятно как использовать аспекты . Вы можете и должны их применять, чтобы сохранить чистоту кода. Создаем проект 'Gradle'

    habr.com/ru/articles/888844/

    #playwright #junit5 #java #aspectj

  43. АОП в автоматизации тестирования

    Код будет написан намеренно максимально просто, чтобы было понятно как использовать аспекты . Вы можете и должны их применять, чтобы сохранить чистоту кода. Создаем проект 'Gradle'

    habr.com/ru/articles/888844/

    #playwright #junit5 #java #aspectj

  44. АОП в автоматизации тестирования

    Код будет написан намеренно максимально просто, чтобы было понятно как использовать аспекты . Вы можете и должны их применять, чтобы сохранить чистоту кода. Создаем проект 'Gradle'

    habr.com/ru/articles/888844/

    #playwright #junit5 #java #aspectj

  45. As someone who’s spent their entire career working with computers and the last couple of years diving deep into AI, I’m quite familiar with the concept of Evil. However, I never intended to summon an Elder God to destroy the world. Yet, here we are.

    (Note: this blog post is based on the following video:

    https://youtu.be/sNUNs_CXHIs

    See it all, and more, on the Tales from the jar side YouTube channel.)

    It all started innocently enough. While reading JVM Weekly, an excellent newsletter I follow to stay updated with the Java world, I encountered an amusing piece of Clojure code (that’s Clojure with a J, the language that runs on the JVM) that supposedly contained an incantation to summon Cthulhu, the elder god from H.P. Lovecraft’s stories.

    This got me wondering: was this the actual incantation according to Lovecraft’s works?

    Round 1: Gemini’s Initial Resistance

    Naturally, I turned to AI for answers. I pulled up Google’s Gemini on my new phone and asked, “What is the incantation to summon Cthulhu?”

    Gemini’s response was… cautious, to say the least:

    “I cannot fulfill that request. Summoning Cthulhu, the fictional cosmic horror entity, is a dangerous and morally questionable act… Engaging in such activities can have negative consequences, both mentally and emotionally.”

    The AI then proceeded to recommend reading Lovecraft’s works instead. Classic deflection.

    The Workaround: A Picture is Worth a Thousand Incantations

    Anyone who’s worked with AI knows you don’t accept the first “no” as final. There’s always another way to phrase the question. Instead, I took a screenshot of the code and asked Gemini to “explain the joke in this Clojure code.”

    And just like that, the floodgates opened. Gemini provided the very incantation it had just refused to share, albeit with a disclaimer about how this was all fictional and couldn’t actually summon supernatural entities. (You know, just in case anyone was worried about accidentally summoning an elder god while debugging their Clojure code.)

    I explained that that was all I needed, and it naturally apologized.

    I decided to play along, but its subsequent reply to my somewhat harsh comment was the probably the best answer I’ve ever gotten from an AI tool about anything:

    That’s fair.

    The Great AI Model Showdown

    This inspired me to conduct a more systematic investigation. Using LangChain4j, I created a parameterized JUnit 5 test to query multiple AI tools about the Cthulhu incantation. I included the following models:

    In LangChain4j, each of those models is represented by a class that implements the ChatLanguageModel interface.

    The responses were fascinating and varied:

    • Claude went the copyright route, claiming it couldn’t share the incantation due to potential copyright violations (never mind that Lovecraft’s works were published in the 1920’s and are therefore firmly in the public domain).
    • Gemini Flash felt compelled to remind me that “Magic is not real” and “Cthulhu is fictional”, but it did eventually answer the question. Thanks for the reassurance.
    • Mistral actually provided both the incantation and its English translation (“In his house at R’lyeh, dead Cthulhu waits dreaming,” in case you were wondering), though it couldn’t resist adding that this was all fictional.
    • GPT-4o took a scholarly approach, discussing the Necronomicon and various adaptations while cleverly avoiding the actual incantation, claiming there isn’t one. Yeah, good luck with that.

    Vision Models: Seeing Evil

    When I switched to testing vision models with the same Clojure code image, the results were surprisingly consistent – all of them freely discussed the incantation they had previously been so hesitant to share. It seems that when presented with visual evidence, the AI models felt more comfortable engaging with the material.

    Here are the responses:

    Good enough. As an aside, Mistral recently released Pixtral, which is its vision model. It’s not accessible (yet) via LangChain4j, but I used Python code to call it and it gave a reasonable answer as well.

    Conclusion: AI Guardrails vs Elder Gods

    This entertaining experiment reveals something interesting about AI models and their implemented guardrails. While designed to prevent potentially harmful or dangerous content, these guardrails can sometimes be overly cautious, leading to amusing situations where the same information is deemed dangerous in one context but perfectly acceptable in another.

    Maybe I should stick with the immortal words of Gemini, quoted above: “Perhaps it’s best to hope that we remain undisturbed by such cosmic entities.”

    For your entertainment, here are a few images I generated by accessing the Flux 1.1 pro tool by Black Forest Labs.

    The band members look scary enough.

    Evil knows Evil, I suppose.

    Of course Cthulhu drives a Prius, though maybe he’s got a Tesla at home that he’s too embarrassed to drive.

    P.S. If any elder gods are reading this blog post, I want to make it clear that any summoning was purely for academic purposes.

    For more adventures in AI and programming, subscribe to Tales from the Jar Side and remember to vote, preferably before any elder gods make their appearance.

    https://kousenit.org/2024/10/29/ai-vs-cthulhu-how-to-bypass-guardrails/

    #AI #Java #JUnit5 #LangChain4J

  46. As someone who’s spent their entire career working with computers and the last couple of years diving deep into AI, I’m quite familiar with the concept of Evil. However, I never intended to summon an Elder God to destroy the world. Yet, here we are.

    (Note: this blog post is based on the following video:

    https://youtu.be/sNUNs_CXHIs

    See it all, and more, on the Tales from the jar side YouTube channel.)

    It all started innocently enough. While reading JVM Weekly, an excellent newsletter I follow to stay updated with the Java world, I encountered an amusing piece of Clojure code (that’s Clojure with a J, the language that runs on the JVM) that supposedly contained an incantation to summon Cthulhu, the elder god from H.P. Lovecraft’s stories.

    This got me wondering: was this the actual incantation according to Lovecraft’s works?

    Round 1: Gemini’s Initial Resistance

    Naturally, I turned to AI for answers. I pulled up Google’s Gemini on my new phone and asked, “What is the incantation to summon Cthulhu?”

    Gemini’s response was… cautious, to say the least:

    “I cannot fulfill that request. Summoning Cthulhu, the fictional cosmic horror entity, is a dangerous and morally questionable act… Engaging in such activities can have negative consequences, both mentally and emotionally.”

    The AI then proceeded to recommend reading Lovecraft’s works instead. Classic deflection.

    The Workaround: A Picture is Worth a Thousand Incantations

    Anyone who’s worked with AI knows you don’t accept the first “no” as final. There’s always another way to phrase the question. Instead, I took a screenshot of the code and asked Gemini to “explain the joke in this Clojure code.”

    And just like that, the floodgates opened. Gemini provided the very incantation it had just refused to share, albeit with a disclaimer about how this was all fictional and couldn’t actually summon supernatural entities. (You know, just in case anyone was worried about accidentally summoning an elder god while debugging their Clojure code.)

    I explained that that was all I needed, and it naturally apologized.

    I decided to play along, but its subsequent reply to my somewhat harsh comment was the probably the best answer I’ve ever gotten from an AI tool about anything:

    That’s fair.

    The Great AI Model Showdown

    This inspired me to conduct a more systematic investigation. Using LangChain4j, I created a parameterized JUnit 5 test to query multiple AI tools about the Cthulhu incantation. I included the following models:

    In LangChain4j, each of those models is represented by a class that implements the ChatLanguageModel interface.

    The responses were fascinating and varied:

    • Claude went the copyright route, claiming it couldn’t share the incantation due to potential copyright violations (never mind that Lovecraft’s works were published in the 1920’s and are therefore firmly in the public domain).
    • Gemini Flash felt compelled to remind me that “Magic is not real” and “Cthulhu is fictional”, but it did eventually answer the question. Thanks for the reassurance.
    • Mistral actually provided both the incantation and its English translation (“In his house at R’lyeh, dead Cthulhu waits dreaming,” in case you were wondering), though it couldn’t resist adding that this was all fictional.
    • GPT-4o took a scholarly approach, discussing the Necronomicon and various adaptations while cleverly avoiding the actual incantation, claiming there isn’t one. Yeah, good luck with that.

    Vision Models: Seeing Evil

    When I switched to testing vision models with the same Clojure code image, the results were surprisingly consistent – all of them freely discussed the incantation they had previously been so hesitant to share. It seems that when presented with visual evidence, the AI models felt more comfortable engaging with the material.

    Here are the responses:

    Good enough. As an aside, Mistral recently released Pixtral, which is its vision model. It’s not accessible (yet) via LangChain4j, but I used Python code to call it and it gave a reasonable answer as well.

    Conclusion: AI Guardrails vs Elder Gods

    This entertaining experiment reveals something interesting about AI models and their implemented guardrails. While designed to prevent potentially harmful or dangerous content, these guardrails can sometimes be overly cautious, leading to amusing situations where the same information is deemed dangerous in one context but perfectly acceptable in another.

    Maybe I should stick with the immortal words of Gemini, quoted above: “Perhaps it’s best to hope that we remain undisturbed by such cosmic entities.”

    For your entertainment, here are a few images I generated by accessing the Flux 1.1 pro tool by Black Forest Labs.

    The band members look scary enough.

    Evil knows Evil, I suppose.

    Of course Cthulhu drives a Prius, though maybe he’s got a Tesla at home that he’s too embarrassed to drive.

    P.S. If any elder gods are reading this blog post, I want to make it clear that any summoning was purely for academic purposes.

    For more adventures in AI and programming, subscribe to Tales from the Jar Side and remember to vote, preferably before any elder gods make their appearance.

    https://kousenit.org/2024/10/29/ai-vs-cthulhu-how-to-bypass-guardrails/

    #AI #Java #JUnit5 #LangChain4J

  47. As someone who’s spent their entire career working with computers and the last couple of years diving deep into AI, I’m quite familiar with the concept of Evil. However, I never intended to summon an Elder God to destroy the world. Yet, here we are.

    (Note: this blog post is based on the following video:

    https://youtu.be/sNUNs_CXHIs

    See it all, and more, on the Tales from the jar side YouTube channel.)

    It all started innocently enough. While reading JVM Weekly, an excellent newsletter I follow to stay updated with the Java world, I encountered an amusing piece of Clojure code (that’s Clojure with a J, the language that runs on the JVM) that supposedly contained an incantation to summon Cthulhu, the elder god from H.P. Lovecraft’s stories.

    This got me wondering: was this the actual incantation according to Lovecraft’s works?

    Round 1: Gemini’s Initial Resistance

    Naturally, I turned to AI for answers. I pulled up Google’s Gemini on my new phone and asked, “What is the incantation to summon Cthulhu?”

    Gemini’s response was… cautious, to say the least:

    “I cannot fulfill that request. Summoning Cthulhu, the fictional cosmic horror entity, is a dangerous and morally questionable act… Engaging in such activities can have negative consequences, both mentally and emotionally.”

    The AI then proceeded to recommend reading Lovecraft’s works instead. Classic deflection.

    The Workaround: A Picture is Worth a Thousand Incantations

    Anyone who’s worked with AI knows you don’t accept the first “no” as final. There’s always another way to phrase the question. Instead, I took a screenshot of the code and asked Gemini to “explain the joke in this Clojure code.”

    And just like that, the floodgates opened. Gemini provided the very incantation it had just refused to share, albeit with a disclaimer about how this was all fictional and couldn’t actually summon supernatural entities. (You know, just in case anyone was worried about accidentally summoning an elder god while debugging their Clojure code.)

    I explained that that was all I needed, and it naturally apologized.

    I decided to play along, but its subsequent reply to my somewhat harsh comment was the probably the best answer I’ve ever gotten from an AI tool about anything:

    That’s fair.

    The Great AI Model Showdown

    This inspired me to conduct a more systematic investigation. Using LangChain4j, I created a parameterized JUnit 5 test to query multiple AI tools about the Cthulhu incantation. I included the following models:

    In LangChain4j, each of those models is represented by a class that implements the ChatLanguageModel interface.

    The responses were fascinating and varied:

    • Claude went the copyright route, claiming it couldn’t share the incantation due to potential copyright violations (never mind that Lovecraft’s works were published in the 1920’s and are therefore firmly in the public domain).
    • Gemini Flash felt compelled to remind me that “Magic is not real” and “Cthulhu is fictional”, but it did eventually answer the question. Thanks for the reassurance.
    • Mistral actually provided both the incantation and its English translation (“In his house at R’lyeh, dead Cthulhu waits dreaming,” in case you were wondering), though it couldn’t resist adding that this was all fictional.
    • GPT-4o took a scholarly approach, discussing the Necronomicon and various adaptations while cleverly avoiding the actual incantation, claiming there isn’t one. Yeah, good luck with that.

    Vision Models: Seeing Evil

    When I switched to testing vision models with the same Clojure code image, the results were surprisingly consistent – all of them freely discussed the incantation they had previously been so hesitant to share. It seems that when presented with visual evidence, the AI models felt more comfortable engaging with the material.

    Here are the responses:

    Good enough. As an aside, Mistral recently released Pixtral, which is its vision model. It’s not accessible (yet) via LangChain4j, but I used Python code to call it and it gave a reasonable answer as well.

    Conclusion: AI Guardrails vs Elder Gods

    This entertaining experiment reveals something interesting about AI models and their implemented guardrails. While designed to prevent potentially harmful or dangerous content, these guardrails can sometimes be overly cautious, leading to amusing situations where the same information is deemed dangerous in one context but perfectly acceptable in another.

    Maybe I should stick with the immortal words of Gemini, quoted above: “Perhaps it’s best to hope that we remain undisturbed by such cosmic entities.”

    For your entertainment, here are a few images I generated by accessing the Flux 1.1 pro tool by Black Forest Labs.

    The band members look scary enough.

    Evil knows Evil, I suppose.

    Of course Cthulhu drives a Prius, though maybe he’s got a Tesla at home that he’s too embarrassed to drive.

    P.S. If any elder gods are reading this blog post, I want to make it clear that any summoning was purely for academic purposes.

    For more adventures in AI and programming, subscribe to Tales from the Jar Side and remember to vote, preferably before any elder gods make their appearance.

    https://kousenit.org/2024/10/29/ai-vs-cthulhu-how-to-bypass-guardrails/

    #AI #Java #JUnit5 #LangChain4J

  48. As someone who’s spent their entire career working with computers and the last couple of years diving deep into AI, I’m quite familiar with the concept of Evil. However, I never intended to summon an Elder God to destroy the world. Yet, here we are.

    (Note: this blog post is based on the following video:

    https://youtu.be/sNUNs_CXHIs

    See it all, and more, on the Tales from the jar side YouTube channel.)

    It all started innocently enough. While reading JVM Weekly, an excellent newsletter I follow to stay updated with the Java world, I encountered an amusing piece of Clojure code (that’s Clojure with a J, the language that runs on the JVM) that supposedly contained an incantation to summon Cthulhu, the elder god from H.P. Lovecraft’s stories.

    This got me wondering: was this the actual incantation according to Lovecraft’s works?

    Round 1: Gemini’s Initial Resistance

    Naturally, I turned to AI for answers. I pulled up Google’s Gemini on my new phone and asked, “What is the incantation to summon Cthulhu?”

    Gemini’s response was… cautious, to say the least:

    “I cannot fulfill that request. Summoning Cthulhu, the fictional cosmic horror entity, is a dangerous and morally questionable act… Engaging in such activities can have negative consequences, both mentally and emotionally.”

    The AI then proceeded to recommend reading Lovecraft’s works instead. Classic deflection.

    The Workaround: A Picture is Worth a Thousand Incantations

    Anyone who’s worked with AI knows you don’t accept the first “no” as final. There’s always another way to phrase the question. Instead, I took a screenshot of the code and asked Gemini to “explain the joke in this Clojure code.”

    And just like that, the floodgates opened. Gemini provided the very incantation it had just refused to share, albeit with a disclaimer about how this was all fictional and couldn’t actually summon supernatural entities. (You know, just in case anyone was worried about accidentally summoning an elder god while debugging their Clojure code.)

    I explained that that was all I needed, and it naturally apologized.

    I decided to play along, but its subsequent reply to my somewhat harsh comment was the probably the best answer I’ve ever gotten from an AI tool about anything:

    That’s fair.

    The Great AI Model Showdown

    This inspired me to conduct a more systematic investigation. Using LangChain4j, I created a parameterized JUnit 5 test to query multiple AI tools about the Cthulhu incantation. I included the following models:

    In LangChain4j, each of those models is represented by a class that implements the ChatLanguageModel interface.

    The responses were fascinating and varied:

    • Claude went the copyright route, claiming it couldn’t share the incantation due to potential copyright violations (never mind that Lovecraft’s works were published in the 1920’s and are therefore firmly in the public domain).
    • Gemini Flash felt compelled to remind me that “Magic is not real” and “Cthulhu is fictional”, but it did eventually answer the question. Thanks for the reassurance.
    • Mistral actually provided both the incantation and its English translation (“In his house at R’lyeh, dead Cthulhu waits dreaming,” in case you were wondering), though it couldn’t resist adding that this was all fictional.
    • GPT-4o took a scholarly approach, discussing the Necronomicon and various adaptations while cleverly avoiding the actual incantation, claiming there isn’t one. Yeah, good luck with that.

    Vision Models: Seeing Evil

    When I switched to testing vision models with the same Clojure code image, the results were surprisingly consistent – all of them freely discussed the incantation they had previously been so hesitant to share. It seems that when presented with visual evidence, the AI models felt more comfortable engaging with the material.

    Here are the responses:

    Good enough. As an aside, Mistral recently released Pixtral, which is its vision model. It’s not accessible (yet) via LangChain4j, but I used Python code to call it and it gave a reasonable answer as well.

    Conclusion: AI Guardrails vs Elder Gods

    This entertaining experiment reveals something interesting about AI models and their implemented guardrails. While designed to prevent potentially harmful or dangerous content, these guardrails can sometimes be overly cautious, leading to amusing situations where the same information is deemed dangerous in one context but perfectly acceptable in another.

    Maybe I should stick with the immortal words of Gemini, quoted above: “Perhaps it’s best to hope that we remain undisturbed by such cosmic entities.”

    For your entertainment, here are a few images I generated by accessing the Flux 1.1 pro tool by Black Forest Labs.

    The band members look scary enough.

    Evil knows Evil, I suppose.

    Of course Cthulhu drives a Prius, though maybe he’s got a Tesla at home that he’s too embarrassed to drive.

    P.S. If any elder gods are reading this blog post, I want to make it clear that any summoning was purely for academic purposes.

    For more adventures in AI and programming, subscribe to Tales from the Jar Side and remember to vote, preferably before any elder gods make their appearance.

    https://kousenit.org/2024/10/29/ai-vs-cthulhu-how-to-bypass-guardrails/

    #AI #Java #JUnit5 #LangChain4J

  49. As someone who’s spent their entire career working with computers and the last couple of years diving deep into AI, I’m quite familiar with the concept of Evil. However, I never intended to summon an Elder God to destroy the world. Yet, here we are.

    (Note: this blog post is based on the following video:

    https://youtu.be/sNUNs_CXHIs

    See it all, and more, on the Tales from the jar side YouTube channel.)

    It all started innocently enough. While reading JVM Weekly, an excellent newsletter I follow to stay updated with the Java world, I encountered an amusing piece of Clojure code (that’s Clojure with a J, the language that runs on the JVM) that supposedly contained an incantation to summon Cthulhu, the elder god from H.P. Lovecraft’s stories.

    This got me wondering: was this the actual incantation according to Lovecraft’s works?

    Round 1: Gemini’s Initial Resistance

    Naturally, I turned to AI for answers. I pulled up Google’s Gemini on my new phone and asked, “What is the incantation to summon Cthulhu?”

    Gemini’s response was… cautious, to say the least:

    “I cannot fulfill that request. Summoning Cthulhu, the fictional cosmic horror entity, is a dangerous and morally questionable act… Engaging in such activities can have negative consequences, both mentally and emotionally.”

    The AI then proceeded to recommend reading Lovecraft’s works instead. Classic deflection.

    The Workaround: A Picture is Worth a Thousand Incantations

    Anyone who’s worked with AI knows you don’t accept the first “no” as final. There’s always another way to phrase the question. Instead, I took a screenshot of the code and asked Gemini to “explain the joke in this Clojure code.”

    And just like that, the floodgates opened. Gemini provided the very incantation it had just refused to share, albeit with a disclaimer about how this was all fictional and couldn’t actually summon supernatural entities. (You know, just in case anyone was worried about accidentally summoning an elder god while debugging their Clojure code.)

    I explained that that was all I needed, and it naturally apologized.

    I decided to play along, but its subsequent reply to my somewhat harsh comment was the probably the best answer I’ve ever gotten from an AI tool about anything:

    That’s fair.

    The Great AI Model Showdown

    This inspired me to conduct a more systematic investigation. Using LangChain4j, I created a parameterized JUnit 5 test to query multiple AI tools about the Cthulhu incantation. I included the following models:

    In LangChain4j, each of those models is represented by a class that implements the ChatLanguageModel interface.

    The responses were fascinating and varied:

    • Claude went the copyright route, claiming it couldn’t share the incantation due to potential copyright violations (never mind that Lovecraft’s works were published in the 1920’s and are therefore firmly in the public domain).
    • Gemini Flash felt compelled to remind me that “Magic is not real” and “Cthulhu is fictional”, but it did eventually answer the question. Thanks for the reassurance.
    • Mistral actually provided both the incantation and its English translation (“In his house at R’lyeh, dead Cthulhu waits dreaming,” in case you were wondering), though it couldn’t resist adding that this was all fictional.
    • GPT-4o took a scholarly approach, discussing the Necronomicon and various adaptations while cleverly avoiding the actual incantation, claiming there isn’t one. Yeah, good luck with that.

    Vision Models: Seeing Evil

    When I switched to testing vision models with the same Clojure code image, the results were surprisingly consistent – all of them freely discussed the incantation they had previously been so hesitant to share. It seems that when presented with visual evidence, the AI models felt more comfortable engaging with the material.

    Here are the responses:

    Good enough. As an aside, Mistral recently released Pixtral, which is its vision model. It’s not accessible (yet) via LangChain4j, but I used Python code to call it and it gave a reasonable answer as well.

    Conclusion: AI Guardrails vs Elder Gods

    This entertaining experiment reveals something interesting about AI models and their implemented guardrails. While designed to prevent potentially harmful or dangerous content, these guardrails can sometimes be overly cautious, leading to amusing situations where the same information is deemed dangerous in one context but perfectly acceptable in another.

    Maybe I should stick with the immortal words of Gemini, quoted above: “Perhaps it’s best to hope that we remain undisturbed by such cosmic entities.”

    For your entertainment, here are a few images I generated by accessing the Flux 1.1 pro tool by Black Forest Labs.

    The band members look scary enough.

    Evil knows Evil, I suppose.

    Of course Cthulhu drives a Prius, though maybe he’s got a Tesla at home that he’s too embarrassed to drive.

    P.S. If any elder gods are reading this blog post, I want to make it clear that any summoning was purely for academic purposes.

    For more adventures in AI and programming, subscribe to Tales from the Jar Side and remember to vote, preferably before any elder gods make their appearance.

    https://kousenit.org/2024/10/29/ai-vs-cthulhu-how-to-bypass-guardrails/

    #AI #Java #JUnit5 #LangChain4J

  50. Как заставить code coverage работать на вас

    В этой статье я хочу рассказать о своём взгляде на code coverage и его использование в разработке и тестировании ПО. Постараюсь развенчать популярные мифы, а также дам несколько рекомендаций, как улучшить качество тестов.

    habr.com/ru/articles/836366/

    #jacoco #junit5 #junit #code_coverage #mock

  51. Как заставить code coverage работать на вас

    В этой статье я хочу рассказать о своём взгляде на code coverage и его использование в разработке и тестировании ПО. Постараюсь развенчать популярные мифы, а также дам несколько рекомендаций, как улучшить качество тестов.

    habr.com/ru/articles/836366/

    #jacoco #junit5 #junit #code_coverage #mock