Automated appraisal from the TFS



From a few days ago my manager request me to create appraisal for my team, this appraisal has many factors like code quality, quantity of the tasks, and many other factors.

So as you may already know in my world of automation we can automate anything and since all our work recorded on the TFS so I can extract this report from the TFS with button click.

I just enter the following, date from, date to and  then boom the report is created,  so this report can be more accurate, created in no time and has no subjective or biased . so I create the following appraisal report as a baseline, I know it will not be mature enough at the time being  but with running the experimental and your feedback it will be enhanced.

This report values should change from one to another , from my opinion all people have most of the skill set needed but with different distribution from one to another,  so this report will show what the main advantage and skills of a person and what are the other skills that need to improve?  it will also show where you can put this person,  in other word it will show the best place for this person and what is the hidden output of each one.

Appraisal

Appraisal

So let’s talk about each factor and what does it mean? and how does it calculated?

  • Completed Task

The number of completed tasks, this factor show the planning skills because the more task you will have the more planning effort you will spend, for example if there is one feature that has 10 story point size, divided by someone to 2 tasks and another person divide it to 10 tasks so the second person is spending more effort in planning activity.

  • Completed features

The number of resolved or closed feature, this is the main productivity factor, it show how the productivity of the person, remember the feature has size for example there is a feature with 10 story point and there is a feature with 30 story point, so we can calculate this factor based on the number of feature times the story points, remember if the QC team reopen the feature it will not considered until resolved latter

  • Effort

The number of actual hours spend in the tasks , for my opinion this factor has a contrast relation with the communication time and holding meetings, for example if the communication increased (there are many meetings every day) the effort will be reduced and vise versa

  • Reported issues

The number of reported issues, any issue of the system, the process or anything that could delay the smoothing  or the streamlining of the work, this factor show the positive attitude of the person for pointing to problems.

  • Resolved issues

The number of resolved issues, this factor will show the positive attitude of the person to solve problems, remember some people are  problem finders and others are problem resolvers

  • Reported enhancement

The number of requested enhancement, this factor will show the positive attitude of the person to enhance the defects of architecture, design, code or anything that not created very well, he can smell the code or the debts because this is not an issue the system work but with debts, it’s like Technical debt or Code smell, for more information about Technical debt, see  link1, link2, for more information about code smell see this link

This factor also will show the degree of the initiative of the person for introducing initiatives to the project, the team and the company

  • Resolved enhancement

The number of resolved enhancement, this factor show the positive attitude of the person for paying our debts

  • Code churn

This factor indicate the quality and maturity of the following, the code, the project, the module and so on because it’s the number of the change of the code from change-set or revision to another, for example suppose there are 3 bugs on the system and to fix these bugs you create 500 code churn,  in another application or person you only  create 5 code churn, so the second case indicate that the application is well design and coded and the person that fix these bugs write a quality code. for information about what is code churn, see this link , or see the IEEE paper for this link

  • Produced bugs

This is the number of bugs that the person produced, and since we develop by feature and we assign the developer the features so the easiest way to know who caused the bug is to assign the bug to the one that resolve the feature, this number can be calculated based on the number of bugs times the severity of the bug.

  • Resolved bugs

The number of resolved bugs and consider that the developer may resolve bugs for other developer.

  • Estimation accuracy

This is very important factor, it will be calculated based on the number of tasks, the estimation effort and the actual effort,  the problem always not the long or the short time estimation, the problem is the accurate of the estimation because the plan consist of many task WBS (Work breakdown structure) so if the project has 1000 tasks and each task only delayed 1 hour this mean you may delay the project by 1000 hours (if  them on the critical path?) which mean about 5 months, so we have to focus on accurate estimation rather than fast with no accuracy

  • Attendance degree

Of curse this information not exist on the TFS but we have a system that has this information we can extract this info to produced calculation based on the following , the number of business days, the number of vacation or late for example if we said from 1/1/2011 to 1/2/2011 there are 22 business days so every late or vacation consider as minus 1 so for 2 late and 1 day vacation it will has minus 3 so the percentage could be as the following 19/22 % = 86%

What we need to make this report effective and realistic?

  • All requirement and features must be exist on the TFS with the description, prototype and the support needed for the developer so he can start the development.
  • All requirements should size estimated (Story points) from the developers team only.
  • Any iteration should be well planned and well break down by the developers with well estimation for the time of the tasks (Effort needed)
  • No task assign to anyone out of the TFS
  • No task or activity created out of the TFS (Every activity should made through the TFS to capture time, effort, cost, etc)

At the end, this report will not be the only depenendent, we have to not forget the other factors like the project factors itself, for example we need to see all fators of the project and what is the effect of removing or assigning a resource to the project, for example the project maybe deliver faster by adding some resource to the project  but with low qulity and stability.

What we will get from doing this? we will have historical data that can be used for estimation and analysis purpose, I can well identify the skills of my team, when and where I will use them, I will know how to fast a project?  how to enhance the quality? or how to balance between them.

I hope to see your feedback to enhance this report.

Thanks

Flexibility and exception, it is not the main scenario !!



Most of people around me think that I am a person that is very sharp and not flexible at all, but actually this is not true, I believe in flexibility and exception but I also believe that the flexibility and the exception should be a few and minimize as possible but not become the main scenario !!

فانا مؤمن بقول الله تعالى في سـورة الرعـد

إِنَّ اللَّهَ لا يُغَيِّرُ مَا بِقَوْمٍ حَتَّى يُغَيِّرُوا مَا بِأَنْفُسِهِمْ

كما ان الله فرض علينا العبادات مع وجود استثناءات فى حالات معينة وهذا معناه رحمة الله بنا ولاكن ليس هذا معناه ان يكون الأستثناء هو اساس العبادة ويترك اصل العبادة

And there are many good words like the Gandhi word  “ be the change you wish to see in the world

So this why I do what I do, I just try change the world by becoming the change that I want, we fed up from the whole mess that we see in the world, we can’t let exception become the main scenario, and this not means that  we are not flexible, this mean that  we want the flexibility and exception to be limited as it suppose to be.

Good posts that need to remember



I read very good posts for coding horror and it’s awesome, so  I decide to just mark it to be remembered.

Playing poker, on how to estimate the agile story points, this technique introduced by Mike Cohn , I read this technique from long time ago but this post provided with combination of Steve McConnell word and analysis  in a very good manner

Link

LOC lines of code

Link

Checklist  for good software development

Link

MVP design pattern for Web application vs. MVC, with Example



I start reading about MVP design pattern in web application and I found it very useful, but I get out of one main important concept, the MVP pattern is very good in web application if we working with ASP.NET Web Forms because it will make the model testable but if we working with MVC it’s already a testable and more and more it can be TDD (Test driven Development) model, of course this not the only reason for MVP or MVC they also enhance the maintainability of the web application and there are many other reasons for using them.

I read many articles about MVP but most of my writing come from dot net miscellany, I create a Web form application that has MVP pattern that can download from the following link download

Download

So let’s start what is the MVP pattern?

MVP

MVP

Model View Presenter (MVP) is a software design pattern which essentially isolates the user interface from the business logic through the presenter. MVP is derived from the Model View Controller (MVC) pattern, by Martin Fowler.
The principal behind the MVP pattern is that an implementing application should be split into three core components; Model, View and Presenter:
The main concept of the MVP is that the UI is separated from the business logic and this could have many advantages as we will see

  • The Model component encapsulates all the Data in the application. This may be a database transaction or a call to a web service, or any persistence or even volatile data
  • The View component is the Presentation layer (User Interface); this may be a standard Win Forms client, an ASP.NET Web Form or Web part or Mobile client. In the MVP pattern, it will handle the rendering and accepting user input only.
  • The Presenter is controlling of the application’s actions. For example a sample operation would involve; taking user input from the View, invoking operations on the Model and if needed, setting data in the View to indicate the operations result and so on.

The advantages of MVP pattern are:

  • Isolation of User Interface from Business logic
  • The ability to change the UI from Web to Window or Mobile is very easy
  • Ability to test all code in the solution for all projects (excluding visual presentation and interaction)

We can see here that we can separate the physical class of the MVP in separate assemblies like the following architecture and layer diagram

Layers of MVP

Layers of MVP

You can download the project as I mention before from the above download link

For more information you can read the following post MSDN

Thanks

The Relational Algebra of Ramez Elmasri as MSSQL 2008 DB



******Updated August 2012 *********

I used this post as DB SQL Kata, it’s really perfect for this purpose, just give it a try to finish all these queries in 5 minutes or less from time to time and you will see how this will help you:-) enjoy…..

*****End of Update******

From long time ago and I want to create this post that cover Chapter 6,  The Relational Algebra and Calculus by Ramez Elmasri and Shamkant B. Navathe of Fundamentals of Database Systems, I study this book in the Pre-Master and of curse it’s a great book, when I prepare for my exam I search for the Database as MDF file or MS SQL script file but I didn’t found it so I decide to post an article that has the database and answer all question of  Chapter 6 using SQL statements

So you can download the scripts that create the database and insert the exactly data exist in Chapter 6  in the database, just click on the following link

Download SQL scripts files

So let’s start by introduce the schema

Ramez Elmasri Company schema

Ramez Elmasri Company schema

And now let’s see the tables with the data that will be used throughout the chapter

Employee table

Employee table

Department table

Department table

Department_Locations

Department_Locations

Project Table

Project Table

Works_on table

Works_on table

Instructor table

Instructor table

Student table

Student table

The used Keywords

  • intersect
  • union
  • except
  • in
  • not in
  • is null
  • is not null

Here is the code

use CompanyElmasri
--Select the EMPLOYEEs whose department # is 4
select Employee.Fname, Department.Dname,Department.Dnumber from Employee
join Department on Employee.Dno =Department.Dnumber where Department.Dnumber =4
--==========================================================================

--Select the EMPLOYEEs whose salary > $30,000
select Employee.Fname, Employee.Salary from Employee where Employee.Salary > 30000

--==========================================================================
--Intersection

select Students.Fname from Students intersect select Instructors.Fname from Instructors

-- intersection using join

select Students.Fname from Students join Instructors on Students.InstructorId=Instructors.Id

--==========================================================================
--Union
select Students.Fname from Students union select Instructors.Fname from Instructors

--==========================================================================
--diffrence student - instructors

select Students.Fname from Students EXCEPT select Instructors.Fname from Instructors

--diffrence instructors - student

select Instructors.Fname from Instructors EXCEPT select Students.Fname from Students

--==========================================================================

--Give the SSNs of those managers have dependent(s).
select Employee.Fname,Employee.Ssn from Employee where Employee.Ssn in(select distinct Dependent.Essn from Dependent)

--==========================================================================
--Give the SSNs non-manager employees

select Employee.Fname , Employee.Ssn from Employee where Employee.Ssn not in (select distinct Employee.Super_ssn from Employee where Employee.Super_ssn is not null)

--==========================================================================
--Give the SSNs of employees who are both supervisors and supervisees

select Employee.Fname,Employee.Ssn from Employee where Employee.Ssn in (select distinct Employee.Super_ssn from Employee) and Employee.Super_ssn is not null
--==========================================================================
--To find the dependents’ names of all female employees

select Employee.Fname, Dependent.Dependent_name from Dependent join Employee on Employee.Ssn=Dependent.Essn where Employee.Sex = 'F'

--==========================================================================
--List the names of those departments that have at least one female employee whose salary >= $25000.
select distinct Department.Dname,Employee.Sex from Department join Employee on Employee.Dno=Department.Dnumber where Employee.Sex='F' and Employee.Salary >= 25000

--==========================================================================
--List the Names and SSNs of the managers of the above departments

select Employee.Fname,Employee.Ssn, Department.Dname from Employee join Department on Employee.Dno=Department.Dnumber where Employee.Ssn in (select Employee.Super_ssn from Employee)

--==========================================================================
--find the dependents’ names of all female employees
select Dependent.Dependent_name from Dependent join Employee on Dependent.Essn =Employee.Ssn where Employee.Sex='F'

--==========================================================================
--List names and SSNs of those EMPLOYEE who work on some project(s) located in Houston
select distinct Employee.Fname, Project.Plocation from Employee  join Works_On on Employee.Ssn=Works_On.Essn join Project on Works_On.Pno=Project.Pnumber where Project.Plocation='Houston'

--==========================================================================

--List the names and birth dates of all female dependents born after 1980
select Dependent.Dependent_name,Dependent.Bdate from Dependent where Dependent.Bdate >'1980'

--==========================================================================
--List the names of all employees who earns salary > $10,000 but does not supervise anyone

select Employee.Fname from Employee where Employee.Salary > 10000 and Employee.Ssn not in (select distinct Employee.Super_ssn from Employee where Employee.Super_ssn is not null)

--==========================================================================

--Finished

Create a localized version of DisplayName attribute for MVC



As most of my followers know I am now working on MVC Enterprise project and when the time come to start refactoring my team code I found that, they didn’t use DsipalyName attribute to read from the resource file (No hard coded string to support multilingual) and when I search why they doing this I found that there is no one, so I decide to create an extension method that support this feature, of curse I search on the internet and I found a solution included in a new feature in MVC (MVC Futures release. see this article) but it needs some configuration and I don’t want any new modification to my project until I completely convert it to MVC 3.0 RTM soon. so here my custom method to create a localized version of  DsipalyName attribute.

So first I will create a class that override DisplayName


using System;
using System.ComponentModel;
using System.Reflection;
using System.Resources;

namespace Radwan
{
 public class DisplayNameLocalizedAttribute : DisplayNameAttribute
 {

 private readonly string resourceFileName;
 private readonly string resourceKey;
 private readonly Type type;

 public DisplayNameLocalizedAttribute(Type type, string resourceKey)
 {
 this.type = type;
 this.resourceKey = resourceKey;
 }

 public override string DisplayName
 {
 get
 {
 return
 new ResourceManager(this.type.FullName, Assembly.GetExecutingAssembly()).GetString(this.resourceKey);
 }
 }

 }

}

so now I can call the new version like the following

public class Employee: IEmployee
 {

 public int Id { get; set; }

 [DisplayNameLocalized(typeof(ResourceFileName), "Name")]
 public string Name{ get; set; }

 }

That’s it