README.md 4.87 KB
Newer Older
1
2
# Project 2: M2T

3
4
5
6
7
8
9
10
11
12
13
14
## Running the transformation

To run the model to text transformation locate the **studyplan2TextGenerator.mtl** file inside _tdt4250.spp.html/main_ folder, right click inside the file and click Run As > Run Configurations...

![pictureOfRunConfigurations](assets/runConfig.png)

When you are inside the configurations window make sure that the properties are similar to the ones you see below:

![configurations](assets/configs.png)

The result of the transformation will appear inside the **target** folder. If a source file is missing, copy the one called example.xmi from the _tdt4250.spp.model_ project from inside the model folder.

15
16
17
18
## Project structure

_tdt4250.spp.html_ is where the transformation code is generated, of interest the project consists of _main_, _source_, _target_ folders. The _main_ folder consists of the transformation logic, including the acceleo code which describes how the model will be transformed into text. Or in other words, it describes how the result of the transformation will look like. The _source_ folder contains an example.xmi file which is the source model for the transformation. The _target_ folder contains the result of the transformation, and is thus an html file.

19
20
21
22
## Changelog on model from project 1

- Added a bunch of new examples in the model.
- Added mandatory- and elective courses to specialization. Referencing Course and one specialization can reference many courses in both attributes.
23
- Added validation courseCodeNeedsToBeUnique in order to find duplicates
24

25
26
27
28
29
30
## Simplifications

- Lektor i Realfag simplified by just modelling the Informatics and mathematics specialization with Informatics as main topic.
  - Meaning it follows the same path as most informatics / CS study programs.
  - Meaning it chooses among the normal specialization within the CS programs.

31
32
33
34
## Modelling to fit in semesters per specialization

I was thinking to add semesters for each specialization to be able to create individual study plans for each specialization per study program. But it quickly became cumbersome to create examples for it. Hence, I ended up creating simple examples displaying all elective and mandatory choices for each specialization without creating a semester plan. However, I've created two different examples showing a simple plan for _Lektor i Realfag_ without having any options. And I've created an example for master for informatics showing how different specializations can be displayed on the web site.

35
# Project 1: SPP - StudyProgramProject
36
37

- `tdt4250.spp.model` contains the model code and source code.
38
39
40
41
42
43
  - `model` contains the `spp.ecore` model related genmodel and implementation.
  - `src` containing the automatically generated and manual written code
    - `tdt4250.spp` the interfaces and datatypes generated by Ecore
    - `tdt4250.spp.examples` manually written example code - based on examples given in the lectures
    - `tdt4250.spp.impl` implementation code mostly generated by Ecore and some details written manually
    - `tdt4250.spp.util`
44
45
- `tdt4250.spp.model.tests` contain all tests for the source code.

46
The model created (subject to change)
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

![model](assets/model.png)

## Rationale

- A University naturally owns all Study _Programs_ and institutes, meaning it's the root container in the domain.
- An Institute has ownership or responsibility of any given course, hence courses are contained by Institutes.
- A Program has a set of Mandatory Courses that must be completed in order to finish the program.
  - Mandatory Courses will be _automatically_ adjusted after the student has chosen a specialization.
  - The general set of mandatory courses will be predefined by a student coordinator.
- A Program has a set of Elective Courses that may be selected into a semester
  - The set of elective courses will be predefined by a student coordinator.
- A course has to be chosen from either the set of Mandatory- or Elective Courses.
- A Program's duration has to be one of Bachelor (3 years), Masters (2 years), or IntegratedMasters (5 years).
- The level of a given course is either Bachelor level or Masters level
  - Bachelor level courses is one of; Foundation, Intermediate, or ThirdYear.
  - Masters is always Second Degree.
- A course can be taken either in the semester Fall or Spring, and may or may not be available for both.
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

## Testing

Tests for all current manual code implementation written.

Code coverage run with EclEmma v.3.1.3. [https://www.eclemma.org/index.html](https://www.eclemma.org/index.html).

![coverage](./assets/coverage.png)

The tests written are currently very trivial, and vulnerable to changes made to the code.
I've copied an xmi example into the test called _testFixture_ which is used in a couple of setUp methods.
When a more detailed fixture is created it should be replaced.

## Mistakes

- Typo for specialization -> is currently specialisation.
  - Would like to do a refactor -> don't want to mess up current implementation.