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!