Two Tasks in Ten Minutes: Task-Focused Development with C/C++

by David Shepherd, September 30th, 2010

Most C++ projects have thousands of files. In the course of working on a single task developers can find themselves asking:

“What file was I just working with?”

As they resume a task from earlier that day or even that week they try to recall:

“What files were relevant to this task?”

As they send a bug to another developer the new developer asks:

“Which files did my co-worker find relevant?”

Fortunately for C++ developers Tasktop automatically tracks which files are relevant for a given task. Tasktop uses this information, called task context, to focus developers’ views on only the relevant files, to repopulate views when they resume a task, and to populate their co-workers views when they pass off a task. In this blog entry we’ll show how Tasktop’s ability to focus enables Dave the Developer to work on a task, fix a bug, and then finish his original task all within a span of 10 minutes.

Task List Task Editor Project Explorer
(a) Task List (b) Task Editor (c) Focused Project Explorer

Focusing on a Single Task
Dave the Developer has been tasked with improving and maintaining a program for managing archives in the Windows operating systems. To begin his work he opens the Task List (a). His Task List includes several queries, which download tasks from his bug tracker into his IDE. He has a query for all tasks assigned to him and a query for all major bugs. Because there are no major bugs he chooses the top task from this list to work on. He opens Task #9 “Show drive bar at the bottom of panel” in the Task Editor (b) to read the details of the task. Once the task is understood he begins working, browsing source code and making changes. As he works, Tasktop automatically tracks the files that he is touching and shows only the most relevant ones in the Project Explorer (c), filtering the hundreds of irrelevant files in the project. Note that Tasktop not only filters the Project Explorer but that it focuses many other views, such as the Outline View and the code editor (see Get Focused below). The filtering Tasktop provides helps Dave focus on the task at hand.

Task List Critical Bug Project Explorer
(a) Task List (b) Task Editor (c) Focused Project Explorer

Collaborating on Tasks
As Dave is working on Task #9 his colleague, Paul the programmer, is processing incoming bugs for the project. He comes across Task #10 “hangs after unplugging drive”. Paul begins working on Task #10 but quickly realizes that Dave would be better suited for this particular bug. So, Paul uploads his context (i.e., the list of relevant files) to the task and reassigns it to Dave.

As Dave is working on Task #9 he notices that a new bug appears in his Task List (a) under the query “Major Bugs”. He immediately opens the Task Editor (b) for this task and decides to switch to the Task #10 because it is causing problems for users. When Dave activates this task he has the option to use the attached context, which he does. Thus, when Dave starts this task the Project Explorer (c) and several other views are automatically populated with relevant files. Because he knows which files to start from Dave can quickly find and fix the offending code in the file hotplug.cpp. He commits his updates and closes this bug.

Project Explorer Project Explorer Commit Template
(a) Files for Critical Bug (b) Files for Task #9 (c) Auto-Populated Commit

One-Click Multitasking
Next Dave turns his attention back to Task #9. Initially the Project Explorer (a) shows files from the critical bug that he has just been working on but as soon as he reactivates Task #9 the Project Explorer filters those files and shows files relevant to Task #9 (b). After a few more changes to panel.cpp Dave is ready to commit his updates. When he selects commit the commit template is automatically filled out with the summary of his task and a link to the task (c). In addition to never having to fill out commit templates this gives great traceability between code and intent when Dave looks at the code in the future.

Focused Outline Code Folding Change Set Management
(a) Focused Outline (b) Focused Code Folding (c) Managed Change-Sets

Get Focused
Today we’ve shown you only a fraction of the focus that Tasktop brings to C++. Tasktop can also (a) focus your Outline View, (b) focus your source code by folding irrelevant elements, and (c) automatically organize your changes according to change-sets. To download your tasks into Eclipse and begin working focused try the free trial of Tasktop Pro which connects to most popular defect trackers and project managements systems.

One Response to “Two Tasks in Ten Minutes: Task-Focused Development with C/C++”

  1. Tasktop Blog » Blog Archive » New HP Quality Center, Microsoft and IBM Rational Integrations Says:

    [...] View the full post [...]

Leave a Reply