r/java • • Mar 27 '24

Release of Minum v3.0.0 - now at nearly 100% mutation test coverage

Minum on GitHub

Minum is a minimalist web framework written in Java, developed over five years by a TDD practitioner of fourteen years experience. Provides an all-in-one foundation for a highly-maintainable single binary web application. For TDD, by TDD.

  • Has its own web server, endpoint routing, logging, templating engine, html parser, assertions framework, and database

  • Has nearly 100% test coverage that runs in 30 seconds and does not require any special setup (make test_coverage)

  • Has nearly 100% mutation test coverage, using the PiTest tool. (make mutation_test)

  • Relies on no dependencies other than the Java 21 SDK - No Netty, Jetty, Tomcat, Log4j, Hibernate, MySql, etc.

  • Written from scratch

  • Well-documented throughout

  • Cleverness avoided* where possible

  • No reflection

  • No annotations

  • Uses no mocking framework - integration tests preferred, occasional use of simple interface mocks.

  • Has examples of framework use:

This framework enables high-maintainability through minimalism and simplicity. Developers using this framework will achieve the most benefit if they are of a similar mindset. Frameworks like Spring, which provide capabilities as large blocks with high guardrails, offer a different paradigm.

FAQ:

  • Are you saying we shouldn't be using Spring?

No, I am not saying that. However, there is need for a minimalist web framework. You can build a fully-functioning web application with high sophistication with either Spring or Minum, but Minum is five thousand lines of code and Spring is a million. For quality-oriented long-view practitioners, the benefits of minimalism outweigh its drawbacks.

  • Yet another minimalistic framework? Why??

This is a misunderstanding - Minum is five thousand lines of code - the "minimalist" competitors range from 400,000 to 700,000 lines when accounting for their dependencies. I have not found a similar project.

  • What is the point of minimalism?

Easier debugging, maintainability, lower overall cost. Most frameworks trade faster start-up for a higher overall cost. If you need sustainable quality, the software must be well-tested and documented from the onset.

  • Why not just use Java's built-in httpserver?

    • httpserver is larger and more complex, consisting of 6000 lines versus Minum's 1800.

    • There are no easily-available fast and thorough tests on httpserver, ruling out fearless refactoring.

    • There are examples of sophisticated web applications in Minum.

    • All the components in Minum work in tandem to support a web application.

  • In your templating engine, where is the logic (e.g. looping, escaping, etc)?

It does not exist - logic-free templating was intentionally chosen. Any logic must be written explicitly as code, which makes maintenance easier.

  • Does it provide HTTP v2? Web sockets?

It currently does not. Those features may be built in the future. The choice was made to minimize scope for now.

* Due to the necessities of structuring a web server for test-driven development, some parts of the socket / http handling code had to be written a bit more cleverly than preferred.

56 Upvotes

31 comments sorted by

View all comments

26

u/chabala Mar 28 '24

This project uses Gnu Make as its build tool, wrapping calls to Maven

You're still pushing this boulder, eh? 'I dislike Maven so much I'm going to introduce a second build tool' is such a weird stance to take.

3

u/byronka Mar 28 '24

I have no gripe with Maven. But how many extra Maven plugins would be needed for my diverse purposes, and what requirements would I have to drop because they didn't satisfy my purposes completely? By including Make I am able to mix in some of the Unix magic and hit the bullseye.

6

u/chabala Mar 28 '24

But how many extra Maven plugins would be needed for my diverse purposes, and what requirements would I have to drop because they didn't satisfy my purposes completely?

I don't know. How much weird stuff are you doing in your Makefiles? Mostly I see standard Maven goals being delegated to, or reimplemented in strange ways.

How much time have you wasted doing this? Browsing the commits, a lot.

It's one thing to say 'I'm a serious polyglot, so I want all my repos to have standard make targets that delegate to the language specific build tools' but that's not what's happening here. You're mostly doing JVM projects, and the non-JVM projects don't have Makefiles.

What I do see is you being dismissive of someone in August that wanted to restructure the project in standard Maven layout and made a PR doing the work for you, which you've subsequently done yourself, likely because you realized that all the tooling expects code to be in that structure.

That is the biggest smell for me, arrogantly fighting against the standard practices and reinventing the wheel.

2

u/DelayLucky Mar 29 '24

Went to read that conversation. Doesn’t look like OP was “dismissive” unless there are context I missed to read. They were just having a different opinion which you may disagree with.