reverse engineering
The process of analysing an existing system to identify its components and their interrelationships and create representations of the system in another form or at a higher level of abstraction. Reverse engineering is usually undertaken in order to redesign the system for better maintainability or to produce a copy of a system without access to the design from which it was originally produced.
For example, one might take the executable code of a computer program, run it to study how it behaved with different inputs and then attempt to write a program which behaved identically (or better). An integrated circuit might also be reverse engineered by an unscrupulous company wishing to make unlicensed copies of a popular chip.