51Testing软件测试网bc0BKp
51Testing软件测试网`K)yw5?X q
Android Lint是另一种静态代码分析检查工具,专门为Android服务。它通过对Android工程源码进行静态代码分析,发现潜在的缺陷和优化改进项。Android Lint可以在correctness正确性、security安全性、performance性能、usability可用性、accessibility可访问性和internationalization国际化这几个层面分析代码。正如官方网站所说,它是非常强大的,能给开发者大量的建议以提高代码质量。0IzQ4P:x%|#O0
k{iEYk0
实际开发中通常遇到的主要包含以下几种类型的错误检查:djw!y'kOP0
l Missing translations (and unused translations),缺失的翻译问题。wca4k4To4}J G0
l Layout performance problems (all the issues the old layout opt tool used to find, and more),布局性能问题。51Testing软件测试网C+QW:L"k|mBRt#H
l Unused resources,未使用的冗余资源问题。51Testing软件测试网K.Nqg"}5k
l Inconsistent array sizes (when arrays are defined in multiple configurations),数组大小不一致问题。v'^YD1EQ0
l Accessibility and internationalization problems (hardcoded strings, missing content description, etc),可访问性和国际化问题。\%l*@K
Y8P1B
Rk%r0
l Icon problems (like missing densities, duplicate icons, wrong sizes, etc),图标问题。\TR*UBv;pc0
l Usability problems (like not specifying an input type on a text field),可用性问题。;E,Un.Fxz3d6xZ0
l Manifest errors,明显的错误。lquZH9@"x0
51Testing软件测试网N$vUN`k
Android Lint提供了命令行执行和IDE(如eclipse)集成两种使用方式,并提供了html形式的输出报告。Lint支持自定义分析策略,在eclipse的preference中可以对lint规则进行全局配置,设置所有项目默认的lint检查规则的检查级别等。此外,还可以通过编辑某个项目的lint.xml文件来灵活实现局部规则配置。Ml!dkHt0
51Testing软件测试网`@FS&AkTSuno"XF;G$~M0
Lint检查结果同样是根据问题严重程度分为多个级别,通常包含:Fatal、Errro、Waring、Information和Ingore等几类w%s&`HM9?0
具体去官网了解&RQ4_l#uE6d']Q0
有兴趣的同学可以体验下
51Testing软件测试网"h
f\y"G2]!G`
51Testing软件测试网8Jr;`^"Sq
51Testing软件测试网s4qwSB!ZpDW&f