Tuesday, 20 February 2018

Five Conflict Resolution Techniques Every Employee/Manager Should Know(from PMBOK)

The interesting thing is that everyone irrespective of your field can and needs to master these skills. For me as a Software Engineer, I use to think that I only needed technical skills, but I was so wrong after I worked for about two years. So I took a course in Project Management and got certified as a Project Management Professional(PMP). Those managerial skills I acquired has helped me a great deal in managing people and situations in the workplaces.

 

Now I still work as a Software Engineer, but I could tell you for sure that people-management skill very much supercedes technical stills. The five skills are:
  1. Withdraw/Avoid
  2. Smooth/Accomodate
  3. Compromise/Reconcile
  4. Force/Direct
  5. Collaborate/Problem Solve
  6. Final Notes

Let's now examine this five techniques for resolving conflicts. As you examine the scenarios, look for areas you can apply it in you own work environment.


1. Withdraw/Avoid

-Five Techniques
This technique involves avoiding any potential situation that may lead to conflict, or assuming for a moment that the conflict doesn't exist. Or maybe planning to handling the issue at a later time when you are prepared and have the time.

Scenario: You observe a strained relationship between two employee such that they always dissagree anytime there is a meeting

Application: Don't get involved. And also try to avoid having both employees in the same meeting

Result: The conflict is resoved temporarilty but remains

2. Smooth/Accomodate

-Five Techniques
In this case, we try to focus on areas of concensus and deemphasize on areas of difference. Here the manager yeilds to the popular opinion if his personal opinion is in conflict.

Scenario: A manager is conducting a meeting and points out the need for a compulsory overtime to meet the project schedule

Application: Most of the team members object to the recommendation. The manager ends keeping the overtime optional but encouraging everyone to work extra hours anytime it is convienient for them

Result: Conflict among the team is resolved. But the may sometimes the organization have to give to make this work.


3. Compromise/Reconcile

-Five Techniques
The Compromise/Reconcile techniqe involves looking for options that woul result in some degree of satisfaction to all team members or would partially resolve the conflict. This is similar to the Smooth/Accomodate but with a a little difference.

Scenario: A number of employee complain about low quality of PPE(Personal Protective Equipment) which has already been procured. Meanwhile some employees has been issued a higher quality PPE which is currently out of stock.

Application: Discuss with the employees with a lower quality PPE, have them fill out a form requesting for new PPEs. Then quickly approve these request and the allow the procurement department to sort out the rest.

Result: Temporary Solution to the conflict

4. Force/Direct

-Five Techniques
In this case, on forces his opinion on others using the authorities he have.

Scenario: The manager of the IT department decides that every morning, all team member meet by a 8:20 am for a meeting to discuss the day's activities. An administrator points out that he is normally at the data center at that time for backups/audit. The software automation test engineer object saying he normally runs tests between 8.00 and 8.30 am. Other team members raised objections too. The Deputy Manager does not say a word.

How it is can be applied: The manager responds that he would not tolerate exceptions to this rule and he expects 100% compliance irrespective of whatever reasons anyone may give.

Result: Temporary solution with unpredictable aftereffects, even posibility of bigger conflicts.


5. Collaborate/Problem Solve

-Five Techniques
 This is probably the best way of resolving conflicts as it involves incoporatin multiple viewpoints and opinions from different perspectives. I may require coporation and transparent dialog which eventually leads to a lasting outcome

Scenario: The Contract Manager meets a software engineer in the IT department and requests that he works with him for two months to develop a data entry form for logging change requests made on site. This request would be a difficult one due to the work load of the Software Engineer in his  department being the only Softwar Engineer there.

How it can be applied: The Software Engineer recommends that Contracts Manager speaks with the IT Department manager which he does. Meanwhile, the Software Engineer in a mail also informs his manager of ther request from the contracts manager. The IT Department manager calls the Software Engineer and discusses with him asking if he can fulfill the request. He agrees but points out that he can only go for one month. The Contract Manager is invited and the three reaches an agreement that the Software Engineer would work with him for one month at a time. Everyone is satisfied.

Result: Lasting resolution to the conflict and commitment from all parties.


Final Notes

-Five Techniques
Although these techniques applies mainly to managers, everyone could learn from the principles in them. Sadly, some employees/managers does not have knowlegde of what to do in times of conflict in the work place.
In the next article, we would examine how to manage potential conflicts with colleagues in the workplace.

(Based on PMBOK Guide, 5th Edition)

Monday, 19 February 2018

What are Delegates in C#

A delegate in C# can be conpared to a function pointer in C and C++. It allows programmers to specify what the funtion to be called will look like without having to specify the particular function.



A delegate is a reference type variable that hods th reference to a function, which can change at runtime.
Delegates are very useful when programing UI controles where events have to be implemented for callbacks.

Normal Function Call Without Delegate
In normal function call, we specify the function to be called directly. So if a funciton is defined an a class named SomeClass and has a function called Do(), then the function can be called using the syntax:
SomeFunction.Do()


namespace DelegateDemo
{
    public class SomeClass
    {
        public void Process()
        {
            Console.WriteLine("Process() begin");
            Console.WriteLine("Process() end");
        }
    }

    public class Test
    {
        static void Main(string[] args)
        {
            SomeClass myClass = new SomeClass();
            myClass.Process();
        }
    }
}


The above code works perfectly in most situaition. However, there may be sometimes when we dont' want to call  a function directly. We need to pass it to some ohter method to call it. This would be neccessary  in an event driven system sucha s a graphical user interface applicaiton. In this case we would like some code to be executed when a user clicks on a button, or when I want to log some informaiton but cannot at the moment specify how it would be logged.

Three Steps to Using a Delegate
Step 1: Declaration
Step 2: Instantiation
Step 3: Invocation


Declaring Delegates in C#
Declaration of delegates determines that methods that can be referenced by the delegate. For a delegate to refer to a function, the function must have the signature of that delegate.

Consider the example:
public delegate int SomeDelegate (string );

The delegate declare above can be used to reference any function that has a single string parameter and returns an int type variable.
The syntax for delegate declaration is :

delegate return-type identifier ([parameters]);

where:
return-type: The return type  which has to be the same as the return type of the function
identifier: Name of the delegate
parameters: The parameters to the function

Instatiating Delegates
After a delegate have been declared, a delegate object msut be created with the new keyword and be associated with the a particular method. When creating a delegate, the argument passed to the new expression is written similar to a function call, but without arguments to the function.
For example:

public delegate void writeString(string s);

writeString d1 = new writeString(ToScreen);
writeString d2 = new writeString(ToFile);

In the above example, a delegate called writeString() is delared that takes a single string.
The we instantiate two delegates d1 and d2 using 

The function below illustrates how to delare, instantiate and use delegates to reference functions that take int values and returns int values.


    class Program
    {
        static int num = 10;
        delegate int NumDelegate(int n); //DECLARE A DELEGATE NumDelegage
        public static int Add(int val1)
        {
            num = num + val1;
            return num;
        }
        public static int Mult(int val2)
        {
            num = num + val2;
            return num;
        }
        public static int getNum()
        {
            return num;
        }
        static void Main(string[] args)
        {
            //CREATE THREE NEW DELEGATE INSTANCES
            NumDelegate nd;
            NumDelegate nd1 = new NumDelegate(Add);
            NumDelegate nd2 = new NumDelegate(Mult);
 
            nd = nd1;  //nd1 PERFORMES Add(5) GIVING 15
            nd = nd + nd2; //nd2 PERFORMS Mult(10) GIVIN 50

            //MULTICASTING (EXPLAINED BELOW)
            nd(5);
            Console.WriteLine("Value of Num: {0}", getNum());
            Console.ReadKey();
        }
    }

In the above code, a delegate is created called NumDelegate that would point to a method that takes an integer parameter.
In the main program, three delegates are instantiated nd, nd1 and nd2.
At the end of the program the output would be 65.
Part 2: Multicast

Threading Tutorial in C# .Net - Part 1

In this lesson, we would cover the basics on threading in C# and how to implement threading in C#.

Content
  1. Introduction to Threading
  2. The Thread Life Cycle in C#
  3. Main Thread
  4. Some Useful Properties 
  5. Some Useful Methods of a Thread
  6. Creating Threads in C#
  7. Notes on Threading

1.  Introduction to Threading
'A thread is a the smallest sequence of programmed instruction that can be managed independently' - Wikipedia.
A thread can run independently in parallel with other threads. Languages that support multithreading makes it easy to optimize the cpu time by limiting the time the CPU is idle.

2.  Thread Life Cycle
The life cycle of a thread begins when a Thread object is created and ends when the thread is completes execution or is terminated.

The life cyle of a thread in C# are the following:

Unstarted State: The instance of a thread is created but the start method have not been called

Ready State: The thread is waiting for the cpu time

Not Runnable State: When either the Sleep method is called on a thread, then the Wait method is called or when the thread is blocked by I/O  operations

Dead State: The create completes its execution or is aborted.


3.  The Main Thread
The main thread is the first thread to be executed in a C# program.
When a C# program starts running, the main thread is created automatically. The thread is created using the Thread class. Any thread created other than the main thread is called a child thread of the main thread.
A thread can be accessed using the CurrentThread property of the Thread class.

namespace ThreadingTutorial
{
    class Program
    {
        static void Main()
        {
            Thread t = new Thread(Thread2);          // Create a new thread
            t.Start();                               // Start Thread 2

            // This is the main thread executing simultaneously with Thread 2
            for (int i = 0; i < 10; i++) 
            {
                Console.WriteLine("Main Thread");
            }
        }
        static void Thread2()
        {
            for (int i = 0; i < 10; i++) Console.Write("Thread 2");
        }
    }
}

Program 1: Execution of Main Thread and Thread2 simultaneously

When the program executes, the output would be something like shown in the figure:


Figure 2: Output of execution of two threads


In Program 1, the main thread starts and creates a child thread called t. The child thread t executes a function called Thread2. Note that when when thread is created, the function to be executed is passed in as a parameter. We would explain this program a bit more to help you understand it. For now, try to enter this program in your IDE and run it to see what output you have. If you have any challenges you could leave a comment by the left of this page.

4.  Some Useful Properties of a thread
Let's now look at a some of the important properties of a thread you need to know
CurrentThread. This property gets or sets currently running thread
IsAlive: Gets the value indicating the execution status of the current thread
Name: Gets of sets the name of the thread
Priority: Gets or sets the values indicating the schedulling priority of a thread relative to other threads

5.  Some Useful Methods of a thread

public void Abort(): Calling this method terminates the thread

public void Interrupt(): Interrupts a thread that is in the WaitSleepJoin thread.

public void Join(): Blocks the calling thread untill a thread terminates. This means that you need to wait for the thread to end.

public void Start(): Start the execution of a  thread

public static void Sleep(int miliseconds): The Sleep() method pauses the current thread for a specific period of time.

public static bool Yield(): Ths causes the calling thread to yield execution to another thread that is ready to run on the current processor..

6.  Creating Threads in C#
Threads are created using the Thread class' constructor. Just like you saw in Program 1, you create a new instance of a thread and pass as argument, the function you want to be executed.
The function you pass into the thread's constructor is actually the ThreadStart delegate which indicates wheret the execution of the thread should begin.

class ThreadTest
{
  static void Main() 
  {
    Thread t = new Thread (new ThreadStart (Go));
 
    t.Start();   // Run Go() on the new thread.
    Go();        // Simultaneously run Go() in the main thread.
  }
 
  static void Go()
  {
    Console.WriteLine ("Ndeewo nu!");
  }
}


In this case, the thread t executes the Go() method, the same time the main thread calls Go(). The output would be that the string "Ndeewo nu!" is printed twice simultaneously.

But if you use the expression:


Thread t = new Thread (Go);    // No need to explicitly use ThreadStart

Then C# would determinte TheadStart delegate.We would discuss more on delegates in Part 2.

7.  Notes on Threading
Multithreading in .Net is managed by the thread scheduller. The scheduller ensures that all active threads  are alllocated execution time slots and  that the threads that are waiting or blocked does not tie down the CPU.

Tuesday, 13 February 2018

How to Create a Software Test Plan

What is a Test Plan?
An Software Test Plan or simply a Test Plan is a formal document containing details of the testing activities to be carried out during the software development process. The test plan details the following:
  • Testing Strategy
  • Testing Objectives
  • Testing Criteria
  • Required resources
  • Test estimates
A Test plan is used as a guide in conducting software testing activities as defined in the process.

Having understood what a test plan is, let's now discuss the process of developing a test plan.

Note: 
A test plan is different from a test suite which is a collection of related test cases.

Step of Creating a Test Plan
First know that the creation of a test plan takes considerable effort and time. Let's now look at the steps involve developing a test plan.
  1. Analyse the Product Being Developed
  2. Design a Test Strategy
  3. Establish the Test Objectives
  4. Define the Test Criteria
  5. Plan the Resource Needs
  6. Plan the Test Environment
  7. Make a Schedule and Estimate Time and Resource Needs
  8. Determine Test Deliverables
This steps take place in a loosely sequencial manner as illustrated in the figure.


1. Analyze the Product
To be able to carry out a complete test, you need to understand the application being developed. You need to find out who the users of the application will be. What will be the purpose of the system? Under what environment will the system work.
You can analyze the product in the following ways:
  • Interveiw the customer and developers
  • Review the product documents
  • Peform walkthrough

2. Design a Test Strategy
 Development of a Test Strategy is normally done by a Test Manager. A test strategy documents the following:
The project testing objectives as well as the means to achieve them
The testing efforts and related costs
To develop an effective strategy, the following steps can be taken:
  • Specify the scope of the testing (and out of scope as well)
  • Identify the Testing Types
  • Document Risks and mitigation plans
  • Define test logisitcs

3. Define the Test Objectives
The test objective is the overall goal of the testing process. The test objectives included making sure that "all" the defects are detected and corrected. All may not be possible but as many defects as possible.
To define the objective, the following steps are taken:
  • List all the features of the system
  • Define goals of each test based on the features


4. Define the Test Criteria
Test criteria is the factors upon which the performance of the software testing process is evaluated.
The two criteria that need to be defined includes Success Criteria and Exit Criteria.
Suspension Criteria: This is the criteria to be met for the testing process to be suspended until the criteria is handle. An example of suspension criteria is failure of 50% of the test cases. This means that if 50% of the test cases fail, the the testing process is suspended until the developers fixes the defects.
Exit Criteria: This is criteria that specifies that the testing exits a particular phase to the next phase.

5. Plan the Resources
Resource plan is a details summary of all the types of resources need to complete the testing tasks. Resources include both human and material resources needed to do the testing activities.

6. Plan the Test Environment
A test environment is a setup of both the software and hardware system required to execute the test suites. Note that test environment also included users(whether real or simulated) that would be used to carry out the tests.
Example of test environment could be:
  • One database server
  • Two web servers
  • An application server
  • Six Client Systems(Desktops)
  • Two Mobile (tablet or mobile phone)
  • Network connection of all the systems
  • Internet Connection
  • Wireless connection to the network

7. Schedule and Estimation
Schedule and Estimation has to do with the breakdown of the whole testing project into chunks of activities.
The schedule details the estimate of the activities and the amout of time each activity would take to complete. Then a total estimate of the overall time is obtained.
This could be acccomplished by creating a Work Breakdown structure using an application such as Primevera or Excel Spreadsheet.

8. Test Deliverables
A deliverable is the finished product to be presented after a process. In the case of Software Testing, the test deliverables is a list of all the documents, tools and other artifacts developed and maitained in the support of the testing process.
The three categories of test deliverable includes:

Deliverables before testing
Test plan documents
Test suites of test cases

Deliverables during testing
Test Scripts
Test Data
Traceability matrix
Execution logs and error logs

Deliverables after testing
Test results and reports
Defect reports
Installation procedures
Release notes

What Next?
Putting it all together, we would now develop a simple test plan for a hypothetical web application for a banking system.


Monday, 12 February 2018

Top 10 Sure Automation Testing Interview Questions and Answers

It is important to note that if you will be sitting for an interview for an Automation Test Engineer, you can expect to be asked questions from the following areas:
  • Sofware Developement Process
  • Manual Testing
  • Some Language Specific questions (sometimes)
  • Communication Skills


Question 1: What is Software Automation Testing?
Hint: Give a very simple and clear explanation in your own words
Answer: Software Automation Testing is the processes involve in automated verification and validation of  software being developed.


Question 2: Mention the types of Testing you know
Hint: Don't give details, just mention them. The more you mention, the better.
Answer: The types of testing includes
  • Unit Test
  • Sanity Test
  • Regression Test
  • Build Deployment Test
  • API test
  • Integration Test
  • System test

Question 3: What is a Test Plan and what are contained in it?
Answer: A Test plan is a formal document that outlines all the neccessary details relating to the testing activities and strategies to be adopted for the Software Development process. The test plans outlines the following:
  • Test Strategy
  • Testing Objectives
  • Resources
  • Test Schedule
  • Estimates
  • Test deliverables

Question 4: Why do you think is a Test Plan neccessary?
Answer: The benefits of a test plan includes the following
  1. It helps in determining the effort required for the testing process
  2. It serves as a guide to streamline the testing activities
  3. It helps people outside the team  to understand what is involved in the testing
  4. It helps to improve the effectiveness of the test process


Quesiton 5: What is a Test Case and what does it contain?
Answer: A test case is a single unit of test that is carried out. A test case contains the following:
  • Title (Test Scenario)
  • Description (Test Case)
  • Test Steps
  • Test Data
  • Expected Results
  • Actual Results 
  • Precondition and Postcondition (optional)


Question 6: What is a Traceability Matrix?
Answer: A traceability matrix is a way to link a business requirement to a corresponding functional requirement ut to the corresponding test cases.


 Question 7: What is a Framework and what are some types of Autmation framework?
 Answer: A test framework is a set of guidlines and rules that are followed in the creation of test cases. It is a combination of tools and practices and standards to be adopted for the test process. Some of the types of automation framework include:
  • Keyword-driven framework
  • Data-driven framework
  • Hybrid test framework
  • Linear automation framework

Question 8: When is it Neccessary to apply Automation Testing?
  • When there are a  large number build verification test cases
  • When there a many repetitive tests to be carried out
  • Whn there are frequesnt reguression testings
  • When there is need to simulate a large number of users who are using the application resources
  • When manual testing is not reliable for critical functionalities

Question 9: What is Build Verification Test (BVT)
Build Verification tests are set of tests carried out on every new build to ensure that the build meets certain testing criteria befor it is released to the test team for further testing.

Question 10:What are the Steps in Creating a Test Plan
  1. Analyze the product being developed
  2. Design a test strategy
  3. Define the Test Objectives
  4. Defing the Test Criteria
  5. Plan Test resources
  6. Plan the test environment
  7. Prepare a Schedule
  8. Prepare an Estimate(Cost)
  9. Determine the Test Deliverables

Bonus Question: What are some Automation Test Tools you know?
Hint: This is very important. This is a test to see if you spend some time learning about automation.
Answer: You must mention Selenim! Than others are:
  • Selenium
  • JMeter
  • QTP
What we presented in this article is just basics. You need to read a little wider, if you are to really get involved in testing activities.
Thank you for reading and remember to check from time to time for updates.