Curious Rami

Entries categorized as ‘Software’

Software Testing

September 21, 2007 · 1 Comment

There are two flavors of software (and firmware) tests: the functionality test plan and the try-to-break-it test.

The functionality test plan involves writing test plans to test functionalities and requirements. The try-to-break-it test involves using the software in an unexpected manner without a pre-written test plan.

Managers usually lobby for the functionality test plan and developers usually lobby for the try-to-break-it test.

Both tests are important and both tests must be performed after every new release.

The try-to-break-it test verifies the quality of newly added functionalities. On the other hand, the functionality test plan verifies that all previously added functionalities are still working.

Manager: Why do we need the try-to-break-it test?
Developer: Because we need to test new functionalities now.

Developers: Why do we need the functionality test plan?
Manager: Because we need to test current functionalities in the future after new releases.

The functionality test plan should be updated after running the try-to-break-it test to include tests for all new functionalities.

 What do you think?

Categories: Project Management · Software

Voldemort killed Hermione and Snape killed Hagrid

June 22, 2007 · 2 Comments

I am not sure if this story is true or false, however it makes a point that everyone in your organization should be informed about the dangers of the internet and should be trained to spot and avoid hackers’ attacks.

The attack strategy was the easiest one.

The usual milw0rm downloaded exploit delivered by email/click-on-the-link/open-browser/click-on-this-animated-icon/back-connect to some employee of Bloomsbury Publishing, the company that’s behind the Harry crap.

It’s amazing to see how much people inside the company have copies and drafts of this book.

http://seclists.org/fulldisclosure/2007/Jun/0380.html

Categories: Blogging · Engineering · Project Management · Software · Work

What To Do When Projects Are Behind Schedule?

June 19, 2007 · 8 Comments

When projects are behind schedule; most managers will push their team to work overtime and sacrifice quality in order to ship products on schedule.

Those managers need to understand two points:

1- Working overtime does not fix the problem. As developers/engineers work more hours, their productivity declines. Moreover, sooner or later the team will burnout and hate their job.

2- Sacrificing quality is a short term solution; it will most likely get the manager a promotion or a bonus. However, eventually, the product will fail or the code will break, the truth will rise, exposing the manager’s doings, damaging their reputation and costing the company a fortune to fix all the problems.

What to do when projects are behind schedule? Simple: The only way to successfully finish the project is to cut as many features as possible.

Here is a systematic procedure to accomplish this difficult reality:

1- Stop

2- Admit that something went wrong

3- Make a decision that you are going to do something about it and that failure is not an option

4- Prioritize the project’s remaining tasks (think big - major tasks only)

5- Assign cost, time and human resources required for each task

6- The magic: get rid of as many tasks (features) as possible based on priority, cost, time and human resources required

1, 2, and 3 are lame but required.

50% of all features will never be used and are purely added for marketing purposes, get rid of them.

Let me know what you think, comment, comment, comment now!

Disclaimer: I wrote this post while listening to “Just a Car Crash Away” by Marilyn Manson.

Categories: Engineering · GPD · GTD · Getting Projects Done · Productivity · Project Management · Software · Startup · Time Management · Work

Web2.0 Graphic and CSS Generators

May 31, 2007 · 9 Comments


To accelerate the design process of http://sciencehack.com, I used the following tools (makers, generators, builders, creators, designers or whatever you want to call them):

Loading GIFs:
http://www.ajaxload.info/

Buttons:
http://www.mycoolbutton.com/

Diagonal Stripes Backgrounds:
http://www.stripegenerator.com/

Purely CSS Rounded Corners:
http://www.spiffycorners.com/

Logo:
http://h-master.net/web2.0/
http://creatr.cc/creatr/

Leave a comment with your favorite design tools.

Categories: Design · Productivity · Software · Startup · Web 2.0

Improving Reddit Stories Score Display

May 15, 2007 · 2 Comments

Reddit (http://reddit.com) score their stories by the number of points they get, which is equal to the number of up votes minus the number of down votes.

If we learned anything from politics, it is that people will disagree on everything (social issues, economics, religion, science, etc…); and when they all agree on one thing, it is probably lame, like puppies are cute, well dah!

Solution: Reddit should display both up votes and down votes next to each story.

I never click on a story unless it has over 10 points, but some stories could have 55 up votes and 50 down votes and the result is only +5 points. Well, a story that gets over 100 votes (up or down) is an important story.

Why should the story suffer when we disagree?

Save the story save the world.

-

reddit score

Categories: Design · Software

Learning CakePHP Step 1

April 22, 2007 · 13 Comments

This is a tutorial on how to design a website from scratch using CakePHP. To make the tutorial useful and challenging, I decided to clone an existing web application. One web app that I visit every day is http://news.ycombinator.com/. Y.News is a great resource for startups and it is based on Reddit.com.

To accelerate the development cycle, I copied Y.News’s .css file and HTML structure.

All that is left is the dynamic code (php) including database connection, user authentication, etc…

I first started by designing the database and followed CakePHP naming conventions. I have four tables: users, sites, comments and votes. ‘Users’ has many sites, comments, and votes; and ‘sites’ has many comments and votes.

Then I ran cakePHP’s bake.php to build the default models, controllers, and views.

Then I designed the website structure:
/sites/newest
/sites/best
/sites/submit
/sites/view
/users/add
/users/login
/users/view
/layouts/default
/errors/error404

To make the website more efficient, I added two fields, commentscount and votescount, to the sites table and updated those fields every time a new comment or a new vote is added. This saved me two additional JOIN queries.

Then I deleted all unnecessary model relationships, controller functions, and views. Most importantly, is deleting unnecessary model relationships, for example, the relationship between the votes table and the sites table is no longer needed after adding the votescount field to the sites table. Deleting relationships saves you a JOIN query.

Sometimes you will be forced to add a JOIN query. For example, /sites/view displays one site and all related comments, to show the username of the comment submitter, you will need to add a new query:

Sites.*, Comments.*, Users.username AS Auther FROM Comments INNER JOIN Users ON Users.id = Comments.user_id LEFT OUTER JOIN Sites ON Comments.site_id = Sites.id WHERE Sites.id = ‘. $id

This website was built in 4 hours; that is a lot given that this is a simple website. CakePHP is awesome if you are familiar with the API, if not it might be a bit frustrating to learn it all, but trust me it is all worth it. For example, to display the time elapsed since a site was added, you could use: $time->relativeTime($site['Site']['created']), now that is awesome!

Here are few screenshots and the source code:

reddit-1.gif

reddit-2.gif

reddit-3.gif

reddit-4.gif

Code:cakephp-tutorial-projectrar.pdf (right click, save as, rename extension to .rar)

SQL: cakephp-tutorial-projectsql.pdf (right click, save as, rename extension to .sql)

Categories: Blogging · CakePHP · Software · Startup · Web 2.0

Why Code Reviews Are a Waste of Time

March 24, 2007 · 4 Comments


Many companies have a policy to review code to verify that the company’s code standard has been followed.

Here it comes: I believe that code reviews are a waste of time and ineffective.

Spending few hours to review other’s code is not enough. To properly review new code; I believe that developers should spend at lease 20% of the time it took to write the code. For example, if it took five months to write the code, developers should spend at lease one month reviewing it.

Why managers enforce code reviews?

Most managers are aware of the uselessness of code reviews. Managers enforce code reviews because it just sounds good to say that a code review has been done, especially if it is a company policy. Moreover, code reviews have minimal effect on cost, schedule and resources.

Why developers should reject code reviews?

Approving code based on short code reviews only is very risky. Developers will be liable for approving code they reviewed. Developers should never approve code unless they are comfortable that they spend enough time reviewing it.

Moreover, code reviews are usually performed close to the end of the project cycle, even if problems are identified, it too late to fix them and retest the code.

How could you improve the process?

Code reviews are fundamentally ineffective, they don’t work. Here is a better method; make sure every developer believes in the code standard. Review the code standard and update it at least every six months. Every developer should have the opportunity to review and discuss the code standard. When developers believe in the value of the code standard, they will implement it out of habit. Stop reviewing code and trust your developers.

What do you think? Leave a comment.

Categories: GPD · GTD · Getting Projects Done · Productivity · Project Management · Software · Time Management · Work · Workhack

Productive Excel Tips

March 11, 2007 · No Comments


I recently learned a couple of productive excel tricks in my financial management class. Here they are, enjoy…

Trick 1: Naming cells

It is very useful to name a cell or a range of cells in excel. Instead of calling a cell by its coordinates (e.g. B12 or B12:B17) you can give it a name (e.g. TotalPayments or Payments).
Naming cells is especially useful if you are using cells in calculations across more than one worksheet.

To name a cell or a range of cells:

1- Click on the cell or range of cells.
2- Click on the name box, usually in the upper left corner, and type in the name.
3- Press Enter.

Here is an example with the cell name in the upper left corner and the value of the cell in the upper right corner:

Worksheet 1:

image001.png

Worksheet 1

image003.png

Worksheet 2

image005.png

Trick 2: Using a constant value in multi-row calculations

In the following example, I set the value of C2 = B2*F5. F5 is constant and will be used in every calculation in column C. However, when I click on C2 and drag the formulas down, the value of F5 doesn’t carry over; instead the next rows use F6, F7 and so on.

Excel Tips

To fix the problem use C2 = B2*$F$5 as follow:

Excel Tips

What do you think? Share your thoughts and tips.

Categories: GPD · GTD · Getting Projects Done · Productivity · Project Management · Software · Time Management · Work · Workhack