1. A method of identifying portions of a computer program comprising the steps of: (a) receiving from a user a computer program fragment including multiple program elements; (b) abstracting the computer program fragment into a search graph capturing a logical hierarchy of program elements of the computer program fragment; (c) matching the search graph against multiple corresponding target graphs capturing the logical hierarchy of program elements of different multiple portions of the computer program; (d) returning at least one of the multiple portions of the computer program having a target graph matching at least a portion of the search graph according to a predetermined matching condition.