今天我从一个朋友那里收到了一个非常有趣的问题,但我没能给出一个满意的答案。
“如何衡量Android上的代码质量?”
首先,我说Sonar是一个很好的工具,但后来我意识到它有点过时了,不是吗?作为一个通用术语,我想说的是测试覆盖率,但坦率地说,高代码覆盖率并不意味着经过良好测试的代码。
所以伙计们,如果你们能在这个问题上添加一些好的答案,我将非常高兴!“你如何衡量Android上的代码质量?”
发布于 2016-03-23 07:53:33
我不认为有一个简单的答案。如果您需要一组工具来衡量代码质量,以下是一些工具:
1) FindBugs for Java (http://findbugs.sourceforge.net/)
2) Checkstyle for Java (http://checkstyle.sourceforge.net/)
3) Android Lint (http://developer.android.com/tools/debugging/improving-w-lint.html)
4) Jenkins/Hudson for build-automation
5) Valgrind for C++/native library (http://valgrind.org/docs/manual/dist.readme-android.html)
6) JUNITs for unit test coverage
7) Crashlytics (https://try.crashlytics.com/) (This is not free, there may be other alternatives)
8) Google Analytics
9) Code review tool of your choice
10)LeakCanary (https://github.com/square/leakcanary)
11) Relic (https://newrelic.com/ -- Paid)可能还有更多,但我经常使用其中的一些来交叉检查代码质量。
更重要的是,这里有一个很好的优质工具列表:https://github.com/stephanenicolas/Quality-Tools-for-Android
您和您的团队需要就基线达成一致并遵循它。
https://stackoverflow.com/questions/36167326
复制相似问题