Archive for the ‘technology’ Category

Testing – do we have to?

Friday, May 2nd, 2008

Reliability is the core of good testing. As we know our systems are made from many objects/components. Our system is as reliable as components on which it is build. It obvious that when our components are n percent reliable and we have k components our system is (n/100)^k percent reliable. We can quickly realize that if we have components that are not one hundred percent reliable, our system goes to zero percent as the number of components grow. From the other point of view if all of our components are one hundred percent reliable and we introduce to our system one component which is 50% it makes that our system is now 50% reliable. Of course it is theoretical, in practice we should provide weights for our components, and the system is rather non linear.

Now we agreed that reliability is good thing, but to talk about it we should measure it in some way. Of course to measure our system we should measure our low level components. To do this we must ensure that low level objects are reliable through unit testing. We must run this tests as often as we can (probably every commit), so the most important is that this tests must execute quickly (probably 2-3 second is maximum). And for such task the automation is needed. The answer is continuous integration tools, such as ( Atlassian Bamboo, TeamCity, Hudson, CruiseControl, etc.. ..). If you heard this idiom for the first time, you should read Martin Flower article about Continuous Integration.  BTW if you heard but don’t read this article you should read it, anyway. Even maven site goal may help here. In my company we use Atlassian Bamboo and it’s great tool, Atlassian has great license politics so if your projects is open source you can count on your free bamboo license ;) . If your company didn’t has money to buy such software you should see Hudson.

Test Types :

Unit Tests – verify behavior of small elements (single class). Tests should be quick and run as often as we can. Every language has it’s own test libraries. Some of them : JUnit and TestNG (java), unittest (python), Test::Unit module (ruby).

Integration tests
- verify behavior of portion of a system, or subsystem. Requires installed external dependencies such as databases, ldap, etc.. This test tests code via API which is rather not accessible to the clients, and this test are rather quickly to execute. There are also some tools which makes this testing simpler: DBUnit (java), fixtures (ruby), pdbseed (python).

System tests – verify behavior of complete system, so all the system part must be fully installed. This kind of test runs for the long period of time, so the good idea is schedule this tests for night activity. Some of frameworks allows to do this test easily some of them not. For example we use webwork, which action class has no dependency to HTTP objects, and we can easily can test action simulating user actions.

Functional tests
– calls also as acceptance tests, provides testing from the viewpoint of client. The tools for helping us are rather language independent, they depends rather on technology which clients use, for example for web application Selenium which simulates browser behavior, but for fat client other tools are.

There are more types but they has different propose, maybe I write about it someday:

  • UI testing (GUI testing, Usability testing, Accessibility testing)
  • Speed testing (Performance testing, Load testing,   Scalability testing, Stress testing)
  • Security testing
  • Smoke testing
  • Regression testing

and many others which I can’t remember now.
Summarize

  • Categorize your tests, and run this test separately, do not trust yourself or other developer use for this task continuous integration tools or call it from cron or similar tool.
  • Remember the cycle commit-test-result must be as quick as possible, there is no benefit from result which will came after developer goes to another task.
  • Heavy tests run nightly and when developer come to work he had result from them. Remember to do this you must have this tests automated.
  • And one important thing, if you ever find a defect, write test for it. The worse thing we can met is that our defect come back, so write test for defect first than resolve the problem. One point to mention is to write this test in such way that any new behavior is also tested (for example returning null when no data found)

Question : How about your tests, the speed, the quality, the schedule ?

Pedro

SD West – last day

Friday, March 14th, 2008

The last day was little bit dull. I think because it was last day and mans was going to flights , and it was sad. First speech was “Aspect-Oriented Design and Programing in Ruby” by Dean Wampler. He creates and manages AOP ruby project called Aquarium. He shown a lot of code, and by examples of rails he shown how aspect oriented design may help even when language has enough power (meta programing). It was really interesting very advanced topic and I’m going to investigate it.

Next talk was hard to choose, in last minute as continuous working group member I decided to see “Automating Builds: Brining Quality and Testing Forward” by Zach Nies. He is co-author of very nice blog about agile methodology “theagileblog”. It was a quite good presentation.

And Ladies and Gentlemans the best of the best speech was a lunch keynote “Dances with Robots” by James McLurkin. What can I say, it was stunning presentation. Everyone after that presentation goes to Lego store to buy some Mind-Storms. James personality is so cute and pleasant. I can not describe this session even in 1 percent, so I suggest you go to James homepage and read it and if you had opportunity to see him life go there, you will be applaud. BTW the first question was “how can I start to do something like this?”.

I’m java developer so next two session was java path. First of them was “Memory Leaks in Java Applications: Different Tools for Different Types of Leaks” by Greg Sporar. With help of sample application Greg shown us different types of leaks and how to hunt them easy and quickly, good technical presentation.

The last one “Programing in Hadoop” by Owen O’Malley. He described as map-reduce algorithm, which is implemented in hadoop. He shown us some bad example when not properly used map-reduce can kill network or machines. The numbers Owen was talking about was impressive over 1000 nodes compute over 100TB data.

After that we went to see Golden Gate and by the way we go to Google campus, Roche in Paulo Alto. The roche division is next to XEROX and some others well known for IT guys companies. And of course we can’t finished in other way as going to Apple Computer Inc headquarter One Infinite Loop street in Cupertino.

See You
Pedro

SD WEST – day two

Wednesday, March 12th, 2008

First session was the workshop with Amr Elssamadisy. He is an author of great book “Patterns of Agile Practice Adoption”, which can be also downloaded FOR FREE from infoq site. Great workshop, great book, and he give me a copy of it with personal autograph.

Next I want to know something more about java nio, so I went to Ron Hitchens presentation “How to Build a Scalable, Multiplexed Java Server With NIO”. Ron is author of the “Java NIO” book. I thought that NIO is something I can learn easy, but Ron showed me how wrong I was. After this presentation, NIO is recognized as hard and scheduled to unknown time ;) . If you want to try this topic Ron put his presentation and code here.

Than was so called lunch and keynote from the Intel guy about parallelism. James Reinders told us about how important is to write programs to work in parallel. He described construction of new processors and about future intel plans.

After keynote I went to Allen Holub, He is a great speaker, talks softly and very funny. He showed us some tricks hackers can use to expose our system. He talks about XSS and XSRF. Nice talk with very real life example.

And the last talk this day was Neal Ford “Meta-Programming Ruby”. This talk was really advanced. Neal has many examples, and show deeply Ruby meta features. If you interested in Neal presentation see his home page.

I’m slowly back to normal life, a friend of mine choose Melatonin, I’m old fashioned so I’ve chosen Tyskie ;) .

SD West – the begining

Friday, March 7th, 2008

Due to our time, I will be describing SD West from the past perspective. California is great place to be, we sow so much vineries and of course Golden Gate. Than we move to sierra nevada near Lake Tahoe. One fact : The State of California (the size is similar to Poland) can be supplied for 5 years by the water drying from this lake. Than we were riding through mountains to Santa Clara. We saw nice views, so much snow. Great journey.

Next I bought my dreamed MacBook Pro machine. And so far I’m very glad of it. So this post is from my new machine.

So the first day on SD West was short, we’ve see some of the Expo and a keynote “Is Agile Really Working for You?” It was some sort of nice speech. Than we are in Intel museum, and what’s funny that all places are prepared to came with kids.

One thing to mention is Monterey Aquarium, the must see from my perspective.

Ok the next day was intensive one. First of all I went for “Clean Code:Ruby” and it was good choice. Robert Martin is great speaker. He was full of energy, and he made great speech.

Next I go for Johanna Rothman “Guerilla Agile: Stop Playing Schedule Games”. The Johanna’s experience was huge, She talks about many different situation, and what to do. So many examples, so much knowledge, hopefully there was a rest due to lunch meeting.

And finally the last presentation Jeremy Manson and Paul Tyma about “Java Performance Myths”. They pointed out some myths about performance. This was good technical presentation.

So far so good, there are two more days to describe in air view. And than I will write about few of this session in details.

See you.

Some news after may long weekend

Wednesday, May 9th, 2007

MooTools have just released version 1.1, What is MooTools ? From MooTools site „MooTools is a compact, modular, Object-Oriented javascript framework designed to make writing extensible and compatible code easier and faster. MooTools lets you get the job done efficiently and effectively.”
In version 1.1 they have optimized speed, added demos. In my opinion when you don’t have enough JS skills, MooTools allows you to achieve many nice to eye visual site decoration without pain.

Another exciting news is Sun JavaFx. Last time when I was written about Silverlight and new war between M$ and Adobe. Sun has one word to add here : “JavaFx”. The project is interesting, I looked at the demos, but I don’t know it’s not too late for this, maybe in mobile, I don’t know. But certainly I will look closer at this project later. For now it’s very controversial, but SUN can’t be wrong ;) .

Google Analytics has new functions and fillings, the second version is more web2.0 application.
I still waiting for upgrading, but friend of mine already have had upgrade. It’s look nice, has more functionality and Avinash Kaushik made great description of it

Commons Configuration version 1.4 it’s helpful library from ASF. It provide a generic interface to manage application configuration. The configuration can be read from such sources as Properties files, XML documents, JDBC , System properties, Servlet parameters and few more.

If you are sentimental, so you should appreciate gays who writes old machine emulation. Last release of amiga emulator WinUAE improves “fullscreen” mode. Of course there are others ports E-UAE for *-nix systems and Mac which has the same improvements as WinUAE. And of course inspiration for this project UAE. Good to recall hours spends on playing games.

Last quick news, if you Titter Fan so you should look here for Twittersce which allows feed access from mobile phones

SeeYa

about me

My name is Sebastian Pietrowski. I've finished Warsaw University as Master degree. I started my journey with Java 1.1 with Thread and JDBC programing in 1998 as I worked for merlin.pl. In 1999 I've passed Java Programer Certificate for Java 1.2, and was solution architect of merlin.pl infrastructure when we was moving from pl/sql to J2EE. It was great performance optimization with 10 times more req/sec than in requirements and 85 times faster as original solution.

Currently I work as Expert Software Development Java at F.Hoffmann-La Roche. The company was founded in 1896 and today, Roche employs over 80.000 people. After work I'm involved in activities related to Scala/Lift, Ruby/Rails/Merb, Python/Django. This is because I try to be pragmatic also I'm focused on application performance and tuning with success in my daily work.

My Yoda's motto: Do, or do not. There is no try.