Ultron 2.0 is a prototype autograder system designed to automatically grade Android application (APK) submissions. It orchestrates the entire process, from setting up an environment to running tests and generating a final report.
This is the successor to Ultron Beginner, updated for compatibility with the new Direviu contract.
The project is divided into two main modules:
app
: A Kotlin-based command-line application that acts as the main orchestrator. It handles setting up the environment, running tests, and processing the results.tester
: An Android project containing the instrumented tests that are executed against the submitted APK.
To run the Ultron Autograder, you will need the following installed on your system:
- Java Development Kit (JDK) 11 or higher
- Android SDK with
adb
andaapt2
available in your system's PATH - Docker
You can run the autograder from the command line using Gradle.
-
Navigate to the
app
directory:cd app
-
Run the application using the
run
Gradle task, providing the path to the submission directory../gradlew run --args="-s /path/to/submission/directory"
Example:
- Approved Sample
Output:
./gradlew run --args="-s FIXTURES/submission-approved -v"
[{"submission_id":2,"rating":3,"checklist_keys":["DISPLAY_INFO_IN_LIST_MIN_10ITEMS","DISPLAY_DETAIL_PAGE_AFTER_CLICKING_ITEM","DISPLAY_RELEVANT_INFO_IN_DETAIL","DISPLAY_ABOUT_PAGE"],"message":"Congratulations! You have passed the submission.","is_draft":true,"is_passed":true}]
- Rejected Sample
Output:
./gradlew run --args="-s FIXTURES/submission-rejected -v"
[{"submission_id":4,"rating":0,"checklist_keys":["DISPLAY_INFO_IN_LIST_MIN_10ITEMS","DISPLAY_DETAIL_PAGE_AFTER_CLICKING_ITEM","DISPLAY_RELEVANT_INFO_IN_DETAIL"],"message":"Sorry, you have not passed the submission. Please check the following criteria: \nCriteria DISPLAY_ABOUT_PAGE not met","is_draft":true,"is_passed":false}]
-s
,--source
: (Required) The absolute path to the directory containing the student's submission (.apk
file andauto-review-config.json
).-v
,--verbose
: (Optional) Enables verbose logging for all subprocess commands.
The autograder follows these steps to grade a submission:
- Initialization: Reads the submission information from
submission.json
. - Emulator Setup: Starts an Android emulator inside a Docker container using a pre-configured image. It waits until the emulator is fully booted and ready.
- Testing:
- Installs the submitted APK on the emulator.
- Executes the instrumented tests defined in the
tester
module against the APK. - Pulls the test result XML file and any generated screenshots from the emulator.
- Grading: Parses the XML test results to determine which criteria passed or failed.
- Reporting: Generates a
report.json
file in the submission directory, containing the final grade, a list of completed checklist items, and feedback. - Cleanup: Stops the Docker container and the ADB server to release all resources.