Simian Similarity Analyzer

Mục lục bài viết

Prevent Code Duplication Errors

Imagine a bug is discovered within a method somewhere in a project. The developer writes a test case,
makes the necessary code changes, ensures the test passes, commits the code and considers the job
finished!

Unknown to the developer, some weeks earlier, a fellow team member discovered the same piece of code
and realized that it did almost everything they needed to solve a problem they were working on at the
time. They copied the code into their new method, added some more code to do the extra functionality
required, and committed the changes.

Of course what they didn’t know at the time was that the code they were copying had a bug in it! Now
the original bug has been fixed but unfortunately copies of it persist.

Copying and pasting isn’t the only way for this to occur. Duplicate code can also creep in by
developers independently implementing similar features.

Simian Similarity Analyzer catches these and other instances of duplication and can be configured to
either flag them as warnings or even “break the build”, ensuring that copy/paste never again causes
these problems.

Xổ số miền Bắc