The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
1. Ecological Impact of Native vs. Cross-Platform
Mobile Apps: a Preliminary Study
Vincent Frattaroli, Olivier Le Goaër, Olivier Philippot
The 6th International Workshop on Advances in Mobile App Analysis
September 15th
, 2023
2. Mobile software eaten the world…
From “There's an App for That” (Apple, 2009), 13 years of continuous growth
Mobile software has yielded new addictive behaviours*
The industry of mobile development has undergone profound mutations
6.84 billion smartphones
8.93 million mobile apps
*Richard J.E. James et al., “Understanding the construction of ‘behavior’ in smartphone addiction: A scoping review”, Addictive Behaviors (Volume 137), February 2023
3. …while the world is facing climate change
Manufacturing user devices is the primary source of GHG in ICT field
Increasingly demanding software is driving the need to renew hardware
Software developers must play their part in the Green Deal (Europe)
Software-driven hardware obsolescence
4. Eco-friendly dev stack
Patterns & tactics
Apply best coding practices to
save energy [3]
3
Langages & runtime
Choose energy-efficient
programming languages [2]
2
Development
methodology
Choose the right type of
development to save energy [1]
1
[1] R. Horn et al., “Native vs Web Apps: Comparing the Energy Consumption and Performance of Android Apps and their Web Counterparts”, IEEE/ACM MOBILESoft 2023, Melbourne, Australia, pp. 44-54.
[2] Rui Pereira et al. “Ranking Programming Languages by Energy Efficiency”. Science of Computer Programming, volume 205. Elsevier, 2021
[3] Luis Cruz and Rui Abreu. 2019. “Catalog of energy patterns for mobile applications”. Empirical Software. Engineering. 24, 4 (August 2019)
6. Joint work for this study
Greenspector
03
● Mobile measurement company
● Testbench for Android and iOS apps
University of Pau / E2S
02
● Software engineering team
● Research on “Green Software”
inside|app
01
● Mobile app development company
● Build validation app
8. Crosscutting the carbon 3-tier
Device Network infrastructure Cloud/Data center
(including app stores)
9. 5 codebases, 8 app variants
Development kind Framework (version) Target OS
Native Swift (5.6)
Native Kotlin (1.6.10)
Crossplatform KMM (0.3.2)
Crossplatform Flutter (2.16.0)
Crossplatform React Native (0.69)
https://github.com/orgs/TurnipOffApp/repositories
10. Preliminary remarks
There is no zoo of mobile apps coded using different methods
Coding 1 realistic app using the 5 methods is time consuming (≅10 man-days)
Performing such a comparative study on dozens of apps is cumbersome
Native & cross-platform development is evolving at a very fast pace
11. Validation app (Worst Movies)
Screenshots (iOS) Baseline for a fair comparison
● End user viewpoint
○ Same look&feel
○ Same journey
● Developer viewpoint
○ No advanced architecture
○ No fine-tuning
○ No third-party libraries
12. Testbench in a nutshell
powered by Greenspector
Developer’s
computer
GDSL test
script
App under test
1 - Send test file and app package
Real
Smartphones
Test bench
Server
Core server
Back-end
Server
Greenspector Premises
Web Interface (Dashboard)
Result recording
3 - Displaying results
2 - Waiting for live measurements
Communication needed if application
requires backend access
Communication needed if application
requires backend access
Domain-specific language for
fully automated testing
13. Results (partial)
Development
App size (KB) Data transfer (KB) Energy (mAh)
Swift N/A 216 N/A ? N/A 8,59
Kotlin 1200 N/A 944 N/A 21,60 N/A
KMM 3600 1600 932 ? 21,66 ?
Flutter 17500 18000 1190 ? 18,27 9,19
React Native 27300 13100 706 ? 19,45 11,62
Average data from 10 repetitions
14. At first glance
Native development is indisputably the best solution on both OS
React Native is by far the less data-intensive solution over the network
on Android (No data regarding iOS)
Flutter is doing very well in terms of energy-savings, on both OS
15. Takeways
Targeting iOS only
Apps with few network interactions
Other cases
Always Native development
In general, Native development
No general rule of thumb
But nothing beats an app “sober-by-design”
16. Conclusion
Ecological impact of app development methods is an understudied topic
Including iOS in the study is our pride, but also our weakness (missing values)
This study ought to be continued: repeat experiment, new releases, etc.
Our github repo may bootstrap research works about native vs. cross-platform