We recently ran a code counting tool on our iOS source code, because we were trying to estimate how long rewriting our Android app will take. Since the numbers are mildly interesting, I thought I would share the results on the blog.
Gaia GPS and related apps end up being about 70K lines of “real” code, or 30% more if you count comments and whitespace and such. About 20,000 lines of code applies to one of five specific apps (like Gaia GPS vs. Offline Topo Maps), and about 50,000 lines of code is the core platform that all our apps share.
- 22158 view_controllers objc=22158
- 20470 apps objc=20470
- 18099 controllers objc=14078,ansic=4021
- 7562 top_dir objc=7562
- 4353 views objc=4353
- 4334 util objc=4334
- 3311 data objc=3311
There are also some estimates provided by the “sloccount” tool on how long all of this took. It’s a very rough estimate, but it’s not totally off the mark from our own back-of-the-envelope calculation.
- Development Effort Estimate, Person-Years (Person-Months) = 22.59 (271.08)
- (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
- Schedule Estimate, Years (Months) = 1.75 (21.01)
- (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
- Estimated Average Number of Developers (Effort/Schedule) = 12.90
- Total Estimated Cost to Develop = $ 3,051,635
- (average salary = $56,286/year, overhead = 2.40).
- SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
If you are an iOS developer, you can count your code from the Terminal too:
- brew install sloccount
- sloccount MY_DIR