Project is divided into tasks such as coding, testing. Most tasks depend on each other. For instance, testing depends on coding to be completed. Some other tasks can be run in parallel.
Let's say you have a mini project to write a customer management system. You could roughly devide it into three tasks:
- Coding UI - 5 days
- Coding backend - 7 days
- Integration of UI and backend - 2 days
If you did all of the task sequentially, the project would have taken 5 + 7 + 2 = 14 days.
Let's assume now that UI and backend coding could be done in parallel, so you can assign two developers to work at the same time. However, the integration depends on both task completed.
How long would the project take?
- UI coding starts on day 1, ends on day 5
- Backend coding starts on day 1, ends on day 7
- Integration can only start on day 8, when both UI and backend are completed, and will end on day 10.
Now, you can see, that if UI coding started on day 3, instead of first day it wouldn't actually affect the overall project deadline, because it would complete then on day 7 in time for integration to start. This is called slack, UI coding has a slack of 2 days.
On the contrary if backend coding was delayed, it would have delayed overall schedule by the same amount of days. The task does not have any slack in the schedule.
Backend coding and integration together form project's critical path: if any of the tasks is delayed, the project delivery will be delayed as well.
Project critical path can be defined is either a sequence of dependent tasks necessary to complete the project resulting in the largest duration, or alternative definition, the sequence of dependent tasks necessary to complete the project that have no slack.
Needless to say if a task lies on the critical path it's paramount that it is delivered on time, otherwise, the schedule is going to drift, increasing costs.
Tasks that are not on the critical path are permitted to have variation in duration or start time as long as it doesn't exceed the slack, otherwise they become part of the critical path themselves.