I am designing my own algorithm to check if 2 codes are similar or identical?

How do pre-exsting softwares do this?
What logic do they use?
Are there different levels of testing for this?
please give detailed answers

CLOSED DUE TO DOUBLE POST, SEE http://www.daniweb.com/software-development/cpp/threads/420816/how-to-check-2-codes-are-similar-or-identical

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.