ls1intum / Ares

The Artemis Java Test Sandbox. A JUnit 5 Extension for Easy and Secure Artemis Java Testing
https://ls1intum.github.io/Ares/
MIT License
18 stars 7 forks source link

Add AST Functionality #248

Closed MarkusPaulsen closed 1 year ago

MarkusPaulsen commented 1 year ago

First implementation of the AST-checker, which can search through Java-Files for unwanted:

MaisiKoleni commented 1 year ago

I realize now, that apart from assertThatFile(Path) and assertThatDirectory(Path) another solution might be, as discussed some weeks ago:

or some similar APIs. The fluent API and the configuration+builder have the advantage that they are extensible without combinatorial explosion. Here, it would be easy to add using(Version.JAVA_17) or similar.

The config+builder has the advantage that they can be specified once and then used for every assertion. But then again, how many of such assertThat statements do we expect a project to have? I would assume that this is 0 or 1 in 99% of the cases, as chaining is always possible.

We can also consider if varargs is a useful addition to hasNo(...).

Please tell me what you think about the suggestions; it would be very interesting to hear of other use cases than students should not be allowed to use any loops. Because this is larger in scope than that, it would be good to know what users might need and expect.

Could you ask the users (exercise creators at TUM for EIST/PSE/PGdP/...) what would be helpful? Maybe @JohannesStoehr has some suggestions as well, he knows both Ares and many instructors fairly well.

MaisiKoleni commented 1 year ago

Sadly had no time to do a full review, but I hope it helps anyway.

Huge Thanks to @Strohgelaender for reviewing! Much appreciated 👍