@@ -5,10 +5,12 @@ Repository for Thesis code
551 . [ Requirements] ( #REQUIREMENTS )
662 . [ Setting up (local enviroment)] ( #SETTING-UP-LOCAL-ENVIROMENT )
77
8+
89## REQUIREMENTS
910- Python3.10
1011- Python3.10-venv ` sudo apt install python3.10-venv `
1112
13+
1214## SETTING UP LOCAL ENVIROMENT
1315
1416In order to run the project for the first time:
@@ -43,6 +45,17 @@ In order to run the project for the first time:
4345 sudo apt-get install python3-tk
4446```
4547
48+ ## Exceute
49+
50+ 1 ) Activate the virtual enviroment
51+ ``` sh
52+ source .venv/bin/activate
53+ ```
54+ 2 ) Run program
55+ ``` sh
56+ python UMLConverter/main.py
57+ ```
58+
4659
4760## TEST AND COVERAGE
4861
@@ -60,4 +73,133 @@ In order to run the project for the first time:
60732 ) Generate html version of coverage in ` htmlcov/ `
6174``` sh
6275 coverage html
76+ ```
77+
78+ ## Test log
79+
80+ ``` py
81+ ==================================================== = test session starts ==================================================== =
82+ platform linux -- Python 3.10 .6, pytest- 7.2 .0, pluggy- 1.0 .0 -- / mnt/ e/ TFG / UMLConverter/ .venv/ bin / python3
83+ cachedir: .pytest_cache
84+ rootdir: / mnt/ e/ TFG / UMLConverter
85+ collected 74 items
86+
87+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ AbstractMethods/ main.py- samples/ Simple_Samples/ AbstractMethods/ main.uml] PASSED [ 1 % ]
88+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ AccessModifiers/ Private/ main.py- samples/ Simple_Samples/ AccessModifiers/ Private/ main.uml] PASSED [ 2 % ]
89+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ AccessModifiers/ Protected/ main.py- samples/ Simple_Samples/ AccessModifiers/ Protected/ main.uml] PASSED [ 4 % ]
90+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ AccessModifiers/ Public/ main.py- samples/ Simple_Samples/ AccessModifiers/ Public/ main.uml] PASSED [ 5 % ]
91+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ Attributes/ main.py- samples/ Simple_Samples/ Attributes/ main.uml] PASSED [ 6 % ]
92+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ MethodReturnType/ main.py- samples/ Simple_Samples/ MethodReturnType/ main.uml] PASSED [ 8 % ]
93+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ MethodsWithoutParameters/ main.py- samples/ Simple_Samples/ MethodsWithoutParameters/ main.uml] PASSED [ 9 % ]
94+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ MethodsWithParameters/ main.py- samples/ Simple_Samples/ MethodsWithParameters/ main.uml] PASSED [ 10 % ]
95+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ StaticMethods/ main.py- samples/ Simple_Samples/ StaticMethods/ main.uml] PASSED [ 12 % ]
96+ tests/ test_UMLConverter.py::test_AST[samples/ Simple_Samples/ Types/ main.py- samples/ Simple_Samples/ Types/ main.uml] PASSED [ 13 % ]
97+ tests/ test_UMLConverter.py::test_AST[samples/ testAST/ ClassDef/ complexClass.py- samples/ testAST/ ClassDef/ complexClass.uml] PASSED [ 14 % ]
98+ tests/ test_UMLConverter.py::test_AST[samples/ testAST/ ClassDef/ inheritedClass.py- samples/ testAST/ ClassDef/ inheritedClass.uml] PASSED [ 16 % ]
99+ tests/ test_UMLConverter.py::test_AST[samples/ testAST/ ClassDef/ simpleClass.py- samples/ testAST/ ClassDef/ simpleClass.uml] PASSED [ 17 % ]
100+ tests/ test_UMLConverter.py::test_AST[samples/ testAST/ Module/ module.py- samples/ testAST/ Module/ module.uml] PASSED [ 18 % ]
101+ tests/ test_UMLConverter.py::test_getSetFileList PASSED [ 20 % ]
102+ tests/ test_UMLConverter.py::test_getCode PASSED [ 21 % ]
103+ tests/ test_UMLConverter.py::test_getSetOutput PASSED [ 22 % ]
104+ tests/ test_UMLConverter.py::test_getSetLanguage PASSED [ 24 % ]
105+ tests/ test_UMLConverter.py::test_getSetExtension PASSED [ 25 % ]
106+ tests/ test_UMLConverter.py::test_getSetClassList PASSED [ 27 % ]
107+ tests/ test_UMLConverter.py::test_getSetImports PASSED [ 28 % ]
108+ tests/ test_file.py::test_getSetFileName PASSED [ 29 % ]
109+ tests/ test_file.py::test_getSetData PASSED [ 31 % ]
110+ tests/ test_file.py::test_readFileNotFoundError PASSED [ 32 % ]
111+ tests/ test_file.py::test_readAndAnalyze PASSED [ 33 % ]
112+ tests/ test_file.py::test_write PASSED [ 35 % ]
113+ tests/ test_jsAST.py::test_AST[samples/ JavaScript_Samples/ Animal/ Animal.js- samples/ JavaScript_Samples/ Animal/ Animal.txt] PASSED [ 36 % ]
114+ tests/ test_jsAST.py::test_AST[samples/ JavaScript_Samples/ Animal/ Cat.js- samples/ JavaScript_Samples/ Animal/ Cat.txt] PASSED [ 37 % ]
115+ tests/ test_jsAST.py::test_AST[samples/ JavaScript_Samples/ School/ Person.js- samples/ JavaScript_Samples/ School/ Person.txt] PASSED [ 39 % ]
116+ tests/ test_jsAST.py::test_AST[samples/ JavaScript_Samples/ School/ Student.js- samples/ JavaScript_Samples/ School/ Student.txt] PASSED [ 40 % ]
117+ tests/ test_jsAST.py::test_AST[samples/ JavaScript_Samples/ School/ Teacher.js- samples/ JavaScript_Samples/ School/ Teacher.txt] PASSED [ 41 % ]
118+ tests/ test_jsAST.py::test_setGetTree PASSED [ 43 % ]
119+ tests/ test_jsAST.py::test_setGetDataList PASSED [ 44 % ]
120+ tests/ test_line.py::test_getIndentation PASSED [ 45 % ]
121+ tests/ test_line.py::test_getData PASSED [ 47 % ]
122+ tests/ test_line.py::test_getRawData PASSED [ 48 % ]
123+ tests/ test_line.py::test_getIndentationLevel PASSED [ 50 % ]
124+ tests/ test_markdown.py::test_Markdown PASSED [ 51 % ]
125+ tests/ test_pyAST.py::test_AST[samples/ testAST/ AnnAssign/ arrayAnnAssign.py- samples/ testAST/ AnnAssign/ arrayAnnAssign.txt] PASSED [ 52 % ]
126+ tests/ test_pyAST.py::test_AST[samples/ testAST/ AnnAssign/ attribAnnAssign.py- samples/ testAST/ AnnAssign/ attribAnnAssign.txt] PASSED [ 54 % ]
127+ tests/ test_pyAST.py::test_AST[samples/ testAST/ AnnAssign/ complexAnnAssign.py- samples/ testAST/ AnnAssign/ complexAnnAssign.txt] PASSED [ 55 % ]
128+ tests/ test_pyAST.py::test_AST[samples/ testAST/ AnnAssign/ simpleAnnAssign.py- samples/ testAST/ AnnAssign/ simpleAnnAssign.txt] PASSED [ 56 % ]
129+ tests/ test_pyAST.py::test_AST[samples/ testAST/ AnnAssign/ typeAnnAssign.py- samples/ testAST/ AnnAssign/ typeAnnAssign.txt] PASSED [ 58 % ]
130+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Assign/ mutipleAssign1.py- samples/ testAST/ Assign/ mutipleAssign1.txt] PASSED [ 59 % ]
131+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Assign/ mutipleAssign2.py- samples/ testAST/ Assign/ mutipleAssign2.txt] PASSED [ 60 % ]
132+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Assign/ simpleAssign.py- samples/ testAST/ Assign/ simpleAssign.txt] PASSED [ 62 % ]
133+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ClassDef/ complexClass.py- samples/ testAST/ ClassDef/ complexClass.txt] PASSED [ 63 % ]
134+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ClassDef/ inheritedClass.py- samples/ testAST/ ClassDef/ inheritedClass.txt] PASSED [ 64 % ]
135+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ClassDef/ simpleClass.py- samples/ testAST/ ClassDef/ simpleClass.txt] PASSED [ 66 % ]
136+ tests/ test_pyAST.py::test_AST[samples/ testAST/ FunctionDef/ argsFun.py- samples/ testAST/ FunctionDef/ argsFun.txt] PASSED [ 67 % ]
137+ tests/ test_pyAST.py::test_AST[samples/ testAST/ FunctionDef/ complexFun.py- samples/ testAST/ FunctionDef/ complexFun.txt] PASSED [ 68 % ]
138+ tests/ test_pyAST.py::test_AST[samples/ testAST/ FunctionDef/ nestedFunctions.py- samples/ testAST/ FunctionDef/ nestedFunctions.txt] PASSED [ 70 % ]
139+ tests/ test_pyAST.py::test_AST[samples/ testAST/ FunctionDef/ returnFun.py- samples/ testAST/ FunctionDef/ returnFun.txt] PASSED [ 71 % ]
140+ tests/ test_pyAST.py::test_AST[samples/ testAST/ FunctionDef/ simpleFun.py- samples/ testAST/ FunctionDef/ simpleFun.txt] PASSED [ 72 % ]
141+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Import/ multipleImport.py- samples/ testAST/ Import/ multipleImport.txt] PASSED [ 74 % ]
142+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Import/ simpleImport.py- samples/ testAST/ Import/ simpleImport.txt] PASSED [ 75 % ]
143+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ImportFrom/ complexImportFrom.py- samples/ testAST/ ImportFrom/ complexImportFrom.txt]
144+ PASSED [ 77 % ]
145+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ImportFrom/ importFrom.py- samples/ testAST/ ImportFrom/ importFrom.txt] PASSED [ 78 % ]
146+ tests/ test_pyAST.py::test_AST[samples/ testAST/ ImportFrom/ longImport.py- samples/ testAST/ ImportFrom/ longImport.txt] PASSED [ 79 % ]
147+ tests/ test_pyAST.py::test_AST[samples/ testAST/ Module/ module.py- samples/ testAST/ Module/ module.txt] PASSED [ 81 % ]
148+ tests/ test_pyAST.py::test_setGetTree PASSED [ 82 % ]
149+ tests/ test_pyAST.py::test_setGetDataList PASSED [ 83 % ]
150+ tests/ test_pythonNode.py::test_setgetNodeType PASSED [ 85 % ]
151+ tests/ test_pythonNode.py::test_setgetName PASSED [ 86 % ]
152+ tests/ test_pythonNode.py::test_setgetValue PASSED [ 87 % ]
153+ tests/ test_pythonNode.py::test_setgetArgs PASSED [ 89 % ]
154+ tests/ test_pythonNode.py::test_setgetBody PASSED [ 90 % ]
155+ tests/ test_pythonNode.py::test_addArg PASSED [ 91 % ]
156+ tests/ test_pythonNode.py::test_addBody PASSED [ 93 % ]
157+ tests/ test_pythonNode.py::test_toString PASSED [ 94 % ]
158+ tests/ test_pythonNode.py::test_toStringBodyException PASSED [ 95 % ]
159+ tests/ test_searcher.py::test_lookForFiles PASSED [ 97 % ]
160+ tests/ test_searcher.py::test_getFileList PASSED [ 98 % ]
161+ tests/ test_searcher.py::test_fetDirList PASSED [100 % ]
162+
163+ ==================================================== = 74 passed in 7. 69s ======================================================
164+ ```
165+
166+
167+ ## Coverage report
168+
169+ ``` py
170+ Name Stmts Miss Cover
171+ ----------------------------------------------------------------
172+ app/ __init__ .py 0 0 100 %
173+ app/ modules/ ast_module/ AST .py 48 11 77 %
174+ app/ modules/ ast_module/ __init__ .py 0 0 100 %
175+ app/ modules/ ast_module/ jsAST.py 152 26 83 %
176+ app/ modules/ ast_module/ line.py 29 0 100 %
177+ app/ modules/ ast_module/ pyAST.py 384 39 90 %
178+ app/ modules/ ast_module/ pythonNode.py 59 0 100 %
179+ app/ modules/ file_module/ __init__ .py 0 0 100 %
180+ app/ modules/ file_module/ file .py 102 22 78 %
181+ app/ modules/ file_module/ markdown.py 104 3 97 %
182+ app/ modules/ file_module/ searcher.py 26 0 100 %
183+ app/ modules/ interface_module/ __init__ .py 0 0 100 %
184+ app/ modules/ interface_module/ interface.py 108 89 18 %
185+ app/ modules/ metric_module/ __init__ .py 0 0 100 %
186+ app/ modules/ metric_module/ metric.py 122 90 26 %
187+ app/ modules/ metric_module/ metricClass.py 123 52 58 %
188+ app/ modules/ metric_module/ metricPackage.py 72 34 53 %
189+ app/ modules/ uml_module/ UMLConverter.py 204 57 72 %
190+ app/ modules/ uml_module/ __init__ .py 0 0 100 %
191+ app/ modules/ uml_module/ translator.py 131 26 80 %
192+ app/ modules/ utils.py 6 0 100 %
193+ tests/ __init__ .py 0 0 100 %
194+ tests/ test_UMLConverter.py 57 0 100 %
195+ tests/ test_file.py 41 2 95 %
196+ tests/ test_jsAST.py 18 0 100 %
197+ tests/ test_line.py 17 0 100 %
198+ tests/ test_markdown.py 28 2 93 %
199+ tests/ test_pyAST.py 19 0 100 %
200+ tests/ test_pythonNode.py 58 0 100 %
201+ tests/ test_searcher.py 15 0 100 %
202+ tests/ utils.py 39 0 100 %
203+ ----------------------------------------------------------------
204+ TOTAL 1962 453 77 %
63205```
0 commit comments