The easiest way to ruin a project is poor Project Management. Regardless of the quality of the developers if the project is properly managed it is very easy for a good project to go bad. One tool often used to manage a project is the Build Estimate. This document/tool is used to simply outline each task of the project and the time needed to complete said task. However it is very hard to determine how far you need to break up tasks in addition to creating a reasonable estimate.

The Basics of the Build Estimate

Before beginning on my personal opinion on how to create a build estimate lets start by a simple outline of the document and its goals.

What is in a Build Estimate

  • Tasks – The first and most important element of the Build Estimate are tasks. These items identify what needs to be done for the completion of a project or a phase of the project.
  • Time Estimates – Secondly we have the time required to complete a task, it is important to create the estimate utilizing a common unit of measure which, in most cases is 1 hour of a persons time. For example if you have 3 developers and you plan for a task to take a full week using all their time you would have 120 hours or 15 days depending on if you use hours or days as your unit of measure.
  • Scope of the Estimate – Often not included in Build Estimates I personally feel it is the most important factor. Often when working on a team you send information through emails that often get forwarded or communicated to others in the company. It is very important you specify the scope of the document if you are putting together an estimate of developers time and not Project Managers, Testers, etc. it is very important you specify that so others don’t see the estimate and assume that you include test time in your build time.

What are the goals of a Build Estimate

The single purpose of the Build Estimate is to provide at a glance the total hours/days/weeks needed to complete a project based on a single developers resource. This allows Project Managers and other individuals to see how many resources need to be applied to a project to have it completed by the target delivery date. An added benefit is that the build estimate outlines for you the total cost to build the project.

Prerequisites for creating a Build Estimate

Before you can start creating your Build Estimate you need to know the requirements of the project as well as the scope. If your project has multiple releases are you estimating the hours of the whole project, each individual release, or each component of the Project. At the very least I find it helpful to group requirements by components or major features, as it then allows me to easily add up total hours of different features for a release to determine the estimate of a release.

My Standard Build Estimate

Component Task Build – Mgmt Build – DEV Build – Test Total Hours
Admin Portal Login Authentication 4 12 4 20
- - - - - -
Total Est. Hours 428

In addition to the actual estimate I often include a nomenclature sheet that defines what each column represents. The common item most people get confused on is the Build – Test column as I use this to specify the time needed for a developer to do unit and integration testing of their code, not the time needed for Quality Assurance. A second item I also will sometimes include is a requirements spreadsheet that outlines which tasks are prerequisites for other tasks, this way if release planning is ongoing everyone is aware of what tasks need to be completed to delivery a desired feature.

Understanding my Build Estimate

  • Component – This column is used to group tasks together, for example in a Web Application I often break it down to Administration, Reports, Shopping, Static Pages, or similar.
  • Task – Identifies each specific task for the given component. This can include Database setup, SQL, Java Development, and etc. This is perhaps one of the most difficult items to identify as it is easy to group tasks together or to get to specific, a good rule of them that I often use is start with the requirements list each requirement as a task then systematically go through them and break up complicated requirements to sub tasks or create tasks for necessary items needed like database setup.
  • Build – Mgmt – In a project there is always time necessary for management of both developers and communication of project status. The Build – Mgmt column I use to represent time that will be spent on meetings and similar tasks that will utilize developers time but won’t be used on actual code development.
  • Build – DEV – is used to define the time necessary to simply complete the task without any testing.
  • Build – Test – is the time needed for the developer to test their code to make sure the task is completed. This includes unit and integration testing however it does not include time necessary for Quality Assurance.
  • Total Hours – should be self explanatory as the total time needed to complete this task.

How to properly estimate a task

It is very hard to estimate the time needed to complete a task as many factors take place. The main two to keep in mind is the average skill of the developer and understanding the requirement. If you find yourself not understanding the full scope of a task then don’t simply throw numbers down take the time to discuss it with developers and managers to get an accurate estimate. Also if you yourself are a developer then it does make it easy to start putting in time on what you think it would take you, be mindful that if you have other members on the team then they may take longer on the task. The rule of thumb I personally utilize is how much time would I estimate for myself to complete then either add half or double based on how complicated the task is or how many dependencies it is based on.

Summarizing the Build Estimate

When all is said and done anyone should be able to pick-up the Build Estimate and determine the effort in building a project without knowing the details of the project. These estimates are most useful when there are multiple projects a development team is responsible as it allows managers to readily identify at what capacity the team is working and how new projects or changes to requirements of existing projects affect the delivery dates of other projects.

, ,

Release 0.4.1 is now available of the Harvest API PHP Wrapper Library. This release is a Bug Fix for those accounts that have SSL support enabled. When utilizing the 0.4 version of the library you may notice that if you set SSL to true that you will not get any results back from the server, this is because the cURL library is trying to authenticate the SSL certificate and failing. 0.4.1 contains a bug fix were the CURLOPT_SSL_VERIFYPEER option is set to false. This makes it so the certificate is not validated and results are returned successfully.

To stay up-to-date with all the recent changes please visit the main HarvestAPI release page.

Today I was running some tests on my T-SQL Procedures and noticed that for some reason my Select statement was performing in seconds compared to my Procedure which would take minutes to complete. After a few hours I stumbled upon my mistake I had used the date datatype in the procedure parameters when my database table was of type datetime, by switching the variable to a varchar(30) datatype the procedures performance had increased and functioned with the same IO count and time as the select statement.

Incorrect Procedure Statement

CREATE PROCEDURE P_RULE_MULTI_LOCATION
@startDate DATE,
@endDate DATE
AS
BEGIN
 
SELECT * FROM ACTIVITY_LOG WHERE ACTION_TS >= @startDate AND ACTION_TS < @endDate
 
END

Correct Procedure Statement

CREATE PROCEDURE P_RULE_MULTI_LOCATION
@startDate VARCHAR(30),
@endDate VARCHAR(30)
AS
BEGIN
 
SELECT * FROM ACTIVITY_LOG WHERE ACTION_TS >= @startDate AND ACTION_TS < @endDate
 
END

The simple above change enhances the queries performance where it can use both an index and its position when performing the select statement. While the date to datetime comparison does not allow for the index position to be used due to the conversion. It may not make the most sense but if you find your procedure functioning slower than your direct sql query you may want to check your datatypes to make sure that they are the same.

, , , , ,

Most if not all PHP developers are aware of the getdate function and how it returns an associated array of the current time and date.

$current_time= getdate();
print_r( $current_time );

Output Format:

Array
(
    [seconds] => 40
    [minutes] => 58
    [hours]   => 21
    [mday]    => 17
    [wday]    => 2
    [mon]     => 6
    [year]    => 2003
    [yday]    => 167
    [weekday] => Tuesday
    [month]   => June
    [0]       => 1055901520
)

However this function is not very useful when you want perform Date Comparisons and Manipulations. Instead you will want to use the DateTime object of PHP.

The DateTime Class

The DateTime Object by default gets instantiated to the current time when being constructed. If however you want to instantiate it at a different date you can pass in a string representation of the date.

$date = new DateTime( ); // same as new DateTime( "now" );
$date2 = new DateTime( '2010-01-01');

It is important to remember that you can use any string in the DateTime constuctor that you would use in the strtotime function. This means you could instantiate the date and time of last Monday, next Friday and etc.

$date = new DateTime( "last Monday" );
$date2 = new DateTime( "next Friday" );

Manipulating Dates

To modify your DateTime objects you can use the add and sub methods that utilize DateInterval objects for representing amounts or you can use the modify method which takes a string as a parameter. I personally find the modify method easier to utilize.

$date = new DateTime();
$date->add( new DateInterval( "P5D" ) );
$date->modify( "+5 days" );

Comparing Date Objects

Comparing Dates is now easy as the DateTime object supports basic equality and comparison functions (==, <, >, etc ). So if you want to check if a date is before another you would simply:

$date = new DateTime( "2003-12-17" );
$date2 = new DateTime( "2005-6-19" );
if( $date < $date2 ) {
  // additional logic
}

Resources

, , , , , ,

Calling an object method in Ruby behind the scenes is actually a message to another object or Message Passing. These can more easily be understood by an example, and for that reason lets look at a basic multiplication script.

3 x 4
</ruby>
As you are aware everything in Ruby is an object, including an integer. Therefor the above operation is really a call to the <em>x</em> method of the integer object.
<pre lang="ruby">
3.x(4)

So far this isn’t very surprising as you are calling the multiplication method of the integer object, however you can call the same method by using the send function passing the method name and parameters. This is called Message Passing.

3.send "x" 4

You may wonder why does it matter. The answer simply put is that you can call any method of an object regardless of its visibility by using the send method. If you want to call a private method of an object that you normally wouldn’t be able to call then by using send you can do so. Ruby has actually tried to restrict this functionality but has been forced to retain it and instead also now provides a public_send method in version 1.9 for those cases you don’t want to access private methods.

Seriously what is the point to having Method Visibility if the underlying fundamentals of the language itself allow developers to bypass them. A ball was definitely dropped somewhere during the creation of the Ruby language.

, , ,