TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Speeding up the code-test cycle for Java developers

69 点作者 artpar将近 2 年前
Hello HN, I am Parth. In my experience, the current form of testing automation takes too long. To solve this, I am creating a developer tool to speed up the code-test cycle for Java developers. It has two main parts:<p>Direct Invoke - lets you call any Java function directly, without the need to execute the whole call hierarchy. (e.g. an HTTP endpoint) In my normal coding workflow, I use the “Evaluate Expression” feature inside IntelliJ IDE. I usually put a breakpoint somewhere in the code and after hitting the breakpoint by calling an HTTP api, let the execution remain paused while I explore and see the return values of functions. “Evaluate Expression” was quite useful in exploring new codebases and checking return values of my own functions as a sanity test. The direct invoke feature implements the same functionality without needing to hit a breakpoint. Now, I can just navigate to any function in the editor and execute it. The parameter values are input as JSON and deserialize to an object of the required class instances.<p>Atomic Run - lets you hot-reload the code changes and highlights the difference in the return values of the changed function before and after the hot-reload. I feel Atomic Run has the potential of replacing unit test cases, but there is a long way to go. I am thinking of implementing<p><pre><code> - Option for mocking dependency calls: We want to give the developer more control over the testing environment by allowing them to mock downstream dependency calls. - Customizing assertions: Not all differences in return values indicate breaking changes. Assertions should be flexible to accommodate non-breaking changes. - Workflow to save this data to a file (thinking something like JSON based fixtures): making it easier to organize and reuse test data. </code></pre> This plugin is still in the early stages, so we&#x27;d appreciate your help in ironing out any bugs you come across. Get in touch with me on my discord channel.<p>To try it out, install Unlogged from the IntelliJ Marketplace and start your java application using the java agent (the plugin has instructions to download)<p>Link to try the plugin: <a href="https:&#x2F;&#x2F;plugins.jetbrains.com&#x2F;plugin&#x2F;18529-unlogged" rel="nofollow">https:&#x2F;&#x2F;plugins.jetbrains.com&#x2F;plugin&#x2F;18529-unlogged</a>

7 条评论

ianlevesque将近 2 年前
That&#x27;s really cool. I think there&#x27;s still a lot of untapped potential in Java &amp; Kotlin tooling, despite how far ahead of most other languages the IDE story is there anyway.<p>Your HTTP use case was a good one as that is still very tedious generally. There are some less well integrated solutions that have come up from time to time, but in general being able to run the HTTP request once and from then on mock the request&#x2F;result easily would be great.<p>Hot reload seems to be something that comes and goes. Android Studio has had it and then not had it and then had it again several times. The cases in which it works seem to be fairly arbitrary. Improvements in this space would be great.
评论 #35980746 未加载
shardullavekar将近 2 年前
Hey HN, I am Shardul - I am the other co-founder. Link to try the plugin: <a href="https:&#x2F;&#x2F;plugins.jetbrains.com&#x2F;plugin&#x2F;18529-unlogged" rel="nofollow">https:&#x2F;&#x2F;plugins.jetbrains.com&#x2F;plugin&#x2F;18529-unlogged</a><p>Connect with us: <a href="https:&#x2F;&#x2F;discord.gg&#x2F;Hhwvay8uTa" rel="nofollow">https:&#x2F;&#x2F;discord.gg&#x2F;Hhwvay8uTa</a><p>Atomic Run &amp; Direct Invoke Demo: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=W0hAWx8EXcY">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=W0hAWx8EXcY</a><p>Happy to answer any questions you may have.
mkasberg将近 2 年前
&gt; without the need to execute the whole call hierarchy. (e.g. an HTTP endpoint)... &gt; “Evaluate Expression” was quite useful in exploring new codebases and checking return values of my own functions as a sanity test.<p>Keep pulling on this thread... pretty soon you&#x27;ll be writing unit tests!
评论 #35981508 未加载
SillyUsername将近 2 年前
Isn&#x27;t this just reinventing the wheel and just replicating a built in IDE feature? I.e. what is wrong with Intellij&#x27;s existing right click-execute on a single junit test method to debug and inspecting variables that way?<p>Also this is seems to be unit testing, E2E (or to be precise &quot;component&quot;) testing in my experience is what takes much longer and is where time is lost constructing the fixtures, but importantly E2E tells you if you&#x27;ve made stupid mistakes like using GET instead of POST, or have an XML serialiser overriding the JSON one you intended, which you don&#x27;t pick up in unit tests.<p>Now if you could somehow save an entire VM stack&#x2F;state of a system for E2E tests that wasn&#x27;t brittle to code change, that could just rebuild that state with a single line of code, that would be my dream time saver. The closest I&#x27;ve seen anything like that is recording HTTP request responses or serialising individual Java objects to JSON and using those as fixtures...
评论 #35981463 未加载
beanjuiceII将近 2 年前
when i want to play with java stuff interactively i just actually open it up in clojure repl
评论 #35984683 未加载
评论 #35981584 未加载
karulont将近 2 年前
The reloading part reminded me about <a href="https:&#x2F;&#x2F;www.jrebel.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.jrebel.com&#x2F;</a>
pshirshov将近 2 年前
An extremely complicated solution for a problem which does not actually exist.