Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 82 additions & 45 deletions AstToEcoreConverter.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Training Configuration
TRAINING_SETTINGS = {
# Path to the folder containing the converted repositories
'output_directory': os.path.join('data/output'),
'output_directory': os.path.join('data/output/xmi_files'),
# Path to the Excel file containing labeled dataset information
'labels_file': os.path.join(BASE_DIR, 'data/labeled_dataset_repos.xlsx'),
'n_epoch': 100, # Number of epochs for training the model
Expand All @@ -35,7 +35,7 @@
# Path to GitHub repositories used as input
'repository_directory': os.path.join('data/input'),
# Path to the folder containing the converted repositories
'output_directory': os.path.join('data/output'),
'output_directory': os.path.join('data/output/xmi_files'),
# Path to the Excel file containing labeled dataset information
'repository_list_file': os.path.join(BASE_DIR, 'data/labeled_dataset_repos.xlsx'),
# Boolean flag; True -> Download all repos from repository_list_files; False -> Do not download from repository_list
Expand All @@ -47,7 +47,7 @@
# Path to directory containing repositories to classify
'input_directory': os.path.join(BASE_DIR, 'data/input'),
# Path for the output directory
'output_directory': os.path.join(BASE_DIR, 'data/output'),
'output_directory': os.path.join(BASE_DIR, 'data/output/xmi_files'),
# Trained classification model
'model_path': os.path.join(BASE_DIR, 'graph_classification_model.pt'),
'threshold': 0.5 # Value above label is considered predicted by model
Expand Down
Binary file added tests/htmlcov.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def a():
return

def b():
return
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class A:
def a(self):
return
def b(self):
return
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
def a ():
return

def a ():
def b():
return
def b():
return
return
def d():
def b():
return

class a:
def c(self):
return
def c(self):
return
Binary file added tests/minimal_examples/test_pyinputplus/.gitkeep
Binary file not shown.
125 changes: 68 additions & 57 deletions tests/test_ATE_Converter.py

Large diffs are not rendered by default.

190 changes: 100 additions & 90 deletions tests/test_ETM_Converter.py

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions tests/test_minimal_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import unittest
import sys
import os

# getting the name of the directory where this file is
current = os.path.dirname(os.path.realpath(__file__))

# getting the parent directory name where the current directory is
parent = os.path.dirname(current)

# adding the parent directory to the sys.path.
sys.path.append(parent)

from AstToEcoreConverter import ProjectEcoreGraph
from pyecore.resources import ResourceSet
from test_utils import check_path_exists

test_output_dir = 'test_results/minimal_examples'

class TestMinimalExamples(unittest.TestCase):

# def test_function_overwrite(self):
# """
# This test tests a Skript with 2 Functions with the same name.
# """
# repo = 'minimal_examples/function_overwrite'
# check_path_exists(repo)
# resource_set = ResourceSet()
# graph = ProjectEcoreGraph(resource_set, repo, True, test_output_dir)
# ecore_graph = graph.get_graph()
#
# def test_2_functions_without_class(self):
# """
# This test tests a Skript with 2 Functions with the same name.
# """
# repo = 'minimal_examples/2_Function_without_class'
# check_path_exists(repo)
# resource_set = ResourceSet()
# graph = ProjectEcoreGraph(resource_set, repo, True, test_output_dir)
# ecore_graph = graph.get_graph()
#
# def test_2_functions_with_class(self):
# """
# This test tests a Skript with 2 Functions with the same name.
# """
# repo = 'minimal_examples/2_Functions_with_class'
# check_path_exists(repo)
# resource_set = ResourceSet()
# graph = ProjectEcoreGraph(resource_set, repo, True, test_output_dir)
# ecore_graph = graph.get_graph()

#def test_pyinputplus(self):
"""
This test for pyinputplus as a test
Create a dir in minimal_examples named "test_pyinputplus"
use cd tests; cd minimal_examples;cd test_pyinputplus; git clone https://github.com/asweigart/pyinputplus.git
"""
#repo = 'minimal_examples/test_pyinputplus/pyinputplus'
#check_path_exists(repo)
#resource_set = ResourceSet()
#graph = ProjectEcoreGraph(resource_set, repo, True, test_output_dir)
#ecore_graph = graph.get_graph()
Binary file added tests/unit_tests/test_package/my_package/.gitkeep
Binary file not shown.
Binary file not shown.
Loading