SERG-Delft / andy

Andy assesses student's test code. It's used in CSE1110, TU Delft.
MIT License
78 stars 23 forks source link

New code check if class is used #229

Closed mauricioaniche closed 1 year ago

mauricioaniche commented 1 year ago

Code check that looks whether the class is used in the student's solution. We can consider that the class is used if it's instantiated, or if a method (static or not) is called.

sandemiroren1 commented 1 year ago

Hello, me and Kiril discussed and decided we would like to work on this one together.

mauricioaniche commented 1 year ago

It's yours.

Zakrok09 commented 1 year ago

Hello, @sandemiroren1 and I will start working on this issue now. May I also be assigned?

Zakrok09 commented 1 year ago

Hello again!

Currently our solution works well for Instantiating classes and for calling any of their static methods. We are now working to make it work for non-static invocations.

We would like to ask whether we shall check for use of a class only inside annotated test methods or shall we check it anywhere in the solution?

If we do not have to check the whole solution but only the annotated test methods we will have some more work to do.

However, if it we just check the whole solution, we cannot come up with a situation where the class is not instantiated inside the student solution and some of its non-static methods are called. In that case our solution should be enough.

mauricioaniche commented 1 year ago

Nice work!

The method call can be anywhere! (Note that we already have a MethodInTestMethod that looks for method invocations only inside test methods).

Is there something else missing or should I review and merge already?

PS: don't forget the documentation

sandemiroren1 commented 1 year ago

If the method call can be anywhere then I believe it is complete. as we have also updated the README and added java doc.

mauricioaniche commented 1 year ago

I wrote a small comment there, asking for one extra test.