0

I am doing my project to create a tool that can find the changes in the structural regularities (the structural regularities are rules which must be obeyed in the source code) between two versions of a specific software and check if the newest version violated the structural regularities of the old version.

I am using a query language called EKEKO (Clojure library meta-programming against an Eclipse workspace). I created the predicates which I am going to use and also I can find the difference between two versions.

But my problem is finding a way to say for example: all the methods called toString in the old version should have a new name which is print. So in this case I need to check if the new version met the structural contract (about name conventions).

(defn differenceInContract1 
    [?projectName1 ?projectName2 f]
    (def result1 (projectResults ?projectName1 f))
    (def result2 (projectResults ?projectName2 f))

    (def tuple1 (set (map (partial map str) result1)))
    (def tuple2 (set (map (partial map str) result2)))
    (clojure.set/difference tuple1 tuple2))

In the previous code I can get the different between two versions of the project. What I need to do it cloud be something like the next code:

(defn changeContract
    [?proj1 ?proj2 f1 f2]
    (and (projectResults ?projec1 f1)
         (projectResults ?projec2 f2)))

Where projectResults apply Ekeko environment on given project and find the result of the specified predicate which in this case (f1 and f2).

But Also, I need to be carful about the comparing operation because the same class in different projects doesn't means that they are equal.

Any Ideas to help me to move on? Thanks in advance!

  • 2
    Add the code snippet relevant to the example you gave. It'll improve the chances of getting specific answers. – Alfabravo Feb 04 '16 at 15:21
  • [tag:ekoko] seems wrong, because Text says `Ekeko`. Is the tag useful after all? Edit: Text now says `EKOKO`, [EKEKO should be correct](https://www.researchgate.net/publication/265693211_The_EkekoX_Program_Transformation_Tool) – hamena314 Feb 04 '16 at 15:24
  • Yes, but I think you misspelled the tag. :) ... EDIT: And the word in the text – hamena314 Feb 04 '16 at 15:27
  • Yes its Ekeko, sorry typing mistake :) – user3006595 Feb 04 '16 at 15:34
  • Alfabravo, my problem that I need to make the idea to solve this problem clear in my mind so I can work correctly in my code. – user3006595 Feb 04 '16 at 15:36
  • The mistake was all mine :s. I'm seeing that this library was written by VUB? Sounds like a very specialized library. In any case, it is best to provide a clear code sample (ie an [MVCE](https://stackoverflow.com/help/mcve)) so people can start helping your from there. – TT. Feb 04 '16 at 15:37
  • I think that this isn't entirely possible at all. For example the problem is how the matching of methods from one version to another is done. How can you be sure that you are referring to the renamed method in the new version when all you had for identifying the method was it's class and name in the old version. The new Version for example could introduce a completly new method that would conform with your new structural regularities and also have the old version of the method. So how are you going to match the old version of the method to one of the both new versions? – SpaceTrucker Feb 04 '16 at 18:17
  • I was thinking to use the fully qualified name somehow to match two methods in different versions – user3006595 Feb 05 '16 at 13:03

0 Answers0