The recent document by engineers from Facebook explains how they wrote a tool that can automatically fix bugs. In the paper, they introduced ๐ฆ๐๐ฃ๐๐๐ซ, an automated tool designed to detect and repair bugs in software. The tool has suggested fixes for six essential Android apps in the Facebook App Family: Facebook, Messenger, Instagram, FBLite, Workplace, and Workchat.
How Does It Work?
๐ฆ๐๐ฒ๐ฝ ๐ญ: Detect a Crash - Another tool, ๐ฆ๐ฎ๐ฝ๐ถ๐ฒ๐ป๐, finds app crashes. When Sapienz identifies a crash, it is logged into a database.
๐ฆ๐๐ฒ๐ฝ ๐ฎ: Identify the Problem - SAPFIX pinpoints the exact line of code causing the issue. It first checks if the crash is reproducible. If it's not reproducible, the crash is discarded. It uses a technique called "spectrum-based fault localization" to identify the most likely lines of code responsible for the crash.
๐ฆ๐๐ฒ๐ฝ ๐ฏ: Suggest a Fix - Using predefined templates or code mutations, SAPFIX proposes a solution. After identifying the fault location, SAPFIX attempts to generate a patch. It employs two strategies:
๐น ๐ง๐ฒ๐บ๐ฝ๐น๐ฎ๐๐ฒ-๐ฏ๐ฎ๐๐ฒ๐ฑ ๐๐ถ๐ ๐ถ๐ป๐ด: SAPFIX uses predefined templates to suggest fixes for common bugs. These templates are designed based on standard developer practices.
๐น ๐ ๐๐๐ฎ๐๐ถ๐ผ๐ป-๐ฏ๐ฎ๐๐ฒ๐ฑ ๐๐ถ๐ ๐ถ๐ป๐ด: SAPFIX resorts to a mutation-based system if the template-based approach fails. It systematically applies a series of code mutations to the fault location to generate potential fixes.
๐ฆ๐๐ฒ๐ฝ ๐ฐ: Test the Fix - The proposed solution is tested to ensure it's valid. It uses the test cases from ๐ฆ๐ฎ๐ฝ๐ถ๐ฒ๐ป๐ to check the validity of the patch. If the patch passes all tests, it's considered a good fix. After patch validation, SAPFIX uses ๐๐ป๐ณ๐ฒ๐ฟย (a static analysis tool) to analyze the proposed fix further. Infer checks if the patch introduces any new potential issues.
๐ฆ๐๐ฒ๐ฝ ๐ฑ: Review - Developers get the final say, reviewing and approving the fix.
Check the entire document in the comments.
Image credits: Facebook.
What do you think about this?
_______
If you like my posts, please follow me, @milan_milanovic, and hit the ๐ on my profile to get a notification for all my new posts.
If you want to expand your knowledge and personal growth, subscribe to my free weekly newsletter with 16,000+ people: .newsletter.techworld-with-milan.com
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh
We are all familiar with GoF Design Patterns which represent a general reusable solution to some occurring problems in software design. They are templates for how to solve a problem that can be used many times,โฆ https://t.co/BlBIOrYiQrtwitter.com/i/web/status/1โฆ
In his latest talk at Clojure Conj 2023., Rick Hickey, a creator of Clojure, talked about some great techniques to create a great software design in practice.
We all struggle with the things we should do next and what to prioritize. Here comes the ๐๐ฒ๐๐๐ถ๐ป๐ด ๐ง๐ต๐ถ๐ป๐ด๐ ๐๐ผ๐ป๐ฒ (๐๐ง๐) ๐ณ๐ฟ๐ฎ๐บ๐ฒ๐๐ผ๐ฟ๐ธ to help.
It was developed by David Allen in the 1990s and the main idea behind GTD is that by getting all of your tasks and commitments out of your head and into a trusted system, you can reduce stress, increase productivity, and free up mental space to focus on more important things.
So, how it works is to have the following ๐น๐ถ๐๐๐:
๐ญ. ๐๐ป. Here we put all ideas we have as they occur. Write down every task, or idea that comes to mind, no matter how small or insignificant. When you are adding items here, you should ask yourself if this is actionable.