10 September 2010
Knowing Linux Processes
16 April 2009
Emma - Java Code Coverage Made Easy (Part 3)
I have also come up with a little interactive presentation with flash using Wink on Emma. It can be accessed through this link
14 April 2009
Emma - Java Code Coverage Made Easy (Part 2)
Downloading and Installing Emma
Emma comes in three different versions - binaries with examples, source and libraries. In order to do this example, we need to download "binaries with examples and documentation". You can directly download it form Sourceforge.net or you can access Sourceforge project via Emma home page. Irrespective of the way you choose, please make sure that you download Emma binaries with example version. After downloading emma.
# In order to run Emma from command line and to get report in test file
java -cp emma.jar emmarun -cp . example.GreaterTestDriver
# In order to run Emma from command line and get report in HTML but without Source Code
java -cp emma.jar emmarun -r html -cp . example.GreaterTestDriver
# In order to run Emma from command line, get report in HTML and merge the result with Source Code
java -cp emma.jar emmarun -sp . -r html -cp . example.GreaterTestDrive
12 April 2009
Emma - Java Code Coverage Made Easy (Part 1)
As a tester, we generally used to get requirements, design documents (?) and finally code in binary format. If you apply general system thinking, tester is above developer simply because he supervises developers' work and validates it. The confidence level of the tester has to impeccable so that the project managers, product managers can have sound sleep and sound sleep every night. This confidence comes with thoroughness of testing and this ability is only possible if you eat, sleep, think with testing in your head and practice testing as art. You might be watching YouTube, but yet you will think like a tester. You might be doing test strategy, test planning, test plan, sophisticated test case design. All these comes in the following ways - requirements, design document, your understanding about how the code will look like and ad hoc testing. But is that sufficient. We are living in the world of doing more and wanting more, testing effectiveness is no exception. Is there a mechanism by which I can measure my test suite effectiveness. Yes, it is there. The rest of the post deals with doing code coverage for Java applications using Emma, an open source code coverage tool.
First, what is code coverage? The process of measuring or seeing which part of code that are tested and the areas that are not at all tested is called code coverage. Second, why is it important? The answer is read the definition again. Period. If you are unit testing you code, it helps you to see the coverage immediately and hence you can fix it "then and there" and butterflies will not fly in your stomach when the product goes to testing team. If you are a tester, it helps you to measure - first your test plan and then the code. Naturally, you will write more test cases or change the existing test cases to cover more. The point is "more coverage". So, no more butterflies in your stomach too when your product goes out to production.
Emma is an open source software which is simple, powerful and flexible. Emma uses bytecode instrumentation technique and measures the code coverage. It has the ability to instrument the classes on-the-fly and also supports offline instrumentation. In on-the-fly instrumentation, you just give the location of your Jar file or class files, Java Virtual Machine when it loads the classes it instruments the logic for code coverage. In offline mode, you need to do an additional step of adding the logic to Jar/class files and copy it in your hard disk and load the instrumented classes to Java Virtual Machine. But irrespective the method you choose, the code coverage will be same. The offline mode is particularly helpful when you have custom classloaders like application servers or servlet container.
You can run Emma directly from command line and you can also integrate with nightly build as a part of continous improvement strategy. Ideally, in nightly build, code coverage works hand in hand with Unit Testing Framework like JUnit. After instrumentation, you have carry out your testing. When you are testing, Emma does the code coverage. Once you are done with the testing, you can safely stop the application. Emma also comes with reporting and it can produce reports in HTML and XML. The report can also be merged along with source code and by just looking at this report, you can identify the lines that not covered.
Apart from running Emma from command line and including with ant, it can also be used at developer's desktop. Emma has plugins for famous IDEs - Eclipse and Netbeans. With this, the developer's can run their unit test cases with Emma immediately after implementing a unit of code. Based on the coverage, they can work on their unit test cases to achieve better coverage. Better coverage, better quality and improved confidence. With this, we come to an end on introducing Emma - Open Source Java Code Coverage Solution.
In the next post, we will be discussing how to install Emma and use it.
Have a Great Day
I have also come up with a little interactive presentation with flash using Wink on Emma. It can be accessed through this link
11 April 2009
Speaking Experience @ ILUG Chennai Monthly Meet
22 March 2009
Couple of Workshops Next Month
The next workshop is still conceptual stage and I am discussing with ILUC, Chennai co-ordinator Mr Bharathi Subramanian. I proposed a talk on SNORT and he came up with a brilliant idea on conduting a full day workshop on SNORT. I am going to team up with my friend and colleague S. Badhrinath. Badhri and myself have already started to have set up ready for a basic workshop on SNORT. We just downloaded SNORT source code and some attack tools. We are yet to start the preparation of presentation slides. Still, we have time for this event. This is likely to happen on 25-Apr.
Since there is a holiday season coming up, I am planning to conduct few full day workshops for students in Software Engineering, Linux, Networking, Network Security in Chennai. Let me see how far I m doing this.
08 March 2009
Another fulfilling moment in my life
We (Sundar, Vinoth and myself) started from Chennai on Friday night and reached Salem Saturday early morning. Vinoth's family (Parents and his brother) gave a very warm welcome. After relaxing a bit after the journey, we reached the college around 8.30 am and met HoD of IT department. We discussed and understood his expectation from us and he insisted to have an informal and interactive session. It didn't surprise us as we prepared our lectures that way and I was more than happy because I do not know to speak formally.
At 9.30am, we started the proceedings with a warm welcome by the students and staff of IT department. I started to speak about Open Source. I planned my session for about 2 hours but wrapped by session within 30-45 minutes as I sensed that the students needed much awareness on taking some areas interest and specialize in a particular area rather than focus too much on Open Source. I feel that Open Source is of much use to the students only when they specialize in a particular area. For example, one needs to know the basics of Networking and Network Security before downloading or using SNORT intrusion detection system. While anyone can download it and do ".configure; make; make install", a lot of theoretical and systematic learning is required to make their learning meaningful. With this in mind, I thought that I would give the floor to Sundar who needed to speak on "change and how to respond to it". It would give me sometime to think about what we should do. Apart from that, I thought Sundar's talk would give students enough courage to speak up and participate. It happened exactly the same way.
Around 10.15am, Sundar talked about change and it was well received and I believe he spoke for more than an hour. Then we left for a break for 15 minutes. The students were impressive on keeping up the punctuality and they were back to their seats exactly after 15 minutes. I was inspired by it. Next, we asked the students to pick an area (Networking, Network Security, Operating System, Database, Embedded) and form groups. Asked them to write down what they already knew and what they would like to know and how they would achieve it.
The view about gaining technical knowledge is not through lectures and trainings. The lectures and trainings will give only awareness. During my session, i thought I should give that awareness and motivate the students to work consistently and specialize in their area of interests. I insisted upon having good theoretical knowledge and expand the gained theoretical knowledge with the help of Open Source Software. A long term goal would be contributing to some Open Source Products and at the same time achieving the purpose of joining an Engineering/Technology course.
We had this session for about 90 minutes and then 15 minutes Q/A session. Few students were around there for another 15-20 minutes to get their questions clarified. We could see some sparks in student's mind. Overall, I had another fulfilling day at Sona College of Technology. It was also quite a learning experience for me and yet again the students showed me so many good qualities that are needed for human beings such as mutual respect and trust. Also, I would like to emphasize and inspired by the humbleness, modesty and professionalism of HoD of Department of IT and hospitality of Mr. Iyyanar, NSS Co-ordinator of the college.





