Está en la página 1de 11

XCore:

Framework for Software


Development
Alexandru tefnic
Supervisor,
Asistent Profesor
Dr. Ing. Petru-Florin Mihancea

Why Software Engineering


Master ?

passion for developing complex systems and


tackling hard problems

want to learn more about programming languages


and machine learning

want so see what the research field can offer and


how can I contribute.

Software Analysis Tools

We need tools to check the quality of software


(Wala, FindBugs, CodePro)

This tools use a metamodel to represent the code


and also meta-metamodels for flexibility

CodePro Meta-MetaModel

The main problem


public class CycloAVG extends PropertyComputer {
public CycloAVG(String name, String longName, String entityType,
String resultEntityTypeName) {

@PropertyComputer
public class CycloAVG implements IPropertyComputer <Double, XClass> {
@Override
public Double compute (@NotNull XClass entity) {
long sum = 0;
int count = 0;

super("CycloAVG2", "Average cyclomatic complexity", "class", "numerical");


}
public ResultEntity compute(AbstractEntityInterface anEntity) {
GroupEntity methods = (GroupEntity) anEntity.contains("method group");

for (final XMethod method: entity.listClassMethods()) {


sum += method.cyclomaticComplexity();
++count;
}

if (null == methods) {
return new ResultEntity(0);
}
long sum = 0;
long count = 0;
for (final AbstractEntityInterface element: methods.getElements()) {

if (null != element.getProperty("CYCLO")) {
continue;
}
sum += (Integer)element.getProperty("CYCLO").getValue();
++count;
}
return new ResultEntity((1.0 * sum)/(1.0 * count) );
}
}

return 0 == count ? 0 : (1.0 * sum) / count;


}
}

XCore: Meta-MetaModel
MetaMetamodel

Enforce
Consistency

@GroupBuilder
@PropertyComputer

public class ListClassMethods implements

public class CycloAVG implements

IGroupBuilder<XMethod, XClass> {

PropertyComputer<Double, XClass> {

@Override
public Group<XMethod> buildGroup(XClass entity) {
Group<XMethod> group_ = new Group<>();

public CycloAVG() {}
public Double compute(@NotNull XClass entity) {
long sum = 0;
int count = 0;
for (final XMethod method: entity.getMethodGroup()) {

++count;

return group_;

return (1.0 * sum) / count;


}

group_.add(FactoryMethod.createXMethod(method));

sum += method.getCyclomaticComplexity();

for (final IMethod method:


entity.getUnderlyingObject().getMethods()) {

}
}

XCore: Arhitecture

CodePro vs XCore
Numr de
linii
CodePro (avg)
XCore (avg)
CodePro (sum)
CodePro
XCore
(sum)

Numr Complexitate
de
Ciclomatic
casturi

Constante
Magice

34.153

1.769

4.307

2.230

31.384

2.384

444

23

56

29

408

31

What could we do next?

Better integration with IDEs (e.g support


incremental builds)

Support multiple frameworks in parallel (currently


online one major framework such as JDT per
project)

Allow sandboxing development

Questions ?

Thank you !