Final Year Project | BSc Computer Science (Digital Systems Security) | University of Wollongong
AIVA (AI Visual Assistant) is a web-based developer tool built with Python and Flask that uses trained Machine Learning models to automate common software engineering tasks — including code documentation, refactoring, commit message generation, and security-relevant invalid input testing.
| Feature | Description |
|---|---|
| Auto Comment Generation | Generates inline code comments for Python and Java using trained ML models |
| Code Refactoring | Automatically refactors and cleans up code structure |
| Auto Indentation | Detects language and corrects indentation for Python and Java |
| Commit Message Generation | Compares two code blocks and generates meaningful commit messages |
| Release Notes Generator | Generates formatted release notes from commit history |
| Invalid Input Testing | Analyses function signatures and generates test cases for valid and invalid inputs — security-relevant input validation testing |
| Voice Bot Interface | Voice-controlled interface for hands-free code assistance |
| Export to File | Export any generated output directly to a local file |
- Backend: Python, Flask
- ML Models: Scikit-learn (trained on Python and Java code/comment datasets), Pickle
- Frontend: HTML, CSS, JavaScript, Jinja2 templating
- Architecture: MVC (Model-View-Controller)
- Deployment: Heroku (Procfile included)
- Languages Supported: Python, Java
The Invalid Input Testing module is directly relevant to application security — it analyses function signatures to identify expected data types and automatically generates boundary/invalid test cases. This mirrors real-world input validation testing performed during security assessments and penetration testing of applications.
AIVA/
├── main.py # Flask app entry point, all routes
├── boundary/ # Frontend HTML templates (Jinja2)
│ ├── index.html
│ ├── commentsGen.html
│ ├── autoIndentation.html
│ ├── commitMsgGen.html
│ ├── inputTesting.html
│ ├── codeRefactor.html
│ ├── releaseNotesGen.html
│ └── structureGen.html
├── controller/ # Business logic controllers
│ ├── generateCommentsController.py
│ ├── invalidInputController.py
│ ├── autoIndentController.py
│ ├── generateCommitMessagesController.py
│ ├── generateReleaseNotesController.py
│ ├── codeRefactorController.py
│ ├── structureGenController.py
│ ├── voiceBot.py
│ └── exportFile.py
├── ML/ # Trained ML models and datasets
│ ├── PythonComments/
│ │ ├── pythonComments_model
│ │ ├── pythonComments_vectorizer
│ │ └── pythonCodeAndComments.csv
│ └── JavaComments/
│ ├── javaComments_model
│ ├── javaComments_vectorizer
│ └── javaCodeAndComments.csv
├── AIVA Test/ # Test cases for all features
├── static/ # CSS, JS, assets
├── requirements.txt
├── Procfile
└── runtime.txt
Step 1 — Install dependencies
pip install -r requirements.txtStep 2 — Run Flask
On Mac/Linux:
export FLASK_APP=main.py
export FLASK_ENV=development
flask runOn Windows:
set FLASK_APP=main.py
set FLASK_ENV=development
flask runStep 3 — Visit http://127.0.0.1:5000
- Code is split line by line
- Operators are translated to natural language words (e.g.
+=→add,==→equal) - Each line is vectorized using a trained TF-IDF vectorizer
- A trained classification model predicts the appropriate comment
- Comments are prepended to each line and returned as an annotated code block
Separate models are trained for Python and Java, each with their own language-specific operator dictionaries and ignore lists.
Celta Denya Hadinata Wijaya BSc Computer Science (Digital Systems Security) — University of Wollongong MSc Cybersecurity (Ethical Hacking) — Coventry University (in progress) github.com/celtadenya