スキップしてメイン コンテンツに移動

投稿

ラベル(Code Inspection)が付いた投稿を表示しています

Measure Code & Improve Team Based Software Development

Introduction In this post, I'm going to write about "Why & How to measure your code of software project. And improve it." I am going to mainly write about this topic from the static code analysis point. Why Measure? There are number of reasons to measure your code. For me especially following reasons (or intentions). Daily Health Check Keep code base clean See impact on entire code base by your code change Detect problems as soon as possible Feel improvement! Let every team members show what happens Monitor test result status Follow coding standard Especially in team based software development, a lot of people change code for different task. And each developer is hard to know what each developer change the code for what purpose. If the source code measurement is public for everyone, it helps everyone to know affect of entire project which the other developers make. What to Measure? There are a lot of measurement is proposed but from static...

PMD and CPD for ECMAScript (Javascript)

Recently I have tried to use PMD and CPD for Javascript. I found that the offical PMD release says PMD 5.0.0 supports Javascript :D We have strong code inspection tools like Sonar etc. But I think still helpful for setting up compact ant task. PMD PMD ant task setup for javascript is easy, almost same as Java. Only you have to remember is including rhino jar in the classpath. Here is the example. <property name="buildscripts.path" location="${basedir}/generic-buildscripts"/> <property name="pmd.jar" value="pmd-5.0.0.jar"/> <property location="rhino-1.7R3.jar" name="rhino.jar"/> <path id="pmd.classpath"> <fileset dir="${buildscripts.path}/pmd/"> <include name="asm-3.2.jar"> <include name="jaxen-1.1.1.jar"> <include name="${pmd.jar}"> <include pa...

Helpful Development Tools & Software (Build, Test, Inspection, CI, etc....)

Test Tools JUnit JMeter FIT Testing Eclipse Test & Performance Tools Platform Project : Eclipseで使えるパフォーマンステストツール JUnitPerf : Performance Test tool Selenium : Web系の自動テストの決定版 zohhak : JUnit標準のparameterizedテストは色々と書くのが面倒ですが、これを使うとかなりsimpleにテストを書けます!以下はサイトに載っていたコードの例です。 @TestWith({ "clerk, 45'000 USD, GOLD", "supervisor, 60'000 GBP, PLATINUM" }) public void canAcceptDebit(Employee employee, Money money, ClientType clientType) { assertTrue( employee.canAcceptDebit(money, clientType) ); } Mock JMock EasyMock Mockito : 個人的にはこれがお勧め。使いやすいです。 Behavior Driven Development http://jbehave.org/ JDave Instinct Wikipedia にJava以外の言語のBDDツールも大量に載っています。 Code Coverage Tools ここ が参考になります。以下、代表的なものを2つあげておきます。 ATLASSIAN 社の Clover EMMA :私はこのツールを使っています。Cloverのようにグラフが表示されないのが、ちょっと残念。データ自体はあるので簡単に作れそうですが(汗)。ちなみに私は、 EMMA Reference Manual や Emma+Antをofflineモードで実行する の記事を参考にAnt scriptを書きました。 Matching hamcrest : テスト時に可読性を上げた...