Overview
The article discusses LinkedIn's approach to Continuous Integration (CI) for mobile applications, detailing the architecture, CI pipeline stages, and testing methodologies used to ensure rapid development and deployment. It emphasizes the importance of automated testing in maintaining code quality and catching bugs early in the development cycle.
What You'll Learn
1
How to implement a continuous integration pipeline for mobile applications
2
Why automated testing is crucial for mobile app development
3
How to use JsTestDriver for unit testing in JavaScript
4
When to apply end-to-end testing in the deployment process
Prerequisites & Requirements
- Understanding of Continuous Integration concepts
- Familiarity with testing frameworks like JsTestDriver and Selenium(optional)
Key Questions Answered
What stages are involved in LinkedIn's mobile continuous integration pipeline?
LinkedIn's mobile CI pipeline consists of five stages: unit tests, fixtures tests, layout tests, deployment to a staging environment, and end-to-end tests. Each stage must pass 100% before proceeding to the next, ensuring thorough testing and quality assurance.
How does LinkedIn ensure code coverage in their CI process?
LinkedIn uses JsTestDriver to execute unit tests after every commit, which also calculates code coverage. This approach helps maintain a code coverage of 75%, allowing for early bug detection during development.
What tools does LinkedIn use for end-to-end testing?
LinkedIn employs Selenium WebDriver and TestNg for end-to-end testing. They utilize iPhoneDriver for testing on iPhone simulators and plan to use AndroidDriver for Android testing, which has recently resolved CSS selector issues.
What are the benefits of using mock data in fixtures tests?
Using mock data in fixtures tests allows for faster execution and helps identify client-side bugs. It also enables testing against various HTTP status codes, ensuring that the client handles errors gracefully.
Key Statistics & Figures
Overall code coverage
75%
This coverage is achieved through various testing stages in the CI pipeline, allowing for effective bug detection.
Unit tests execution time
less than 10 seconds
This rapid execution time allows for quick feedback during the development process.
Bug detection turnaround time
less than 5 minutes
Bugs are typically identified shortly after new code commits, facilitating a responsive development environment.
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Backend
Node.js
Used on the server-side to handle RESTful requests from mobile applications.
Testing
Jstestdriver
JavaScript unit testing framework used for executing unit tests and calculating code coverage.
Testing
Selenium Webdriver
Framework used for end-to-end testing across different platforms.
Testing
Testng
Testing framework used in conjunction with Selenium for end-to-end tests.
Key Actionable Insights
1Implementing a five-stage CI pipeline can significantly enhance the quality of mobile applications.By ensuring that each stage of testing must pass before moving forward, teams can catch bugs early and reduce the risk of issues in production.
2Utilizing tools like JsTestDriver for unit testing can improve code coverage and maintainability.This tool not only facilitates unit testing but also provides insights into code coverage, which is crucial for identifying untested parts of the code.
3Incorporating end-to-end tests in the CI process is essential for catching integration issues.These tests simulate real user interactions, helping to identify problems that may not be caught in earlier testing stages.
Common Pitfalls
1
Neglecting the importance of early-stage testing can lead to undetected bugs in production.
Without thorough unit and fixtures tests, issues may not be caught until later stages, making them more costly and time-consuming to fix.
2
Relying solely on manual testing for UI can result in inconsistent results.
Automated layout tests using tools like WebKit Layout and Rendering help ensure consistent UI rendering across different environments.
Related Concepts
Continuous Integration
Automated Testing
Mobile Application Development
Testing Frameworks