1. A computer-implemented method for transforming source code of an application, the method comprising: receiving the source code in a programming language; identifying a plurality of blocks in the source code using a first pattern, wherein a pattern comprises a text string that includes one or more restrictions and a piece of text matches the pattern if the piece of text satisfies the one or more restrictions of the pattern; classifying two or more of the plurality of blocks into a logic block that corresponds to a business rule; discovering a knowledge element from the logic block using a second pattern, the knowledge element being one of the following: a data entity and a variable; tracing a life cycle of the knowledge element in the logic block; and transforming the source code into a desired target format based on a third pattern and the life cycle of the knowledge element.