Uber open source Piranha, can automatically delete obsolete codes

Uber open up an automated tool Piranha, the tool can automatically delete outdated and unused code from the application code base.

the Piranha, meaning "piranha"

According to the introduction Uber official blog, development Piranha intention is to eliminate the negative impact brought about by obsolete codes. When the characteristics of a user has pushed to 100%, or some of the experimental function fails, identification characteristic (feature flags code ) become obsolete. And it may lead to technical debt, so that applications become more bloated, developers do this more unnecessary operations to be performed, and may even affect the overall performance of the program. Cancellation of debt is not only time-consuming, it can also affect the development of new features.

To automate this process, Uber developed the Piranha , it can scan the source code to remove the outdated identification characteristics related code, making the code base cleaner, safer, higher performance, and easier to maintain. For businesses, the Piranha help speed up development cycles, reduce maintenance costs and improve the user experience.

So far, the Piranha is already  Uber's  running for quite a while Android and iOS code base, is used to delete obsolete about two thousand properties logos and related codes. Piranha after open source contains three separate versions, supporting three different languages: Objective-C, Swift and Java.

Piranha will first enter the identification name, and an identification of the expected behavior of the process name , followed by the abstract syntax tree analysis program (AST) to generate the appropriate reconstructed, and package into the diff, assigned to the further examination of the corresponding , authors can commit the changes to the main code base, or perform other reconstruction if necessary.

Uber expressed, the Piranha reconstructed executable code as a standalone tool, or as part of the workflow of the duct. The conduit may be periodically and automatically generate diff task to remove stale identification characteristics.

The figure shows the architecture diagram Piranha pipe. Mr. Piranha will become a diff, put it in a code review system, the original author of the review were identified as the default. Authors can accept the diff as it is, needs to be modified in accordance with, or reject and mark it as not being STALE (not outdated) . The pipeline is also a task management system generates a cleanup task to track the status of each of diff. In addition, because the developers are not always able to act on them in a timely manner, there is also introduced a robot is called PiranhaTidy reminded to regularly add reminders Piranha related tasks.

Piranha pipe heuristic ( heuristic) method, more than a certain period of time considered obsolete unmodified identifier, and generates a diff for them. As for the specific time period is provided, it can be customized. According to  Uber say, Piranha can process millions of lines of code, an average of less than 3 minutes to generate diff.

Next, the Piranha is likely to expand to more languages, Uber call for more developers to come together to contribute to it.

About  more information can be viewed Piranha Uber original blog: https://eng.uber.com/piranha/ 

Guess you like

Origin www.oschina.net/news/114195/uber-opensources-piranha