SlideShare una empresa de Scribd logo
1 de 12
How to improve
Code Quality?
iOS apps
RECOMMENDATIONS
Code Quality
Continuous
Inspection
Unit
Testing
2
Sonar covers the 7 axes of code quality
SONAR an open source web application
to manage code quality
Key metrics
 Potential bugs
 Potential performance problems
 Potential security issues
 Duplicates
 Unused Code
 Code Complexity
 Technical debt
 Сoverage
Community Plugin
5
FREE
No support
Might not support Xcode 8
https://github.com/Backelite/sonar-
objective-c
Official Plugin
6
€ 5,000 per year
Support included
Frequent new releases
http://www.sonarsource.com/products/plugi
ns/languages/objective-c/
Comparison
community plugin official plugin
price Free € 5,000 per year
support no included
metrics •Complexity: uses Lizard
•Documentation: blank comments, comment
lines, %
•Duplication: blocks, linkes, %
•Issues: Uses OCLint: 63 rules, and Faux Pas: 102
rules
•Size
•Test: Uses xctool, will probably switch to
xcodebuild + xcpretty soon
•Code coverage: With gcovr for project before
Xcode 7, otherwise slather
more details: https://github.com/octo-
technology/sonar-objective-
c/wiki/Features, https://github.com/Backelite/son
ar-objective-c
200+ rules: details
supported
systems
•Given that there is no official support, POC is
required to check it whether it works with XCode
8
•0.4.x releases for SonarQube >= 4.3 (4.x and 5.x)
•latest release was in 01/2015
•no information about XCode
supported
•all Sonar versions are
supported
Recommendations
Configure Objective C and Swift
community plugins
Set up daily scans
Configure daily emails
to the dev team
Analyze results
•Define areas for improvements:
•Security, unused code, code
duplicates, potential performance
issues
•Reduce code complexity
•Fix existing critical and major issues
Fix new issues
8
If community plugins don’t work - buy an official plugin
Metrics and KPIs to track
Track Issues provided by plugin:
◦ fix blockers and majors
◦ set an acceptable threshold for minor and info
Track the next metrics:
◦ technical debt (calculated by the tool)
◦ security issues
◦ unit test coverage
◦ duplicated code
◦ complexity:
◦ cyclomatic complexity number
◦ number of parameters
Unit Testing
Don’t test trivial code!
Scope of Unit Testing:
◦ View Models
◦ Generic Algorithms
◦ Managers with business logic
◦ Complicated View Controllers
Expected incremental coverage is ~60%
◦ Code coverage is not a primary goal for unit testing!
Tools:
◦ XCTest
◦ Sonar
◦ Jenkins – add unit tests to build lifecycle
10
Unit testing –
Process recommendations
Write unit tests
for the code to
be refactored
Write unit tests
during bug
fixing
Start unit
testing for the
new code
11
Exampleofaunittest
12
class LabelValuesTests: XCTestCase {
var vc: ViewController!
override func setUp() {
super.setUp()
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
vc = storyboard.instantiateInitialViewController() as! ViewController
}
func testLabelValuesShowedProperly() {
vc.updateLabels(Float(80.0), Float(50.0), Float(40.0))
// The labels should now display 80, 50 and 40
XCTAssert(vc.numberLabel.text == "80.0", "numberLabel doesn't show the right text")
XCTAssert(vc.percentageLabel.text == "50.0%", "percentageLabel doesn't show the right text")
XCTAssert(vc.resultLabel.text == "40.0", "resultLabel doesn't show the right text")
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the
class.
super.tearDown()
}
}

Más contenido relacionado

La actualidad más candente

Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSourceOleksii Prohonnyi
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated TestingLee Englestone
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumLiraz Shay
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkSteve Zhang
 
Selenium Design Patterns
Selenium Design PatternsSelenium Design Patterns
Selenium Design PatternsLiraz Shay
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'tsPekka Klärck
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review ProcessDr. Syed Hassan Amin
 
Code Review
Code ReviewCode Review
Code ReviewTu Hoang
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with MaveryxMaveryx
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshersNaga Mani
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09Pyxis Technologies
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionSoftware Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionMazenetsolution
 

La actualidad más candente (18)

Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSource
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Selenium Design Patterns
Selenium Design PatternsSelenium Design Patterns
Selenium Design Patterns
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
Code Review
Code ReviewCode Review
Code Review
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with Maveryx
 
Unit Testing 101
Unit Testing 101Unit Testing 101
Unit Testing 101
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshers
 
Using Specflow for BDD
Using Specflow for BDDUsing Specflow for BDD
Using Specflow for BDD
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
 
Automated tests to a REST API
Automated tests to a REST APIAutomated tests to a REST API
Automated tests to a REST API
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionSoftware Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
 

Destacado

Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Kate Semizhon
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile ManagementKate Semizhon
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase Kate Semizhon
 
solution architect
solution architectsolution architect
solution architectOleg Miroff
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change ManagementKate Semizhon
 
Pathway to solution architect
Pathway to solution architectPathway to solution architect
Pathway to solution architectVolodymyr Yelchev
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices Kate Semizhon
 
Software engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceSoftware engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceAlexey (Mr_Mig) Migutsky
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATGKate Semizhon
 
Practical SOA for the Solution Architect
Practical SOA for the Solution Architect Practical SOA for the Solution Architect
Practical SOA for the Solution Architect WSO2
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool EvaluationKate Semizhon
 

Destacado (20)

ATG Best Practices
ATG Best Practices ATG Best Practices
ATG Best Practices
 
Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers Oracle ATG Commerce Overview for developers
Oracle ATG Commerce Overview for developers
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile Management
 
ATG Advanced RQL
ATG Advanced RQLATG Advanced RQL
ATG Advanced RQL
 
ATG pipelines
ATG pipelinesATG pipelines
ATG pipelines
 
How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase How a project is born. Intro to Discovery Phase
How a project is born. Intro to Discovery Phase
 
Ecommerce in 2018
Ecommerce in 2018Ecommerce in 2018
Ecommerce in 2018
 
solution architect
solution architectsolution architect
solution architect
 
Database Change Management
Database Change ManagementDatabase Change Management
Database Change Management
 
Pathway to solution architect
Pathway to solution architectPathway to solution architect
Pathway to solution architect
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices
 
Software engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceSoftware engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least once
 
SEO Instruments in ATG
SEO Instruments in ATGSEO Instruments in ATG
SEO Instruments in ATG
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
 
Code Review for iOS
Code Review for iOSCode Review for iOS
Code Review for iOS
 
Sonar technology ppt
Sonar technology pptSonar technology ppt
Sonar technology ppt
 
Lean Security
Lean SecurityLean Security
Lean Security
 
Sonar
SonarSonar
Sonar
 
Practical SOA for the Solution Architect
Practical SOA for the Solution Architect Practical SOA for the Solution Architect
Practical SOA for the Solution Architect
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool Evaluation
 

Similar a How to improve code quality for iOS apps?

Deepak_Resume_Automation
Deepak_Resume_AutomationDeepak_Resume_Automation
Deepak_Resume_AutomationDeepak Pandey
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Stephen Ritchie
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Updatejamieayre
 
End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020Abhijeet Vaikar
 
Java Code Quality Improvements - DevWeek
Java Code Quality Improvements - DevWeekJava Code Quality Improvements - DevWeek
Java Code Quality Improvements - DevWeekZoltan Iszlai
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaNexus FrontierTech
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should knowRichard Cheng
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingShyam Sunder Verma
 
Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineeringgaoliang641
 
Code quality
Code qualityCode quality
Code qualityProvectus
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.Matt Eland
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeEmre Dündar
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedAshley Zupkus
 
GPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators FamiliesGPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators FamiliesMohamed BOUSSAA
 

Similar a How to improve code quality for iOS apps? (20)

Deepak_Resume_Automation
Deepak_Resume_AutomationDeepak_Resume_Automation
Deepak_Resume_Automation
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
 
Pragmatic Code Coverage
Pragmatic Code CoveragePragmatic Code Coverage
Pragmatic Code Coverage
 
End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020
 
Java Code Quality Improvements - DevWeek
Java Code Quality Improvements - DevWeekJava Code Quality Improvements - DevWeek
Java Code Quality Improvements - DevWeek
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineering
 
Code quality
Code qualityCode quality
Code quality
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.
 
NET Code Testing
NET Code TestingNET Code Testing
NET Code Testing
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
 
1506.08725v1
1506.08725v11506.08725v1
1506.08725v1
 
GPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators FamiliesGPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators Families
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

How to improve code quality for iOS apps?

  • 1. How to improve Code Quality? iOS apps RECOMMENDATIONS
  • 3. Sonar covers the 7 axes of code quality SONAR an open source web application to manage code quality
  • 4. Key metrics  Potential bugs  Potential performance problems  Potential security issues  Duplicates  Unused Code  Code Complexity  Technical debt  Сoverage
  • 5. Community Plugin 5 FREE No support Might not support Xcode 8 https://github.com/Backelite/sonar- objective-c
  • 6. Official Plugin 6 € 5,000 per year Support included Frequent new releases http://www.sonarsource.com/products/plugi ns/languages/objective-c/
  • 7. Comparison community plugin official plugin price Free € 5,000 per year support no included metrics •Complexity: uses Lizard •Documentation: blank comments, comment lines, % •Duplication: blocks, linkes, % •Issues: Uses OCLint: 63 rules, and Faux Pas: 102 rules •Size •Test: Uses xctool, will probably switch to xcodebuild + xcpretty soon •Code coverage: With gcovr for project before Xcode 7, otherwise slather more details: https://github.com/octo- technology/sonar-objective- c/wiki/Features, https://github.com/Backelite/son ar-objective-c 200+ rules: details supported systems •Given that there is no official support, POC is required to check it whether it works with XCode 8 •0.4.x releases for SonarQube >= 4.3 (4.x and 5.x) •latest release was in 01/2015 •no information about XCode supported •all Sonar versions are supported
  • 8. Recommendations Configure Objective C and Swift community plugins Set up daily scans Configure daily emails to the dev team Analyze results •Define areas for improvements: •Security, unused code, code duplicates, potential performance issues •Reduce code complexity •Fix existing critical and major issues Fix new issues 8 If community plugins don’t work - buy an official plugin
  • 9. Metrics and KPIs to track Track Issues provided by plugin: ◦ fix blockers and majors ◦ set an acceptable threshold for minor and info Track the next metrics: ◦ technical debt (calculated by the tool) ◦ security issues ◦ unit test coverage ◦ duplicated code ◦ complexity: ◦ cyclomatic complexity number ◦ number of parameters
  • 10. Unit Testing Don’t test trivial code! Scope of Unit Testing: ◦ View Models ◦ Generic Algorithms ◦ Managers with business logic ◦ Complicated View Controllers Expected incremental coverage is ~60% ◦ Code coverage is not a primary goal for unit testing! Tools: ◦ XCTest ◦ Sonar ◦ Jenkins – add unit tests to build lifecycle 10
  • 11. Unit testing – Process recommendations Write unit tests for the code to be refactored Write unit tests during bug fixing Start unit testing for the new code 11
  • 12. Exampleofaunittest 12 class LabelValuesTests: XCTestCase { var vc: ViewController! override func setUp() { super.setUp() let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) vc = storyboard.instantiateInitialViewController() as! ViewController } func testLabelValuesShowedProperly() { vc.updateLabels(Float(80.0), Float(50.0), Float(40.0)) // The labels should now display 80, 50 and 40 XCTAssert(vc.numberLabel.text == "80.0", "numberLabel doesn't show the right text") XCTAssert(vc.percentageLabel.text == "50.0%", "percentageLabel doesn't show the right text") XCTAssert(vc.resultLabel.text == "40.0", "resultLabel doesn't show the right text") } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } }

Notas del editor

  1. FREE: Track your iOS app code quality using Sonar: http://blog.octo.com/en/track-your-ios-application-code-quality-using-sonar/community plugin: https://github.com/Backelite/sonar-objective-c
  2. NOT FREE: SonarSource Objective-C http://www.sonarsource.com/products/plugins/languages/objective-c/ Documentation: http://docs.sonarqube.org/pages/viewpage.action?pageId=3080359 Automated Objective-C code quality analysis 200+ coding rules Coding rules for MISRA-C and MISRA-C++ MITRE CWE coverage CWE Compatible Support for user-defined coding rules
  3. Siva