Nov 29, 2009

The World of a crazy programmer

Have seen some real life fundo code and have been amazed at how this would be maintained.

It went something like this:
private static var oGlobalClassAObject = new GlobalClassAObject(new LocalClassB(olapDataClass,false),new URLLoader(new URLRequest("../local/assets/global/returnValidate.xml),false,new XMLList(result.result.data.children));

Needless to say, I was shocked, petrified, p***** off, on seeing this code. And the best part of this story was, a new "less Geeky" guy was asked to maintain this code. He read this code for the most part of the day and then called in sick for the rest of the week (my guess is he was attending interviews to escape out of this mayhem).

I would love to see a proper commented code explaining what each and every parameter of the above class constructor would lead to. A simple one liner would not hurt, would it? And if this API is tested as it is, the chances are, this object definition would end up in the automated test cases as well. So now the virus would spread from the development to quality to validation to customer.

"Always code as if, the person who would be reading it, is a psycho who knows where to catch you".

Nov 28, 2009

The Woes of FlexUnit testing

Ant's flexunit task does not run with a native FlexUnit testrunner component. You need to ensure you use the JUnitTestRunner component with task of Ant.

(I learnt it the hardway though :))

import flexunit.junit.JUnitTestRunner;
import flexunit.framework.TestSuite;
private var jUnitTestRunner:JUnitTestRunner;

private function onInit():void{
status.text = "Unit tests running";
jUnitTestRunner = new JUnitTestRunner();
jUnitTestRunner.run(suite(),onAllTestsCompleted);
}
public static function suite():TestSuite{
var _testSuite:TestSuite = new TestSuite;
_testSuite.addTestSuite(MyTestCases);
return _testSuite;
}
private function onAllTestsCompleted():void{
fscommand("quit","");
}

This makes me wonder, why is it named as Shouldn't it be ?

Crossed to kill.

The one thing that can never happen is Development following SCRUM and QM following traditional project management. In this case Development and QM can never do business together. Whereas the philosophy of Agile (and SCRUM as well), is that you do not give the SRS requirements for the entire product upfront. The reason: You do not have the requirements upfront. They appear as you start working on the features of the product. However, the Waterfall model says that you should have all the requirements on the table, reviewed, signed off, etched in memory of the developers and finally on their graves as well. In this situation, this is what happens:
Dev: We have 10 requirements for this sprint to be developed.
QM: And how many to be tested?
Dev: Hmmm....we cannot be so sure now. The sprint has just started. We might reduce or increase the scope based on priorities.
QM: OK. Assume this is the end of the sprint. Then, how many requirements can we test?
Dev: Duh (Pondering what to answer)...
QM: OK forget it. When can I have the requirements
Dev: The SRS would be ready by the end of the day and the development will be starting tomorrow based on the SRS.
QM: (Looks at the SRS) But I see only 10 requirements. Is this all that you are going to be shipping till the end of the year?
Dev: (Losing his patience). Look, we are following SCRUM. We might have the overall scope items, but the SRS will evolve as we progress. We cannot have the entire requirements of month 8 right now.
QM: Then how do you expect the testing team to come up with test cases? We need the requirements to do this.
Dev: But that is what I am saying, you cannot have the requirements for next sprint when we are still in sprint 1.
QM: What sprint?
Dev: What what sprint?
QM: You just said something about sprint...are you planning to run away overnight?
Dev: (Sighs and murmurs the F word) I said Sprint. SPRINT. Meaning an interation in SCRUM.
QM: Don't you dare call me a SCUM. I am not a SCUM. I am the QM of this team.
Dev: OK...Let me clarify here...what model of project are you following?
QM: What do you mean by what model?
Dev: I mean, how are you planning for your tasks?
QM: We have Microsoft Project. We have been having 2 hour meetings for the past 2 months to plan for the next 10 months. We have the qm testing phase starting in Month 6. That is followed by AT in Month 8. Then we do a regression on the reported issues in Month 8 Week 2 and a final issue consolidation on end of of week 3 of Month 8. Then on the next Monday, we start with the analysis of the AT results.........
Dev: (Has just slipped into a coma)

This immediately brought to my mind the Russel Peters video (Chinese and Indian people cannot do business together):