1. Features
Complete pseudocode and of "reference"
Supports writing algorithms using the syntax described in the literature reference (Hurtado, 2002) of the subjects "Introducción a la programación" and "Metodología de la programación" in the UCA (Universidad de Cádiz).
Multi-platform
Based on the popular Eclipse environment and available to Windows, Linux and Mac OS.
Friendly environment
Wizards, templates, autocomplete, formatting and automatic colored, quick fixes, outline view, etc.
Multi-language syntax
Algorithms can be programmed in Spanish and English, according to the user's preference when it begin to create a new project of code.
Compiling and running
Validation and automatic C or C ++ code generation executable on the environment itself.
Integrable
Static code analysis of algorithms from the SonarQube environment.
Extensible
Design devised for adding new languages to the concrete syntax of language and new languages for code generation.
2. Setup manual
1. Download and install JDK 8 (Java Development Kit) or an previous version.
To download the JDK 8 or an previous version you can access Oracle's official website:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Download and install a C/C++ compiler.
For the plugin works properly you must install a C/C++ compiler in your preferred operating system.
2.1. Windows
In this case, the application that you must install will be Cygwin 2.1.0:
Download Cygwin 2.1.0 for 32-bits Windows:
Download Cygwin 2.1.0 for 64-bits Windows:
https://cygwin.com/setup-x86.exe
In the first installation window click on the Next button:
In the next window select the root directory for the Cygwin installation:
In the next window select a download site:
Furthermore, the packages to be installed are:
gcc-core (Devel - gcc-core: GNU Compiler Collection)
gcc-g++ (Devel - gcc-g++: GNU Compiler Collection (C++))
make (Devel - make: The GNU version of the 'make' utility)
Finally, when the installation is complete you must be exported in the PATH system variable the bin directory of the root directory selected:
In this case:
C:\cygwin64\bin
2.2. Linux
In this case, tests were performed in a Ubuntu distribution, but the procedure for other distributions is the same or very similar.
To install the GNU C/C++ compiler (GCC) 5.2 should perform the following commands in the terminal:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v (orden para verificar que se ha instalado correctamente)
make -v (orden para verificar que se ha instalado correctamente)
2.3. Mac OS
In Mac OS simply install Xcode 6.4.
Xcode is a free development application that can be downloaded from the official Apple application store (App Store):
https://itunes.apple.com/es/app/xcode/id497799835?mt=12
This application includes a compiler of C/C++, among many other utilities.
3. Download and install Eclipse IDE for C/C++ Developers.
To download "Eclipse IDE for C/C++ Developers" can access the Eclipse official website:
http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/mars2
In this case, decompress the downloaded directory is sufficient to install Eclipse.
4. Download and install the application plugins (Vary).
To install Vary you must drag the "Install" button (top right corner of the web) to your running Eclipse workspace or you must open the "Eclipse Marketplace" option (Help section in Eclipse) and then you must search "Vary".
To manually download the plug-in Vary click on the section "Download Vary plug-in for Eclipse" or click here.
5. Configuration to measure the quality of the algorithms from SonarQube.
First, you must perform configuration SonarQube server from which you will see the results of the measurements.
http://docs.sonarqube.org/display/SONAR/Installing
Subsequently, the "sonar-vary-plugin-1.0.0.jar" file must be copied in the SonarQube server plugins directory. In this case, the plugins directory is in:
/usr/local/Cellar/sonar/5.1/libexec/extensions/plugins
In addition, for analysis from outside of Eclipse must be installed the SonarQube Runner application.
http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner
3. User's guide
Video tutorial
Creating a project
1. First, you must open the Eclipse version with Vary plugin integrated.
2. Subsequently, it will right click and select New and then Other (see figure below).
3. Next, the options provided by the project creation wizard will appear. First, we choose the project in Spanish or English, defining the language grammar (see figure below).
4. On the first page of the project creation wizard the name of the new project will be added and click Next (see figure below).
5. On the next page the programming language that is desired transforming the pseudocode is selected (see figure below).
6. On the last page specific characteristics will be chosen based on the selected language. In the case of C/C++, will be chosen if desired or not generate the header file (.h). Finally, you must click Finish (see figure below).
7. Subsequently, the editor will open the file main.p or main.ep (depending on the language selected for the project), which contain, in the first moment, an empty structure algorithm (see figure below).
8. To see the result of the conversion of the algorithm written in pseudocode to C or C ++, you must click on the main project directory and src-gen directory is selected.
9. In src-gen directory you will find the main.c or file main.cpp file, where you can observe the conversion done in C or C ++, you will find also main.h file. The latter will appear if you was chosen to generate it in the project creation wizard (see figure below).
Project edition
1. Templates
To use the templates provided must enter CTRL + SPACE and select the desired template. Subsequently, the new piece of pseudocode it automatically added and should complete the template with the desired values (see figures below).
Some of the features available templates are:
Creating types (vector, matrix, registry, subrange, enumerated or file).
Creating the empty structure of a subprocess (function or procedure).
Creating variables.
Creating the empty structure of selective structures (if or according to).
Creating the empty structure of repetitive structures (repeat, for or while).
Creating the empty structure of an algorithm or module.
2. Content assistant
1. Autocomplete:
To use the autocomplete you enter CTRL + SPACE, as well as for the use of templates. For example, we can use this utility to create a new variable and use the vector type created earlier (see figures below).
Some of the autocomplete functions available are:
Autocompletion in the creation of a variable.
Autocompletion in the parameters of a subprocess.
Autocomplete the fields of a registry.
Autocomplete the calls of the subprocess.
Autocomplete the available modules for import.
2. Quick Fix:
As shown in the subsequent section, the application performs validations before transforming algorithm to C or C ++ code. The application will provide a quick fix to correct the problem for some validations. For example, if a constant is used to define the dimension of a vector and it has not been previously defined, the application will provide a quick solution for creating said constant (see figures below).
Outline
During the making of the algorithm, you can see a tree version that describes the algorithm in the outline section.
Creating a new module or algorithm
When you use the options provided in the wizard you can create new empty modules or empty algorithms or with an example. (see figures below).
Importing an existing module or algorithm
On the other hand, from the creation wizard will also be possible to import files to the project (see figures below).
Validate project
When you are writing, the program will notify you of any errors or warnings committed (see figures below).
Run Project
To run the project should right click on the project directory and the options Build Project and then Run as> Local C / C ++ Application are selected (see figures below).
Measuring quality with SonarQube
To measure the quality of project resources you must execute the following command from the console to the root directory of the project to analyze:
sonar-runner
Then you can access the URL where you have configured the server (the default URL will be localhost: 9000) of SonarQube and can view the list of analyzed projects with "SonarQube Runner" through the above mentioned process (see figure shown below).
Finally, if you access to analysis of each project, you will can to see the most relevant project data and the result of the application of the metrics showing the relevant notices (see figure below).
The available metrics set is:
Metric that determines if the variable name is too long.
Metric that determines if an excessive use of global variables is made.
Metric that determines whether the main program contains too much functionality.
Metric that determines whether use of the specification (descriptive comments before every subprocess) is done correctly.
4. Developer's guide
Add a new language syntax
1. First, you create a new project with Xtext nature.
2. Then, you should write grammar translating the keywords to the desired language.
3. You must also make all classes that implement functionality (quick fix, proposals, generators, etc) inherit from the classes of the vary.pseudocodigo.dsl.c and vary.pseudocodigo.dsl.c.ui projects.
4. Finally, you must create a new properties file with messages translated to the desired language.
The vary.pseudocodigo.dsl.c.english and vary.pseudocodigo.dsl.c.english.ui projects are a example of it.
Add a new programming language for code generation
1. First, you must create a new class that implements the "VaryGeneratorInterface.java" interface.
2. Subsequently, you must add your new generator option in the file "VaryGrammarGenerator.xtend" in the vary.pseudocodigo.dsl.c project.
3. Finally, you must configure the wizard for the new language is available with their respective options in the vary.pseudocodigo.dsl.c.ui project.
5. About Vary project
Project
This work has been funded by the Consejería de Economía, Innovación, Ciencia y Empleo de la Junta de Andalucía thought the University of Cadiz Innovation in Education 2013/14 programme, project "Desarrollo y evaluación de un entorno para la mejora del aprendizaje de la programación" (ref. AAA_14_012) and 2014/15 programme, project "Evolución, despliegue y evaluación de un software para el aprendizaje de la programación" (code of the request sol-201400047875-tra).
Team
- Project leader: Iván Ruiz Rube https://github.com/ruizrube
- Project developer: Tatiana Person Montero https://github.com/TatyPerson
- Project analyst: Juan Manuel Dodero Beardo https://github.com/dodero, José Miguel Mota https://github.com/josemiguelmota
- Project tester: Nuria Hurtado Rodríguez, Esther Lydia Silva Ramírez