# facebook-sdk

Published articles for facebook-sdk.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Understanding & Assessing Visual Regression Testing

DevFeed: [Understanding & Assessing Visual Regression Testing](<https://devfeed.tech/articles/understanding-assessing-visual-regression-testing-22787.md>)

Original publisher: [Read original article](<https://medium.com/microsoft-mobile-engineering/understanding-assessing-visual-regression-testing-4384529a8dd8?source=rss----87f10537e947---4>)

Author: Nikhita Reddy Eega

Published: 2023-07-27T12:58:43Z

Content type: article

Language: en

Sources: [Android@Microsoft](<https://devfeed.tech/sources/android-microsoft-medium.md>)

Topics: [visual-regression-testing](<https://devfeed.tech/topics/visual-regression-testing.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [2021](<https://devfeed.tech/tags/2021.md>), [about](<https://devfeed.tech/tags/about.md>), [approach](<https://devfeed.tech/tags/approach.md>), [avoid](<https://devfeed.tech/tags/avoid.md>), [based](<https://devfeed.tech/tags/based.md>), [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [building](<https://devfeed.tech/tags/building.md>), [can](<https://devfeed.tech/tags/can.md>), [cashapp-paparazzi](<https://devfeed.tech/tags/cashapp-paparazzi.md>), [challenges](<https://devfeed.tech/tags/challenges.md>), [changes](<https://devfeed.tech/tags/changes.md>), [code](<https://devfeed.tech/tags/code.md>), [compare](<https://devfeed.tech/tags/compare.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [components](<https://devfeed.tech/tags/components.md>), [facebook-sdk](<https://devfeed.tech/tags/facebook-sdk.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [regression](<https://devfeed.tech/tags/regression.md>), [regression-testing](<https://devfeed.tech/tags/regression-testing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [visual-regression-testing](<https://devfeed.tech/tags/visual-regression-testing.md>)

### AI overview

Visual regression testing compares a newly captured UI snapshot with a saved "Golden" baseline; the allowed pixel difference sets the regression threshold. During View-to-Compose migration, changes in framework and styling can alter details such as padding and margins. The excerpt compares two tools: Facebook SDK is instrumentation based, requires an emulator or device, and captures whole activities or individual Views. It captured a Compose activity but not individual composables in the described tests; the article also reports an obstacle with its storage permission on Android 11 and later. Paparazzi runs modular unit tests on the JVM without a device, uses layoutlib to render screenshots, and offers capture APIs for Views and composables. The tests showed component sizing inaccuracies, for which the excerpt mentions a workaround, and the tool's layoutlib dependency can require coordinated build-system updates. Paparazzi ran faster in the reported comparison, though the tools use different testing types.

### Source excerpt

Understanding & Evaluating Visual Regression TestingPhoto by Jessica Ruscello on UnsplashDive into learning about VRT tools like Facebook SDK, Paparazzi and study their compatibility for migration. Since Jetpack Compose was released in 2021, its declarative programming model has offered a modern and intuitive approach to building user interface. Compared to View system framework, Compose promotes cohesion and simplifies state-management. This framework is lightweight because the UI components are built using composable functions as separate building pieces. With this paradigm shift, boilerplate code is lessened, code reuse is encouraged, and the development process is made simpler. Migrating to Compose seems quite appealing. Will there be any regression if we migrate from one framework to another, though? Because Compose is still relatively new compared to the well-established View-based UI, there might be potential challenges faced during the migration period. What about visual regressions? Possible visual regressions can be encountered due to different UI frameworks, view configuration and styling approach. Styling and themes are usually defined in XML resource files which are applied to the views and then rendered. Whereas in Compose, these are programmatically defined in Kotlin and then takes advantage of efficient recomposition. These variances may result in changes to padding, margin, etc. Thus, to maintain a seamless transition and avoid any visual bugs going unreported, visual regression testing can be used. This ensures that the final UI is consistent to enhance user experience. Understanding Visual Regression Testing (VRT): Let us now break down the process into two design approaches -- High level and Low level High-Level Design Approach Consists of 2 steps: 1) Record -- Generating a snapshot and saving it as Golden (baseline/reference snapshot used to compare subsequent snapshots) 2) Verify -- Compares the two snapshots High level design flowLow-Level Design